You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Note:** This package often returns data with year information contained in the columns. This is not always convenient for simple plotting with pandas so it can be useful to transpose the results before plotting
536
536
537
537
```{code-cell} ipython3
538
-
data = data.T # transpose to get data series as columns and years as rows
539
-
data_usa = data['USA'] # obtain a simple series of USA data
538
+
data = data.T # Obtain years as rows
539
+
data_usa = data['USA'] # Series of US data
540
540
```
541
541
542
542
The `data_usa` series can now be plotted using the pandas `.plot` method.
@@ -575,7 +575,8 @@ mystnb:
575
575
---
576
576
# Fetch gini data for all countries
577
577
gini_all = wb.data.DataFrame("SI.POV.GINI")
578
-
gini_all.columns = gini_all.columns.map(lambda x: int(x.replace('YR',''))) # remove 'YR' in index and convert to int
0 commit comments