Skip to content

Instantly share code, notes, and snippets.

@aita
Created July 1, 2013 05:51
Show Gist options
  • Select an option

  • Save aita/5898640 to your computer and use it in GitHub Desktop.

Select an option

Save aita/5898640 to your computer and use it in GitHub Desktop.
標準化変量の計算
import scipy.stats
import numpy as np
import scipy as sp
DATA = [
(400, 60),
(15, 30),
(480, 365),
(993, 190),
(600, 136),
(150, 15),
(115, 37),
(50, 100),
(0, 170),
(130, 70),
(3000, 783),
(500, 560),
(200, 50),
(55, 35),
(2200, 595),
(1, 200),
(900, 300),
(1000, 356),
(450, 155),
(400, 250)
]
d1, d2 = zip(*DATA)
print [(x-np.mean(d1)) / np.std(d1) for x in d1]
print [(x-np.mean(d2)) / np.std(d2) for x in d2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment