mfo sfuvsoepu ef@nfbo ef@nfbo covarianceagainis defined as the dot productwhich is measure of the angle between two vectorsof vector of the deviations from the mean for given set of data and the deviations from the mean for another given set of data for the same data' data points we then divide that by in this casebecause we're actually dealing with sample so ef@nfbo our deviation from the mean function is taking in set of datayactually listand it' computing the mean of that set of data the sfuvso line contains little bit of python trickery for you the syntax is sayingi' going to create new listand go through every element in ycall it yjand then return the difference between yj and the meanynfbofor that entire dataset this function returns new list of data that represents the deviations from the mean for each data point my dpwbsjbodf function will do that for both sets of data coming individed by the number of data points minus remember that thing about sample versus population in the previous wellthat' coming into play here then we can just use those functions and see what happens to expand this examplei' going to fabricate some data that is going to try to find relationship between page speedsthatis how quickly page renders on websiteand how much people spend for exampleat amazon we were very concerned about the relationship between how quickly pages render and how much money people spend after that experience we wanted to know if there is an actual relationship between how fast the website is and how much money people actually spend on the website this is one way you might go about figuring that out let' just generate some normally distributed random data for both page speeds and purchase amountsand since it' randomthere' not going to be real correlation between them qbhf qffet oqsboepnopsnbm qvsdibtf"npvou oqsboepnopsnbm tdbuufs qbhf qffetqvsdibtf"npvou dpwbsjbodf qbhf qffetqvsdibtf"npvou