pandas.Series.ravel#

Series.ravel(order='C')[source]#

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.

Returns:
numpy.ndarray or ExtensionArray

Flattened data of the Series.

See also

numpy.ndarray.ravel

Return a flattened array.

Examples

>>> s = pd.Series([1, 2, 3])
>>> s.ravel()  
array([1, 2, 3])