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
When the features returned by a transformer (by _get_feature_names) are unicode strings containing non-ascii characters, get_names throws a UnicodeEncodeError. This is due to line 256 in data frame_mapper.py: return [name + '_' + str(o) for o in names]
This assumes any object in names can be converted to string using str.
It would be much better to use something like '%s_%s' % (name, o), which returns a unicode when needed. At the end, these strings become DataFrame column names, and DataFrames don't care about unicode indices.
The text was updated successfully, but these errors were encountered:
Hi,
When the features returned by a transformer (by
_get_feature_names
) are unicode strings containing non-ascii characters,get_names
throws aUnicodeEncodeError
. This is due to line 256 indata frame_mapper.py
:return [name + '_' + str(o) for o in names]
This assumes any object in
names
can be converted to string usingstr
.It would be much better to use something like
'%s_%s' % (name, o)
, which returns a unicode when needed. At the end, these strings become DataFrame column names, and DataFrames don't care about unicode indices.The text was updated successfully, but these errors were encountered: