-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: Index.to_native_types #36418
DEPR: Index.to_native_types #36418
Conversation
LGTM |
@@ -212,6 +212,7 @@ Deprecations | |||
- Deprecated parameter ``dtype`` in :~meth:`Index.copy` on method all index classes. Use the :meth:`Index.astype` method instead for changing dtype(:issue:`35853`) | |||
- Date parser functions :func:`~pandas.io.date_converters.parse_date_time`, :func:`~pandas.io.date_converters.parse_date_fields`, :func:`~pandas.io.date_converters.parse_all_fields` and :func:`~pandas.io.date_converters.generic_parser` from ``pandas.io.date_converters`` are deprecated and will be removed in a future version; use :func:`to_datetime` instead (:issue:`35741`) | |||
- :meth:`DataFrame.lookup` is deprecated and will be removed in a future version, use :meth:`DataFrame.melt` and :meth:`DataFrame.loc` instead (:issue:`18682`) | |||
- The :meth:`Index.to_native_types` is deprecated. Use ``.astype(str)`` instead (:issue:`28867`) |
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.
looking at the docstring for to_native_types, .astype(str) does not cover all the options.
@jorisvandenbossche if I am correct, what the to_native_types method does is add some extra formatting options? These could in principle be useful for users as well? #23820 (comment) 😉
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.
yeah this is almost entirely internal.
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.
Those can indeed be potentially useful, but some of them are exposed through display options already, if you want to control how your dataframe is formatted.
Further, I think the main thing is that we simply don't want to have this method in this form public ;) And I mainly wanted to give some alternative (for the default arguments), can also leave it out if will only confuse.
There has been discussion about a generic format()
method (#17211)
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.
yeah this is almost entirely internal.
API documented https://pandas.pydata.org/pandas-docs/dev/reference/api/pandas.Index.to_native_types.html
And I mainly wanted to give some alternative (for the default arguments), can also leave it out if will only confuse.
since public, I think the release note should stay.
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.
Yeah, I only meant to remove the " Use .astype(str)
instead " part. We regularly have methods that are deprecated without direct alternative if we don't think it is worth mentioning.
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.
lgtm. some test failures?
Environment build issues on Travis, also happening on master |
thanks @jorisvandenbossche |
Closes #28867