Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas
- X = pandas.read_excel(open('excel.xlsx', 'rb'))
- Y = np.corrcoef (X)
- for i in Y :
- if i >= 0.50:
- print ("POSITIVE CORRELATION")
- elif CC0 <= -0.50:
- print ("NEGATIVE CORRELATION")
- else :
- print ("NO CORRELATION")
- X1 X2 X3 X4 X5
- [[ 1. 0.76072577 0.86385074 -0.75301812 0.66995002]
- [ 0.76072577 1. 0.74206343 -0.47660312 0.64827257]
- [ 0.86385074 0.74206343 1. -0.93521563 0.93280718]
- [-0.75301812 -0.47660312 -0.93521563 1. -0.92556091]
- [ 0.66995002 0.64827257 0.93280718 -0.92556091 1. ]]
- POSITIVE CORRELATION BETWEEN A AND B
- POSITIVE CORRELATION BETWEEN A AND C... etc.
Add Comment
Please, Sign In to add comment