Pandas averaging and listing

Pandas average processing

The average processing of columns is

average = df.mean()

However, if you list this, the index will be removed and you can list only the numerical values.

df_average = list(df.mean())
print(df.mean())
print(df_average)

"""
Popular 8.326087
Arrival 8.022222
Time 84.191111
Dressing difference 1.653333
Horse weight 442.130435
dtype: float64
"""

"""
[8.326086956521738, 8.022222222222222, 84.19111111111113, 1.653333333333333, 442.1304347826087]
"""

Recommended Posts

Pandas averaging and listing
jupyter and pandas installation
pandas index and reindex
pandas resample and rolling
Correspondence between pandas and SQL
Key additions to pandas 1.1.0 and 1.0.0
Pandas
Precautions when using codecs and pandas
[Pandas] Find quartiles and detect outliers
Ignore # line and read in pandas
Import of japandas with pandas 1.0 and above
A little scrutiny of pandas 1.0 and dask
[pandas] .csv file reading and display method
Grouping csv and getting minimum value (pandas)
Load csv with pandas and play with Index
How to use pandas Timestamp and date_range
Read CSV and analyze with Pandas and Seaborn