http://docs.python.jp/3/library/statistics.html#module-statistics
statistics
,
mean
, median
, mode
import statistics as st
= [3, 1, 4, 1, 5, 9]
s print('データ = ', s)
print('平均値 = ', st.mean(s))
print('中央値 = ', st.median(s))
print('最頻値 = ', st.mode(s))
データ = [3, 1, 4, 1, 5, 9]
平均値 = 3.8333333333333335
中央値 = 3.5
最頻値 = 1
from
, import
from statistics import mean, median, mode
= [3, 1, 4, 1, 5, 9]
s print('データ = ', s)
print('平均値 = ', mean(s))
print('中央値 = ', median(s))
print('最頻値 = ', mode(s))
from statistics import mean as 平均値
from statistics import median as 中央値
from statistics import mode as 最頻値
= [3, 1, 4, 1, 5, 9]
s print('データ = ', s)
print('平均値 = ', 平均値(s))
print('中央値 = ', 中央値(s))
print('最頻値 = ', 最頻値(s))
https://twitter.com/hyuki/status/714042600550834176 https://twitter.com/momijipan/status/714044960949927936 https://twitter.com/hogelog/status/714045072203853829 https://twitter.com/methane/status/714046217106292736