8000 DEPR: Deprecate ravel by phofl · Pull Request #56053 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content
Prev Previous commit
Next Next commit
Fix doctest
  • Loading branch information
phofl committed Nov 19, 2023
commit 5a153892425a7dec5acb925d86ceb741c1bf0338
12 changes: 6 additions & 6 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,14 +858,9 @@ def ravel(self, order: str = "C") -> ArrayLike:
Examples
--------
>>> s = pd.Series([1, 2, 3])
>>> s.ravel()
>>> s.ravel() # doctest: +SKIP
array([1, 2, 3])
"""
warnings.warn(
"Series.ravel is deprecated. Use numpy.ravel directly.",
FutureWarning,
stacklevel=find_stack_level(),
)
arr = self._values.ravel(order=order)
if isinstance(arr, np.ndarray) and using_copy_on_write():
arr.flags.writeable = False
Expand Down Expand Up @@ -943,6 +938,11 @@ def view(self, dtype: Dtype | None = None) -> Series:
4 2
dtype: int8
"""
warnings.warn(
"Series.view is deprecated and will be removed in a future version.",
FutureWarning,
stacklevel=find_stack_level(),
)
# self.array instead of self._values so we piggyback on NumpyExtensionArray
# implementation
res_values = self.array.view(dtype)
Expand Down
0