0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Pandasの平均処理・リスト化

Posted at

#Pandasの平均処理
列の平均処理は

average = df.mean()

でよいのですが、これをlist化するとindexが外れて数値だけをリスト化することができます。

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

"""
人気        8.326087
着          8.022222
タイム     84.191111
着差        1.653333
馬体重    442.130435
dtype: float64
"""

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?