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
- A :class:`MultiIndex` previously stored the level names as attributes of each of its
133
+
:attr:`MultiIndex.levels`. From Pandas 1.0, the names are only accessed through
134
+
:attr:`MultiIndex.names` (which was also possible previously). This is done in order to
135
+
make :attr:`MultiIndex.levels` more similar to :attr:`CategoricalIndex.categories` (:issue:`27242`:).
136
+
137
+
*pandas 0.25.x*
138
+
139
+
.. code-block:: ipython
140
+
141
+
In [1]: mi = pd.MultiIndex.from_product([[1, 2], ['a', 'b']], names=['x', 'y'])
142
+
Out[2]: mi
143
+
MultiIndex([(1, 'a'),
144
+
(1, 'b'),
145
+
(2, 'a'),
146
+
(2, 'b')],
147
+
names=['x', 'y'])
148
+
Out[3]: mi.levels[0].name
149
+
'x'
150
+
151
+
*pandas 1.0.0*
152
+
153
+
.. ipython:: python
154
+
155
+
mi = pd.MultiIndex.from_product([[1, 2], ['a', 'b']], names=['x', 'y'])
156
+
mi.levels[0].name
157
+
127
158
- :class:`pandas.core.arrays.IntervalArray` adopts a new ``__repr__`` in accordance with other array classes (:issue:`25022`)
128
159
129
160
*pandas 0.25.x*
@@ -149,6 +180,7 @@ Backwards incompatible API changes
149
180
Other API changes
150
181
^^^^^^^^^^^^^^^^^
151
182
183
+
- :class:`pandas.core.groupby.GroupBy.transform` now raises on invalid operation names (:issue:`27489`)
152
184
- :meth:`pandas.api.types.infer_dtype` will now return "integer-na" for integer and ``np.nan`` mix (:issue:`27283`)
153
185
- :meth:`MultiIndex.from_arrays` will no longer infer names from arrays if ``names=None`` is explicitly provided (:issue:`27292`)
154
186
- In order to improve tab-completion, Pandas does not include most deprecated attributes when introspecting a pandas object using ``dir`` (e.g. ``dir(df)``).
@@ -162,6 +194,7 @@ Documentation Improvements
162
194
^^^^^^^^^^^^^^^^^^^^^^^^^^
163
195
164
196
- Added new section on :ref:`scale` (:issue:`28315`).
197
+
- Added sub-section Query MultiIndex in IO tools user guide (:issue:`28791`)
165
198
166
199
.. _whatsnew_1000.deprecations:
167
200
@@ -221,6 +254,7 @@ Categorical
221
254
222
255
- Added test to assert the :func:`fillna` raises the correct ValueError message when the value isn't a value from categories (:issue:`13628`)
223
256
- Bug in :meth:`Categorical.astype` where ``NaN`` values were handled incorrectly when casting to int (:issue:`28406`)
257
+
- :meth:`DataFrame.reindex` with a :class:`CategoricalIndex` would fail when the targets contained duplicates, and wouldn't fail if the source contained duplicates (:issue:`28107`)
224
258
- Bug in :meth:`Categorical.astype` not allowing for casting to extension dtypes (:issue:`28668`)
225
259
- Bug where :func:`merge` was unable to join on categorical and extension dtype columns (:issue:`28668`)
226
260
- :meth:`Categorical.searchsorted` and :meth:`CategoricalIndex.searchsorted` now work on unordered categoricals also (:issue:`21667`)
@@ -290,6 +324,9 @@ Indexing
290
324
- Bug in reindexing a :meth:`PeriodIndex` with another type of index that contained a `Period` (:issue:`28323`) (:issue:`28337`)
291
325
- Fix assignment of column via `.loc` with numpy non-ns datetime type (:issue:`27395`)
292
326
- Bug in :meth:`Float64Index.astype` where ``np.inf`` was not handled properly when casting to an integer dtype (:issue:`28475`)
327
+
- :meth:`Index.union` could fail when the left contained duplicates (:issue:`28257`)
328
+
- :meth:`Index.get_indexer_non_unique` could fail with `TypeError` in some cases, such as when searching for ints in a string index (:issue:`28257`)
0 commit comments