Skip to content

Commit

Permalink
DOC: improve warnings for Series.{real,imag} (pandas-dev#27651)
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari authored and jorisvandenbossche committed Jul 30, 2019
1 parent 1125126 commit be1a43c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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 @@ -958,7 +958,9 @@ def real(self):
.. deprecated 0.25.0
"""
warnings.warn(
"`real` has be deprecated and will be removed in a " "future verison",
"`real` is deprecated and will be removed in a future version. "
"To eliminate this warning for a Series `ser`, use "
"`np.real(ser.to_numpy())` or `ser.to_numpy().real`.",
FutureWarning,
stacklevel=2,
)
Expand All @@ -976,7 +978,9 @@ def imag(self):
.. deprecated 0.25.0
"""
warnings.warn(
"`imag` has be deprecated and will be removed in a " "future verison",
"`imag` is deprecated and will be removed in a future version. "
"To eliminate this warning for a Series `ser`, use "
"`np.imag(ser.to_numpy())` or `ser.to_numpy().imag`.",
FutureWarning,
stacklevel=2,
)
Expand Down

0 comments on commit be1a43c

Please sign in to comment.