Skip to content

ENH: Support more of the pandas str accessors #3940

Description

@toddrjen

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)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions