Apply multivariable linear regression to a dataset in pandas with sklearn I'm trying to predict the population for states and the country in 2050. My current dataset has values for each state from 1951,1961...2011 in the same table. Here is a sample view: 

Row States/Union Territories         1951   1961    1971    1981    1991    2001    2011
0   Andaman and Nicobar Islands   31    64       115     189     281     356    381
1   Andhra Pradesh               31115  35983   43503   53551   66508   76210   84581   
2   Arunachal Pradesh             307   337     468     632     865     1098    1384    
.
.
.


So i ran a simple regression for values in 2011 and the model works very well. My question here is, how do i run it for an entirely new column(2050), which has no data to compare with in order to test for accuracy or any other metrics? One thing i intuitively tried was to add a new column  as 2050 and put all the values as 0, but then even the predicted values were 0 so that's of no help. I'm new to this so thanks for any help! 

Associated code: 

data = pd.read_csv("final_doc.csv", encoding = "latin-1")
data.head()
data['2050'] = 0
X = data[['1951', '1961', '1971', '1981', '1991', '2001']].values
Y = data[['2011']].values
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.2)
regressor = LinearRegression()
regressor.fit(X_train, Y_train)
y_pred = regressor.predict(X_test)
fin = pd.DataFrame(y_pred, columns = ['2011'])
fin
The form of your model is incorrectly specified. You want to model your data so that your independent variables are year (a numeric variable) and state/union (a categorical variable). Your dependent variable will be the population size. 

In order to develop such a model you will need to restructure your data so that it is in a long format (see below)

States/Union Territories      Year                Pop 
----------------------------------------------------- 
Andaman and Nicobar Islands   1951                 31
Andaman and Nicobar Islands   1961                 64
           ...                 ...                ...
Andhra Pradesh                1951              31115   
Andhra Pradesh                1961              35983
           ...                 ...                ...   
Arunachal Pradesh             1951                307
           ...                 ...                ...


Once the data is transformed into a proper format, you can then fit your model.
I should mention you will need to recode your categorical variable - you can use a method called one hot-encoding to achieve this. 

Once your model has been fit, you will be able to predict the expected population size for a given year and Union/State.

The following post Multiple Linear Regression Model in 7 Steps with Python provides a great guide to developing a model.

Hope this helps!