Skip to content

Commit 805470b

Browse files
Tom's second edits of hyperinflation lecture June 15
1 parent 9a46004 commit 805470b

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

lectures/inflation_history.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ kernelspec:
1111
name: python3
1212
---
1313

14-
+++ {"user_expressions": []}
14+
1515

1616
# Price Level Histories
1717

@@ -24,16 +24,19 @@ We want to construct four graphs from "The Ends of Four Big Inflations" from cha
2424
This is chapter 3 of the book **Rational Expectations and Inflation** that I shared with you a couple of days ago.
2525

2626

27-
```python
27+
28+
```{code-cell} ipython3
2829
import numpy as np
2930
import pandas as pd
3031
import matplotlib.pyplot as plt
3132
import matplotlib.dates as mdates
3233
import datetime
3334
```
3435

35-
```python
36-
!pip install xlrd
36+
37+
```{code-cell} ipython3
38+
:tags: [hide-output]
39+
!pip install xlrd
3740
```
3841

3942
The graphs depict logarithms of price levels during the early post World War I years for four countries:
@@ -72,7 +75,7 @@ The spreadsheet refers to the tables that I now describe for each of our four co
7275

7376

7477

75-
```python
78+
```{code-cell} ipython3
7679
def process_entry(entry):
7780
"Clean each entry of a dataframe."
7881
@@ -146,7 +149,7 @@ def create_plot(p_seq, e_seq, index, labs, ax):
146149
return ax1
147150
```
148151

149-
```python
152+
```{code-cell} ipython3
150153
# import data
151154
xls = pd.ExcelFile('datasets/chapter_3.xlsx')
152155
@@ -174,11 +177,11 @@ df_Aus, df_Hung, df_Pol, df_Germ = df_list
174177
* Table 3.3, rdf_Aus.indexetail prices, $\exp p$
175178
* Table 3.4, exchange rate with US
176179

177-
```python
180+
```{code-cell} ipython3
178181
df_Aus.head(5)
179182
```
180183

181-
```python
184+
```{code-cell} ipython3
182185
p_seq = df_Aus['Retail price index, 52 commodities']
183186
e_seq = df_Aus['Exchange Rate']
184187
@@ -199,11 +202,11 @@ plt.show()
199202
* Table 3.10, price level $\exp p$ and exchange rate
200203

201204

202-
```python
205+
```{code-cell} ipython3
203206
df_Hung.head(5)
204207
```
205208

206-
```python
209+
```{code-cell} ipython3
207210
m_seq = df_Hung['Notes in circulation']
208211
p_seq = df_Hung['Hungarian index of prices']
209212
e_seq = 1/df_Hung['Cents per crown in New York']
@@ -232,11 +235,11 @@ I spliced the three series - Wholesale price index, Wholesale Price Index: On pa
232235

233236
I dropped the exchange rate after June 1924, when zloty was adopted, because we don't have the price measured in zloty and old currency in June to compute the exchange rate adjustment.
234237

235-
```python
238+
```{code-cell} ipython3
236239
df_Pol.head(5)
237240
```
238241

239-
```python
242+
```{code-cell} ipython3
240243
# splice three price series in different units
241244
p_seq1 = df_Pol['Wholesale price index'].copy()
242245
p_seq2 = df_Pol['Wholesale Price Index: On paper currency basis'].copy()
@@ -260,7 +263,7 @@ e_seq = 1/df_Pol['Cents per Polish mark (zloty after May 1924)']
260263
e_seq[e_seq.index > '05-01-1924'] = np.nan
261264
```
262265

263-
```python
266+
```{code-cell} ipython3
264267
lab = ['Wholesale Price Index', '1/Cents per Polish Mark']
265268
266269
# create plot
@@ -277,12 +280,11 @@ plt.show()
277280
* Table 3.18, wholesale price level $\exp p$
278281
* Table 3.19, exchange rate
279282

280-
```python
283+
```{code-cell} ipython3
281284
df_Germ.head(5)
282285
```
283286

284-
285-
```python
287+
```{code-cell} ipython3
286288
p_seq = df_Germ['Price index (on basis of marks before July 1924, reichsmarks after)'].copy()
287289
e_seq = 1/df_Germ['Cents per mark']
288290
@@ -298,7 +300,7 @@ plt.show()
298300

299301
Jiacheng: I add the new graph here.
300302

301-
```python
303+
```{code-cell} ipython3
302304
p_seq = df_Germ['Price index (on basis of marks before July 1924, reichsmarks after)'].copy()
303305
e_seq = 1/df_Germ['Cents per mark'].copy()
304306
@@ -325,15 +327,15 @@ There might be some ambiguity about exactly which column in the "balance sheets"
325327
**Seecond Steps:** There are some fun additonal things we can plot to set the stage for our cagan_ree and cagan_adaptive notebooks. For example, we have the data to plot logs of real balances around the times of the stabilizations. We can hunt for instances of "velocity dividends".
326328

327329

328-
```python
330+
```{code-cell} ipython3
329331
# import data
330332
df_fig5 = pd.read_excel('datasets/longprices.xls', sheet_name='all', header=2, index_col=0).iloc[1:]
331333
df_fig5.index = df_fig5.index.astype(int)
332334
333335
df_fig5.head(5)
334336
```
335337

336-
```python
338+
```{code-cell} ipython3
337339
# create plot
338340
cols = ['UK', 'US', 'France', 'Castile']
339341

0 commit comments

Comments
 (0)