Meanig of cetain

1.housing_dr=pd.DataFrame(x,columns=housing_num.columns)
Q.what is the meaning of columns=housing_num.columns

2.housing_cat_encoded,housing_categories=housing_cat.factorize()
housing_cat_encoded[:10]
Q. why we are writing housing_categories not only housing_cat_encoded

Hi Soumyadeep,

  1. Earlier in the project we trained imputer to transform the training set by replacing
    missing values by the learned medians, we got a plain NumPy Array containing the transformed features. So we are putting it back to the Pandas DataFrame with the code
    housing_tr = pd.DataFrame(X, columns=housing_num.columns)

  2. Here at first we are using Pandas to factorize data, i.e. convert it into numeric so that it can be one-hot encoded and later housing_categories is used to check the encoding classes.

Regards