I am studying this snippet of python code. What does X = X[:, 1] mean in last line?
X = X[:, 1]
def linreg(X,Y): # Running the linear regression X = sm.
The term you need to search for is slice. x[start:end:step] is the full form, Here we can omit to use a default value: start defaults to 0 , end defaults to the length of the list, and step defaults to 1. And hence x[:] means same as x[0:len(x):1]