Handson-ml: Ch2: returning a dataframe after the ColumnTransformer

Created on 31 Oct 2019  路  1Comment  路  Source: ageron/handson-ml

Dear Ageron,

Thank you for this book, it teaches me a lot! I have a problem after successfully running the ColumnTransformer in Chapter two. It returns an array, while I want to turn it to a data frame for better accessibility. Yet, it has 17 columns after the transformation, I aware that the extra columns should be the one-hot-encoding columns, but it does not appear in the .transformers_ attribute.. is there any way I can achieve my desire? Thank you.

Most helpful comment

Hi @fdq09eca ,
Yes, unfortunately, Scikit-Learn was created just before Pandas, so Pandas support is limited. You can pass them as inputs, but in general estimators will return NumPy arrays. However, there is some work going on to improve this, check out this issue.
Hope this helps.

>All comments

Hi @fdq09eca ,
Yes, unfortunately, Scikit-Learn was created just before Pandas, so Pandas support is limited. You can pass them as inputs, but in general estimators will return NumPy arrays. However, there is some work going on to improve this, check out this issue.
Hope this helps.

Was this page helpful?
0 / 5 - 0 ratings