@@ -151,27 +151,23 @@ API changes
151
151
.. ipython:: python
152
152
:suppress:
153
153
154
+ np.random.seed(1234)
154
155
from itertools import product
155
156
tuples = list(product(('a', 'b'), ('c', 'd')))
156
157
mi = MultiIndex.from_tuples(tuples)
157
158
df_multi = DataFrame(np.random.randn(4, 2), index=mi)
158
- tuple_ind = pd.Index(tuples)
159
-
160
- .. ipython:: python
161
-
159
+ tuple_ind = pd.Index(tuples,tupleize_cols=False)
162
160
df_multi.index
163
161
164
- @suppress
165
- df_multi.index = tuple_ind
162
+ .. ipython:: python
166
163
167
164
# Old behavior, casted MultiIndex to an Index
168
- df_multi.set_index(df_multi.index)
169
-
170
- @suppress
171
- df_multi.index = mi
165
+ tuple_ind
166
+ df_multi.set_index(tuple_ind)
172
167
173
168
# New behavior
174
- df_multi.set_index(df_multi.index)
169
+ mi
170
+ df_multi.set_index(mi)
175
171
176
172
This also applies when passing multiple indices to ``set_index``:
177
173
@@ -214,10 +210,6 @@ API changes
214
210
(and numpy defaults)
215
211
- add ``inplace`` keyword to ``Series.order/sort`` to make them inverses (:issue:`6859`)
216
212
217
- - Remove the ``copy`` keyword from ``DataFrame.xs``,``Panel.major_xs``,``Panel.minor_xs``. A view will be
218
- returned if possible, otherwise a copy will be made. Previously the user could think that ``copy=False`` would
219
- ALWAYS return a view. (:issue:`6894`)
220
-
221
213
.. _whatsnew_0140.sql:
222
214
223
215
SQL
@@ -422,6 +414,10 @@ Deprecations
422
414
old argument ``lags`` is used by name. (:issue:`6910`)
423
415
- The ``order`` keyword argument of :func:`factorize` will be removed. (:issue:`6926`).
424
416
417
+ - Remove the ``copy`` keyword from :meth:`DataFrame.xs`, :meth:`Panel.major_xs`, :meth:`Panel.minor_xs`. A view will be
418
+ returned if possible, otherwise a copy will be made. Previously the user could think that ``copy=False`` would
419
+ ALWAYS return a view. (:issue:`6894`)
420
+
425
421
.. _whatsnew_0140.enhancements:
426
422
427
423
Enhancements
@@ -483,7 +479,7 @@ Enhancements
483
479
- Implemented ``Panel.pct_change`` (:issue:`6904`)
484
480
- Added ``how`` option to rolling-moment functions to dictate how to handle resampling; :func:``rolling_max`` defaults to max,
485
481
:func:``rolling_min`` defaults to min, and all others default to mean (:issue:`6297`)
486
- - ``CustomBuisnessMonthBegin`` and ``CustomBusinessMonthEnd`` are now available (:issue:`6866`)
482
+ - ``CustomBuisnessMonthBegin`` and ``CustomBusinessMonthEnd`` are now available (:issue:`6866`)
487
483
488
484
Performance
489
485
~~~~~~~~~~~
0 commit comments