Skip to content

Commit 65147e2

Browse files
Terji PetersenTerji Petersen
authored andcommitted
update thatsnew text
1 parent c021595 commit 65147e2

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
@@ -316,14 +316,12 @@ The new behavior, as for datetime64, either gives exactly the requested dtype or
316316
Empty DataFrames/Series will now default to have a ``RangeIndex``
317317
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
318318

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

328326
*Previous behavior*:
329327

0 commit comments

Comments
 (0)