Skip to content

Commit 9effc51

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
update thatsnew text
1 parent adcf531 commit 9effc51

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

doc/source/whatsnew/v2.0.0.rst

+6-8
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,12 @@ The new behavior, as for datetime64, either gives exactly the requested dtype or
296296
Empty DataFrames/Series will now default to have a ``RangeIndex``
297297
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298298

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

308306
*Previous behavior*:
309307

0 commit comments

Comments
 (0)