Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.25.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Numeric
Conversion
^^^^^^^^^^

-
- Improved the warnings for the deprecated methods :meth:`Series.real` and :meth:`Series.imag` (:issue:`27610`)
-
-

Expand Down
8 changes: 6 additions & 2 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,9 @@ def real(self):
.. deprecated:: 0.25.0
"""
warnings.warn(
"`real` has be deprecated and will be removed in a future version",
"`real` has be deprecated and will be removed in a future "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"`real` has be deprecated and will be removed in a future "
"`real` is deprecated and will be removed in a future "

fixing an existing typo at once

"version. To eliminate this warning for a Series ser, use "
"`np.real(ser.to_array())` or `ser.to_array().real`.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the to_array be a to_numpy ?

FutureWarning,
stacklevel=2,
)
Expand All @@ -973,7 +975,9 @@ def imag(self):
.. deprecated:: 0.25.0
"""
warnings.warn(
"`imag` has be deprecated and will be removed in a future version",
"`imag` has be deprecated and will be removed in a future "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"`imag` has be deprecated and will be removed in a future "
"`imag` is deprecated and will be removed in a future "
"version. To eliminate this warning for a Series ser, use "
"`np.imag(ser.to_array())` or `ser.to_array().imag`.",
FutureWarning,
stacklevel=2,
)
Expand Down