@@ -150,14 +150,14 @@ the row index (`.unstack()` works in the opposite direction - try it
|
150 | 150 | out) |
151 | 151 | |
152 | 152 | ```{code-cell} ipython3 |
153 | | -realwage.stack(future_stack=True).head() |
| 153 | +realwage.stack().head() |
154 | 154 | ``` |
155 | 155 | |
156 | 156 | We can also pass in an argument to select the level we would like to |
157 | 157 | stack |
158 | 158 | |
159 | 159 | ```{code-cell} ipython3 |
160 | | -realwage.stack(level='Country', future_stack=True).head() # future_stack=True is required until pandas>3.0 |
| 160 | +realwage.stack(level='Country').head() |
161 | 161 | ``` |
162 | 162 | |
163 | 163 | Using a `DatetimeIndex` makes it easy to select a particular time |
@@ -167,7 +167,7 @@ Selecting one year and stacking the two lower levels of the
|
167 | 167 | `MultiIndex` creates a cross-section of our panel data |
168 | 168 | |
169 | 169 | ```{code-cell} ipython3 |
170 | | -realwage.loc['2015'].stack(level=(1, 2), future_stack=True).transpose().head() # future_stack=True is required until pandas>3.0 |
| 170 | +realwage.loc['2015'].stack(level=(1, 2)).transpose().head() |
171 | 171 | ``` |
172 | 172 | |
173 | 173 | For the rest of lecture, we will work with a dataframe of the hourly |
@@ -401,7 +401,7 @@ plt.show()
|
401 | 401 | We can also specify a level of the `MultiIndex` (in the column axis) |
402 | 402 | to aggregate over. |
403 | 403 | |
404 | | -In the case of `groupby` we need to use `.T` to transpose the columns into rows as `pandas` has deprecated the use of `axis=1` in the `groupby` method. |
| 404 | +In the case of `groupby`, we need to use `.T` to transpose the columns into rows, as `pandas` has removed support for `axis=1` in the `groupby` method. |
405 | 405 | |
406 | 406 | ```{code-cell} ipython3 |
407 | 407 | merged.T.groupby(level='Continent').mean().head() |
@@ -432,7 +432,7 @@ plt.show()
|
432 | 432 | summary statistics |
433 | 433 | |
434 | 434 | ```{code-cell} ipython3 |
435 | | -merged.stack(future_stack=True).describe() |
| 435 | +merged.stack().describe() |
436 | 436 | ``` |
437 | 437 | |
438 | 438 | This is a simplified way to use `groupby`. |
|