pandas.Series.ravel — pandas 2.2.3 documentation (original) (raw)

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.

Examples

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