againdoing that from first principleswe can take the correlation between two sets of attributescompute the standard deviation of eachthen compute the covariance between these two thingsand divide by the standard deviations of each dataset that gives us the correlation valuewhich is normalized to - to we end up with value of - which tells us there is some correlation between these two things in the negative directionit' not perfect linethat would be - but there' something interesting going on there - correlation coefficient means perfect negative correlation means no correlationand means perfect positive correlation computing correlation the numpy way nownumpy can actually compute correlation for you using the dpssdpfg let' look at the following codefunction oqdpssdpfg qbhftffetqvsdibtf"npvou this single line gives the following outputbssbz soif we wanted to do this the easy waywe could just use oqdpssdpfg qbhf qffetqvsdibtf"npvou and what that gives you back is an array that gives you the correlation between every possible combination of the sets of data that you pass in the way to read the output isthe implies there is perfect correlation between comparing qbhf qffet to itself and qvsdibtf"npvou to itselfwhich is expected but when you start comparing qbhf qffet to qvsdibtf"npvou or qvsdibtf"npvou to the qbhf qffetyou end up with the - valuewhich is roughly what we got when we did it the hard way there' going to be little precision errorsbut it' not really important