-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: Index to act like Series for common ops (DataFrame.index.max() crashes) #4551
Comments
there was an issue somewhere about this but can't find it....so will mark this as the issue these common ops are not enabled directly on indices, but you can do:
|
seems like a good idea (and, frankly, you could almost make index inherit from ND Frame too, just blocking mutable ops. Just be careful not to introduce ops that would mutate series in place (obviously fine if it returns a copy) |
actually I think what we could do is have a mixin class for certain ops eg max,min prob most of them which apply to both series and index (they need slightly different handling internally) |
@jreback yeah, probably better to selectively enhance rather than selectively downgrade (and potentially mess up instance checks, etc) |
http://stackoverflow.com/questions/18558429/create-a-new-dataframe-column-from-an-existing-one maybe use a mixin super class here |
related #4056, #5202, #5502, #5519, #6027
I have a DataFrame of length 390,080, with int64 indices.
df.index.size
gives the correct answer of 390,080, butdf.index.max
results in a huge traceback that ends with:Using pandas 0.12.
The text was updated successfully, but these errors were encountered: