# -*- coding: utf-8 -*-
"""
Created on Tue Nov 16 09:57:22 2021

@author: Sim
"""

import numpy as np
import pandas as pd

height = np.array([167, 162, 158, 165, 160, 162, 162, 167, 156, 157])
weight = np.array([68, 49, 50, 56, 52, 52, 50, 61, 44, 55])

corr1 = np.corrcoef(height, weight)
print(corr1)

ht2 = [65.75, 63.78, 62.20, 64.96, 62.99, 63.78, 63.78, 
       65.75, 61.42, 61.81]
wt2 = [149.9, 108.0, 110.2, 123.5, 114.6, 114.6, 110.2, 
       134.5,  97.0, 121.3]
corr2 = np.corrcoef(ht2, wt2)
print(corr2)

df = pd.DataFrame(np.column_stack((height, weight, ht2, wt2)))

corr3 = np.corrcoef(df, rowvar=False)
print(np.around(corr3, 4))

xx = [-2, -1, 0, 1, 2, -2, -1, 0, 1, 2]
yy = [0, 1.73, 2, 1.73, 0, 0, -1.73, -2, -1.73, 0]

print( np.corrcoef(xx, yy) )




