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

DISC/DES: EA should have transpose, T, ravel mirroring ndarray/Index/Series #24583

Closed
jbrockmendel opened this issue Jan 3, 2019 · 4 comments
Labels
Enhancement ExtensionArray Extending pandas with custom dtypes or arrays. Needs Discussion Requires discussion from core team before further action

Comments

@jbrockmendel
Copy link
Member

As long as EA is 1D only these are all no-ops, so implementation is trivial. It would save a bunch of special-casing and checking for exactly what type of object we have at different stages.

The cost is API clutter.

I'm of the opinion that EA should be as close as possible to a drop-in replacement for ndarray, (both for our purposes and so it can be useful in the ecosystem), so we should implement these properties/methods.

Last I heard @TomAugspurger came down on the less-clutter side of this question. Anyone else have an opinion?

@jreback
Copy link
Contributor

jreback commented Jan 3, 2019

I am with @jbrockmendel here. There is no point in not having the methods / properties, only to have to special case / work-around (in a myriad of ways) in various parts of the codebase. This is a huge complexity internally.

A few extra properties / methods IMHO is so worth it here.

@TomAugspurger
Copy link
Contributor

I'd prefer to hold off on adding methods that are unnecessary for 1-D arrays. I don't want to burden users with them.

What do you mean by API clutter? Isn't avoiding clutter the benefit?

@jorisvandenbossche might have an opinion.

@jorisvandenbossche
Copy link
Member

I also prefer that we take the conservative route in this light: only add methods when we (or downstream) actually have a good use case for them.

This is a huge complexity internally.

Can you give some examples where this currently creates complexity? In the BlockManager?

@jreback
Copy link
Contributor

jreback commented Jan 3, 2019

  • Block._astype is a mess
  • Block.where is not able to be sublcassed
  • DatetimeBlock and DatetimeTZBlock cannot combine more code
  • ObjectBlock.convert

lots of reshaping issues that were recently added in #24024

This is just adding complexity for no reason. If we have an array class then it needs to be almost a drop in for numpy arrays. Not having basic reshaping is causes lots of headaches.

@mroeschke mroeschke added Needs Discussion Requires discussion from core team before further action ExtensionArray Extending pandas with custom dtypes or arrays. labels Jan 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ExtensionArray Extending pandas with custom dtypes or arrays. Needs Discussion Requires discussion from core team before further action
Projects
None yet
Development

No branches or pull requests

5 participants