LoginSignup
0
0

More than 3 years have passed since last update.

【Python】チートシート(標準機能外含む)〜数学的統計的な特徴を添えて〜

Last updated at Posted at 2021-02-11

逐次追加していきます.
当面の予定:数値処理,文字列処理,型システム

数値処理

算術平均

数値列の代表値の1つ. 分散と組み合わせて使うことで, 数値列の分析に利用できる. 代表値ととして単独で使うには中央値,最頻値の方が適切なため文脈に沿った使い分けが必要.数値列の各値の確率が同様に確からしい場合に限り期待値と同値になる.

$$ \bar{x} = \frac{1}{n}\sum_{i=1}^{n}x_i $$

分散

数値列の値の散らばり具合を表す。分散が大きいほど、散らばっている数値列となり、統計的には回帰と呼ばれる手法での分析、予測が困難になる。

$$ \bar{x} = \frac{1}{n}\sum_{i=1}^{n}(x_i - \bar{x})^2 $$

import numpy as np

sai = np.array([1,2,3,4,5,6])
print(np.mean(sai))    # 算術平均
print(np.var(sai))     # 分散
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