You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'll infer that things with object dtype need to be encoded as 0's and 1's, but also take arguments to explicitly encode a column, or not.
The column names in the output will automatically include the original column name as a prefix, which can be overridden by the prefix kwarg by passing a list or dictionary.
Same thing with prefix separators.
On NaN handling, I think we'll have one {prefix}_NaN output column per original column when dummy_na is True.
I've got some tests written already.
The text was updated successfully, but these errors were encountered:
Ha, something like this already exists! convert_dummies in pandas/core/reshape, but it isn't exported under the pd. namespace, and I didn't find it in the documentaiton.
I'll think about whether to adjust that function at all, or just document it as is. I think the defaults can be improved a bit (which would be API changing) but I wonder if this function is ever used..,
also not a single mention of convert_dummies on SO. I also would just integrate it in get_dummies with the API we want, instead of adding (or better publicizing) another function.
get_dummies
currently just expects a Series.If it took DataFrames we could change the required call from
to
We'll infer that things with
object
dtype need to be encoded as 0's and 1's, but also take arguments to explicitly encode a column, or not.The column names in the output will automatically include the original column name as a prefix, which can be overridden by the
prefix
kwarg by passing a list or dictionary.Same thing with prefix separators.
On NaN handling, I think we'll have one
{prefix}_NaN
output column per original column whendummy_na
is True.I've got some tests written already.
The text was updated successfully, but these errors were encountered: