I have a distance matrix in hand where I would like to get its max,min, mean, median, etc. values; expected describe() to do it for me, but looks like I was wrong. Both
from scipy.stats import describe and
df.describe() work either on columns or rows.
What might be other approaches than calling each method separately?
Convert the 2-D DataFrame to a 1-D Series:
series = pd.Series(df.values.ravel())
In : df = pd.DataFrame(np.random.random((5,4))) In : series = pd.Series(df.values.ravel()) In : series.describe() Out: count 20.000000 mean 0.514002 std 0.332819 min 0.001209 25% 0.298695 50% 0.528073 75% 0.804711 max 0.973840 dtype: float64