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
66
66
import statsmodels.api as sm
67
67
from statsmodels.iolib.summary2 import summary_col
68
68
from linearmodels.iv import IV2SLS
69
+ import seaborn as sns
70
+ sns.set_theme()
69
71
```
70
72
71
73
### Prerequisites
@@ -100,8 +102,6 @@ between GDP per capita and the protection against
100
102
expropriation index
101
103
102
104
``` {code-cell} python3
103
- plt.style.use('seaborn')
104
-
105
105
df1.plot(x='avexpr', y='logpgp95', kind='scatter')
106
106
plt.show()
107
107
```
@@ -701,4 +701,4 @@ for $\beta$, however `.solve()` is preferred as it involves fewer
701
701
computations.
702
702
703
703
``` {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
361
361
past decade for each country in our data set
362
362
363
363
``` {code-cell} ipython
364
- %matplotlib inline
365
364
import 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
+ ```
369
368
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")
371
372
372
- #Set country labels
373
+ # Set country labels
373
374
country_labels = merged.mean().sort_values(ascending=False).index.get_level_values('Country').tolist()
374
375
plt.xticks(range(0, len(country_labels)), country_labels)
375
376
plt.xlabel('Country')
@@ -468,12 +469,10 @@ minimum wages in 2016 for each continent.
468
469
object
469
470
470
471
``` {code-cell} python3
471
- import seaborn as sns
472
-
473
472
continents = grouped.groups.keys()
474
473
475
474
for 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)
477
476
478
477
plt.title('Real minimum wages in 2015')
479
478
plt.xlabel('US dollars')
@@ -617,4 +616,4 @@ plt.show()
617
616
```
618
617
619
618
``` {solution-end}
620
- ```
619
+ ```
You can’t perform that action at this time.
0 commit comments