-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
API: dont do inference on object-dtype arithmetic results #49999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
doc/source/whatsnew/v2.0.0.rst
Outdated
@@ -348,6 +348,7 @@ Other API changes | |||
- Passing a sequence containing a type that cannot be converted to :class:`Timedelta` to :func:`to_timedelta` or to the :class:`Series` or :class:`DataFrame` constructor with ``dtype="timedelta64[ns]"`` or to :class:`TimedeltaIndex` now raises ``TypeError`` instead of ``ValueError`` (:issue:`49525`) | |||
- Changed behavior of :class:`Index` constructor with sequence containing at least one ``NaT`` and everything else either ``None`` or ``NaN`` to infer ``datetime64[ns]`` dtype instead of ``object``, matching :class:`Series` behavior (:issue:`49340`) | |||
- :func:`read_stata` with parameter ``index_col`` set to ``None`` (the default) will now set the index on the returned :class:`DataFrame` to a :class:`RangeIndex` instead of a :class:`Int64Index` (:issue:`49745`) | |||
- Changed behavior of :class:`Index`, :class:`Series`, and :class:`DataFrame` arithmetic methods when working with object-dtypes, the results no longer do type inference on the result of the array operations (:issue:`49714`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So users would now call convert_dtypes
to get close to the old behavior?
Might be good to mention because while this is more consistent behavior it's probably a little more inconvenient for users to work with object type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
infer_objects, will update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think adding this note will have to wait until 1) i add infer_objects to Index and possibly 2) a copy=False
option is added to infer_objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated + green
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just merged the infer_objects(copy=)
PR, does that need to be included here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ill add the copy=False
in my next "assorted cleanups" branch
Thanks @jbrockmendel |
Looks like this caused a slowdown. Is this expected? |
best guess is #50306 will address that |
Sounds reasonable, thanks for the quick response |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Broken off from #49714, which also changes TimedeltaArray inference behavior. This is exclusively Index/Series/DataFrame.