- The underlying data storage in the pandas classes, Series and DataFrame is the type numpy.ndarray.
- The instance method ravel() returns the flattened underlying data for a panads Series object.
- This method is often useful when sending data to interfaces where a pandas Series is not accepted, but a numpy ndarray is accepted.
# Example Python program that retrieves the underlying ndarray
import pandas as pds
numberList = [50, 60, 70, 80, 90];
numberSeries = pds.Series(numberList);
underlying = numberSeries.ravel();
print("Data present in the pandas Series:");
print("Data as the ndarray:");
Data present in the pandas Series:
Data as the ndarray:
[50 60 70 80 90]