0

What's wrong?

from numpy import mean(), stdev(), corrcoef() import matplotlib.pyplot as plt #get paths and store datasets to variables loc1 = str(input('Enter path location for first data:') loc2 = str(input('Enter path location for second data:') f = open(loc1, 'r+') dataset1 = list(f.read()) f.close() #store data1 to var f = open(loc2, 'r+') dataset2 = list(f.read()) f.close() #store data2 to var #working mean1 = mean(dataset1) mean2 = mean(dataset2) stdev1 = stdev(dataset1) stdev2 = stdev(dataset2) coeffsd1 = stdev1/mean1 coeffsd2 = stdev2/mean2 print("The means of provided data are:" + str(mean1) + " and " + str(mean2) + " respectively." print("The standard deviation of provided data are:" + str(stdev1) + " and " + str(stdev2) + " respectively." #corr using matplot library x = dataset1 y = dataset2 plt.plot(x, color = 'blue') plt.plot(y, color = 'green') plt.xlabel('dataset1 values') plt.ylabel('dataset2 values') plt.title('Graph of correlation) plt.legend() plt.show()

13th Mar 2019, 3:09 PM
Rizan
Rizan - avatar
2 ответов
+ 4
Your code is a bit long to just ask 'what's wrong?' It looks like you haven't really tried to debug it yourself. Please do that first! Outcomment the later parts and try to figure out the errors one by one. Learning to debug is essential if you want to improve. If you really get stuck, ask again, but only that specific thing!
13th Mar 2019, 3:28 PM
HonFu
HonFu - avatar
+ 1
Thanks! True that 😅
14th Mar 2019, 4:29 AM
Rizan
Rizan - avatar