Skip to content

Commit baf9866

Browse files
committed
updates to proofreading
1 parent 83b7b7d commit baf9866

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lectures/pandas.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def update_row(row):
376376
df.apply(update_row, axis=1)
377377
```
378378

379-
**4.** We can use the `.applymap()` method to modify all *individual entries* in the dataframe altogether.
379+
**4.** We can use the `.map()` method to modify all *individual entries* in the dataframe altogether.
380380

381381
```{code-cell} ipython3
382382
# Round all decimal numbers to 2 decimal places
@@ -398,7 +398,7 @@ df
398398

399399
The `zip()` function here creates pairs of values from the two lists (i.e. [0,3], [3,4] ...)
400400

401-
We can use the `.applymap()` method again to replace all missing values with 0
401+
We can use the `.map()` method again to replace all missing values with 0
402402

403403
```{code-cell} ipython3
404404
# replace all NaN values by 0
@@ -617,11 +617,11 @@ wb.series.info('GC.DOD.TOTL.GD.ZS')
617617

618618
```{code-cell} ipython3
619619
govt_debt = wb.data.DataFrame('GC.DOD.TOTL.GD.ZS', economy=['USA','AUS'], time=range(2005,2016))
620-
govt_debt
620+
govt_debt = govt_debt.T # move years from columns to rows for plotting
621621
```
622622

623623
```{code-cell} ipython3
624-
govt_debt.plot();
624+
govt_debt.plot(xlabel='year', ylabel='Government debt (% of GDP)');
625625
```
626626

627627
## Exercises

0 commit comments

Comments
 (0)