Skip to content

Instantly share code, notes, and snippets.

@aita
Created June 30, 2013 13:08
Show Gist options
  • Select an option

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

Select an option

Save aita/5895085 to your computer and use it in GitHub Desktop.
相関係数の算出
import csv
import math
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
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)
]
corr = np.corrcoef(zip(*DATA))
print corr[0,1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment