[scikit-learn] return type of StandardScaler

Bharat Didwania . bharat.didwania.eee14 at itbhu.ac.in
Wed Dec 7 11:48:47 EST 2016


 you can use pandas.get_dummies()
<http://pandas.pydata.org/pandas-docs/stable/generated/pandas.get_dummies.html>.
It will perform one hot encoding on categorical columns, and produce a
dataframe as the result. From there you can use pandas.concat([existing_df,
new_df],axis=0) to add the new columns to your existing dataframe. This
will avoid the use of a numpy array.


On Wed, Dec 7, 2016 at 8:44 AM, Nilay Shrivastava <nilay.euler16 at gmail.com>
wrote:

> StandardScaler returns numpy array even if the object passed is a pandas
> dataframe, shouldn't it return a dataframe?
>
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20161207/d6afb4d5/attachment-0001.html>


More information about the scikit-learn mailing list