Return the flattened underlying data as an ndarray or ExtensionArray.
Deprecated since version 2.2.0: Series.ravel is deprecated. The underlying array is already 1D, so ravel is not necessary. Use to_numpy() for conversion to a numpy array instead.
Flattened data of the Series.
See also
numpy.ndarray.ravelReturn a flattened array.
Examples
>>> s = pd.Series([1, 2, 3])
>>> s.ravel()
array([1, 2, 3])
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Series.ravel.html