I am studying this snippet of python code. What does X = X[:, 1]
mean in last line?
def linreg(X,Y):
# Running the linear regression
X = sm.
it is simply like you are specifying the axis. Consider the starting column as 0 then as you go through 1,2 and so on.
The syntax is x[row_index,column_index]
you can also specify a range of row values as per need in row_index also eg:1:13 extracts first 13 rows along with whatever specified in column