File tree Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Expand file tree Collapse file tree 2 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ import pandas as pd
6666import statsmodels.api as sm
6767from statsmodels.iolib.summary2 import summary_col
6868from linearmodels.iv import IV2SLS
69+ import seaborn as sns
70+ sns.set_theme()
6971```
7072
7173### Prerequisites
@@ -100,8 +102,6 @@ between GDP per capita and the protection against
100102expropriation index
101103
102104``` {code-cell} python3
103- plt.style.use('seaborn')
104-
105105df1.plot(x='avexpr', y='logpgp95', kind='scatter')
106106plt.show()
107107```
@@ -701,4 +701,4 @@ for $\beta$, however `.solve()` is preferred as it involves fewer
701701computations.
702702
703703``` {solution-end}
704- ```
704+ ```
Original file line number Diff line number Diff line change @@ -361,15 +361,16 @@ Using this series, we can plot the average real minimum wage over the
361361past decade for each country in our data set
362362
363363``` {code-cell} ipython
364- %matplotlib inline
365364import matplotlib.pyplot as plt
366- plt.rcParams["figure.figsize"] = (11, 5) #set default figure size
367- import matplotlib
368- matplotlib.style.use('seaborn')
365+ import seaborn as sns
366+ sns.set_theme()
367+ ```
369368
370- merged.mean().sort_values(ascending=False).plot(kind='bar', title="Average real minimum wage 2006 - 2016")
369+ ``` {code-cell} ipython
370+ merged.mean().sort_values(ascending=False).plot(kind='bar',
371+ title="Average real minimum wage 2006 - 2016")
371372
372- #Set country labels
373+ # Set country labels
373374country_labels = merged.mean().sort_values(ascending=False).index.get_level_values('Country').tolist()
374375plt.xticks(range(0, len(country_labels)), country_labels)
375376plt.xlabel('Country')
@@ -468,12 +469,10 @@ minimum wages in 2016 for each continent.
468469object
469470
470471``` {code-cell} python3
471- import seaborn as sns
472-
473472continents = grouped.groups.keys()
474473
475474for continent in continents:
476- sns.kdeplot(grouped.get_group(continent).loc['2015'].unstack(), label=continent, shade =True)
475+ sns.kdeplot(grouped.get_group(continent).loc['2015'].unstack(), label=continent, fill =True)
477476
478477plt.title('Real minimum wages in 2015')
479478plt.xlabel('US dollars')
@@ -617,4 +616,4 @@ plt.show()
617616```
618617
619618``` {solution-end}
620- ```
619+ ```
You can’t perform that action at this time.
0 commit comments