Skip to content
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

ENH: Support more of the pandas str accessors #3940

Closed
10 of 12 tasks
toddrjen opened this issue Apr 6, 2020 · 1 comment · Fixed by #4622
Closed
10 of 12 tasks

ENH: Support more of the pandas str accessors #3940

toddrjen opened this issue Apr 6, 2020 · 1 comment · Fixed by #4622

Comments

@toddrjen
Copy link
Contributor

toddrjen commented Apr 6, 2020

Currently pandas supports a lot of str accessors that xarray doesn't. Many of them have useful functionality. I think it would be good if the xarray had more of these str accessors. I would be willing to begin working on this.

There seem to be three categories. One that has a one-to-one mapping between input and output (so one input element becomes one output element), and one that has a one-to-many mapping (one input element becomes multiple output elements), and one that has a many-to-one mapping (multiple input elements become one output element). Exactly how the one-to-many mapping should be handling, if at all, is an open issue. Some of the many-to-one mappings (specifically join) would need a dimension argument.

One-to-one

  • casefold(self)
  • normalize(self, form)

One-to-many

  • extract(self, pat[, flags, expand])
  • extractall(self, pat[, flags])
  • findall(self, pat[, flags])
  • get_dummies(self[, sep])
  • partition(self[, sep, expand])
  • rpartition(self[, sep, expand])
  • rsplit(self[, pat, n, expand])
  • split(self[, pat, n, expand])

Many-to-one

  • cat(self[, others, sep, na_rep, join])
  • join(self, sep)
@dcherian
Copy link
Contributor

dcherian commented Apr 6, 2020

This sounds great. Looking forward to those PRa!

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

Successfully merging a pull request may close this issue.

3 participants