Numpy provides a function numpy.loadtxt() which reads data from a file into an a
ID: 3889380 • Letter: N
Question
Numpy provides a function numpy.loadtxt() which reads data from a file into an array.
The file sample-correlation.txt has two sets of measurements that might be correlated. Make a script that loads data from the file, calculates the Pearson correlation coefficient( numpy.corrcoef()), and prints the correlation coefficient between the two variables.
#sample-correlation.txt
# Resistor 1
# V I(mA)
1.256 3.7
3.56 10.7
5.75 17.3
9.18 27.8
16.81 51.0
20.8 63.3
23.7 72.2
Thank you so much!