Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Created on Oct 9, 2018
- @author: studlab240
- '''
- import numpy as np
- import pandas as pd
- import matplotlib.pyplot as plt
- from matplotlib import pylab
- from pylab import *
- '''A = np.arange(10)
- print (A)
- B = np.reshape(np.arange(9),(3,3))
- print (B)
- C = np.reshape(np.arange(2*3*4),(2,3,4))
- print (C)
- a = np.array(23)
- print (a)'''
- '''data = np.loadtxt("abcnot.txt", delimiter=",")
- print(data)'''
- df = pd.read_csv('pag6.txt',sep=',')
- arr = np.array(df)
- print(arr)
- def test(arr,a1,a2):
- for i in range(arr.shape[0]):
- plt.plot(arr[i][0],arr[i][1],'o')
- a1.append(arr[i][0])
- a2.append(arr[i][1])
- print(a1)
- print(a2)
- '''plt.plot(arr[:40][:2],arr[:10][:2],'o')'''
- a1 = []
- a2 = []
- test(arr,a1,a2)
- print(corrcoef([a1,a2]))
- b=estimate_coef(a1,a2)
- plot_regression_line(x,y,b)
- pylab.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement