Skip to content

Commit 98148ba

Browse files
Terji PetersenTerji Petersen
authored andcommitted
update thatsnew text
1 parent f0b1a83 commit 98148ba

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

doc/source/whatsnew/v2.0.0.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,12 @@ The new behavior, as for datetime64, either gives exactly the requested dtype or
314314
Empty DataFrames/Series will now default to have a ``RangeIndex``
315315
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
316316

317-
When users don't specify indexes or columns when instantiating :class:`DataFrame` or :class:`Series`
318-
objects, pandas infers the index type for them. Previously, if it was not possible to
319-
infer the index type from the data, pandas used to infer the index to be a :class:`RangeIndex`,
320-
except when the frame/series was empty, then the index was inferred to be an :class:`Index`
321-
with dtype ``object``.
322-
323-
This has been changed, so the type of index/columns will always be :class:`RangeIndex`,
324-
when users don't declare the index and it's not possible to infer the index type from the data (:issue:`49572`).
317+
When users instantiate :class:`DataFrame` or :class:`Series` objects without specifying the axes (``index=None``
318+
and/or ``columns=None``), pandas infers the index type for them. Previously, when instantiating
319+
in such cases, and it was not possible to infer the index type from the passed-in ``data``,
320+
pandas used to infer the index to be a :class:`RangeIndex`, except when constructing an empty (length 0)
321+
``Series`` or ``DataFrame`` without specifying the axes (``index=None``, ``columns=None``)
322+
then it would return the axes as empty Indexes with object dtype. Now, the axes return an ``RangeIndex`` in that case also (:issue:`49572`).
325323

326324
*Previous behavior*:
327325

0 commit comments

Comments
 (0)