-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: DtypeWarning message enhancement #58250
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
ENH: DtypeWarning message enhancement #58250
Conversation
89369f5
to
8c6b027
Compare
doc/source/whatsnew/v3.0.0.rst
Outdated
@@ -37,6 +37,7 @@ Other enhancements | |||
- Users can globally disable any ``PerformanceWarning`` by setting the option ``mode.performance_warnings`` to ``False`` (:issue:`56920`) | |||
- :meth:`Styler.format_index_names` can now be used to format the index and column names (:issue:`48936` and :issue:`47489`) | |||
- :meth:`DataFrame.cummin`, :meth:`DataFrame.cummax`, :meth:`DataFrame.cumprod` and :meth:`DataFrame.cumsum` methods now have a ``numeric_only`` parameter (:issue:`53072`) | |||
- ``DtypeWarning`` improved to include column names when mixed data types are detected (:issue:`58174`) |
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.
- ``DtypeWarning`` improved to include column names when mixed data types are detected (:issue:`58174`) | |
- :class:`.errors.DtypeWarning` improved to include column names when mixed data types are detected (:issue:`58174`) |
@@ -8,6 +8,8 @@ | |||
|
|||
from pandas.io.parsers.c_parser_wrapper import _concatenate_chunks | |||
|
|||
COLUMN_NAMES = ["column_0", "column_1"] |
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.
Could you just inline this where it's used?
|
||
if warning_columns: | ||
warning_names = ",".join(warning_columns) | ||
warning_names = ", ".join( | ||
[f"{index}: {name}" for index, name in enumerate(warning_columns, start=0)] |
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.
[f"{index}: {name}" for index, name in enumerate(warning_columns, start=0)] | |
[f"{index}: {name}" for index, name in enumerate(warning_columns)] |
8c6b027
to
d050d4e
Compare
d050d4e
to
405b00f
Compare
Thanks @abeltavares |
Co-authored-by: Abel Tavares <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.