Skip to content

encode/decode method for string module (like in np.char.encode ) #1706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gerigk opened this issue Jul 30, 2012 · 0 comments
Closed

encode/decode method for string module (like in np.char.encode ) #1706

gerigk opened this issue Jul 30, 2012 · 0 comments
Milestone

Comments

@gerigk
Copy link

gerigk commented Jul 30, 2012

This is already in included in numpy but for convenience it would be nice to have this in pandas.

series.str.decode('utf-8')

is nicer than for example

series = Series(['a','b','ä'])
Series(np.char.decode(series.values.astype('|S255'), 'utf-8'))

I find myself having to decode and encode a lot depending on what other libraries accept/return.

@wesm wesm closed this as completed in d0e9034 Aug 12, 2012
wesm pushed a commit that referenced this issue Nov 17, 2012
When encoding/decoding strings with errors allow you
to pass error handling strings. This works the same as
error handling for other encode/decode functions.
Defaults to 'strict', but you can pass 'ignore', 'replace',
etc.

Extends work done in #1706.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants