Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Default
Views: 58
Kernel: Python 3 (Anaconda)
import numpy as np import scipy as sp import pandas as pd import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline
data = pd.read_csv('longley.csv', header=0, index_col=0) data.info()
<class 'pandas.core.frame.DataFrame'> Int64Index: 16 entries, 1947 to 1962 Data columns (total 7 columns): GNP.deflator 16 non-null float64 GNP 16 non-null float64 Unemployed 16 non-null float64 Armed.Forces 16 non-null float64 Population 16 non-null float64 Year 16 non-null int64 Employed 16 non-null float64 dtypes: float64(6), int64(1) memory usage: 1.0 KB
data.head(5)
GNP.deflator GNP Unemployed Armed.Forces Population Year Employed
1947 83.0 234.289 235.6 159.0 107.608 1947 60.323
1948 88.5 259.426 232.5 145.6 108.632 1948 61.122
1949 88.2 258.054 368.2 161.6 109.773 1949 60.171
1950 89.5 284.599 335.1 165.0 110.929 1950 61.187
1951 96.2 328.975 209.9 309.9 112.075 1951 63.221
data['Employed'].corr(data['Population'], method='pearson')
0.96039057159437557