- Begin by dropping the id and date features from the dataset using the following commands. We will not be using them in our predictions as the ID variables are all unique and have no values in our analysis while the dates require a different function to handle them correctly. This is left as an exercise for the reader to do:
x_df = dataframe.drop(['id','date',], axis = 1) x_df
- Copy the dependent variable (house prices, in this case) into a new dataframe using the following commands:
y = dataframe[['price']].copy() y_df = pd.DataFrame(y) y_df
- The correlation between price and every other variable can be manually found using the following script:
print('Price Vs Bedrooms: %s' % x_df['price'].corr(x_df['bedrooms']))