Created
June 30, 2013 13:08
-
-
Save aita/5895085 to your computer and use it in GitHub Desktop.
相関係数の算出
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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