-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Index should have diff() method #19708
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
Comments
Also |
diff
methoddiff
method
diff
method
In addition to numeric indices, this would also be useful for datetimelike indices (and avoid a |
Hi @jorisvandenbossche ; can you explain briefly what this issue is about? |
I'm thinking of contributing to this. It would be my first contribution to Pandas :) Is the correct place to implement this, in Thanks in advance. |
Probably on Index.
Either that or to something like |
take |
I have a WIP version of this here: main...jppcr:issue-19708-indexdiff I ended up using the simpler code that @jbrockmendel proposed, May I ask for guidance in two things?
Below are the Index types I tested the function with:
Thanks |
Specifically, I meant checking if |
Me: Would it be OK if I just added a check for the type of self, and raised an TypeError if a certain Index type did not support the diff function? Specifically, I meant checking if self is of type Range/Int64/Uint64/Float64 or DateTimeIndex. If it isn't, I would raise an TypeError exception saying that using diff with that Index type isn't supported. Shouldn't be necessary, you should get an appropriate exception from the Series.diff method. Could special-case RangeIndex/MultiIndex to fast-path.
Yes. You can use the
|
take |
No description provided.
The text was updated successfully, but these errors were encountered: