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.

データの数値的要約 

Posted at

データ解析の基本的な要約法である数値的要約について書いていきます。

#一次元データの要約

import  numpy as np

x=np.array([1,2,3,4.5,5,6.5,7,8,9,10])

average=np.mean(x)  ///平均値   mean関数///
(Out  5.6)

med=np.median(x)   ///中央値  median関数///
(Out  5.75)

var.p=np.var(x)  ///標本分散  var関数///
(Out  8.19)

std=np.std(x)   ///標準偏差  std関数///
(Out  2.86)

各言葉の意味についてはこちらを参考にしてください。
https://note.com/karaage_love/n/n6f617d38c528

#二次元データの要約

import numpy as np
import matplotlib.pyplot as plt

array=np.loadtxt(fname='example.csv',delimiter=',',encoding="utf-8_sig")
///example.csvには二列のデータが入っています。///

array_x=array[:,0]
array_y=array[:,1]  ///スライス///

plt.scatter(araay_x,array_y,s=10,c='blue',alpha='0.5')  

///散布図の作成    sは大きさのこと cは散布図の色のこと  alphaは透明度のこと///

np.cov(array_x,array_y,bias=True) 
(Out   [[6.72727273 3.54545455]
        [3.54545455 6.        ]])
 //共分散    結果は2×2の行列  対角成分はそれぞれx、yの分散。残りは共分散です。///
np.corrcoef(array_x,array_y)  
(Out   [[1.         0.55805471]
        [0.55805471 1.        ]]
///相関係数  やはり対角成分以外が相関係数です。///


二次元データの要約の詳しいことをこちらを参照。
https://note.com/karaage_love/n/n992a7fdf9b1f

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?