Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. '''
  2. Created on Oct 9, 2018
  3.  
  4. @author: studlab240
  5. '''
  6. import numpy as np
  7. import pandas as pd
  8. import matplotlib.pyplot as plt
  9. from matplotlib import pylab
  10. from pylab import *
  11. '''A = np.arange(10)
  12. print (A)
  13. B = np.reshape(np.arange(9),(3,3))
  14. print (B)
  15. C = np.reshape(np.arange(2*3*4),(2,3,4))
  16. print (C)
  17. a = np.array(23)
  18. print (a)'''
  19. '''data = np.loadtxt("abcnot.txt", delimiter=",")
  20. print(data)'''
  21.  
  22. df = pd.read_csv('pag6.txt',sep=',')
  23. arr = np.array(df)
  24. print(arr)
  25.  
  26. def test(arr,a1,a2):
  27. for i in range(arr.shape[0]):
  28. plt.plot(arr[i][0],arr[i][1],'o')
  29. a1.append(arr[i][0])
  30. a2.append(arr[i][1])
  31. print(a1)
  32. print(a2)
  33.  
  34. '''plt.plot(arr[:40][:2],arr[:10][:2],'o')'''
  35. a1 = []
  36. a2 = []
  37. test(arr,a1,a2)
  38. print(corrcoef([a1,a2]))
  39. b=estimate_coef(a1,a2)
  40.  
  41. plot_regression_line(x,y,b)
  42. pylab.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement