-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
DataFrame.diff/pct_change #383
Comments
@risenW if this isn't a near term priority could you point me in the direction of how to hack together a difference operation? Which functions should I chain? Thanks! |
The might help https://ourcodeworld.com/articles/read/557/how-to-calculate-a-percentage-change-increase-and-decrease-from-2-values-in-javascript |
@risenW I mean how do I pass n, n-1 into the same function across the frame? I couldn't find anything that accesses the previous row |
You need to write a custom function and then apply it to the DataFrame. |
@risenW I'm not sure how to access the previous row. When I apply, I only get the current row but I would like a difference of the row above. df.apply only passes the same row.
|
If nobody else is actively working on implementing those two functions, I can try my hand at making the equivalent function in danfo? :) I may need a guiding hand writing tests however, though I'll do my best! |
PR is definitely welcome! You can read the contributor guide here first: https://danfo.jsdata.org/contributing-guide If you need any help, just ping me in the PR |
I started digging into pandas, and essentially followed a rabbit hole further down into numpy. So this will likely take me a while, as there is a lot going on in the diff function! It would appear that the best method of implementing the Following that logic I can leverage the TensorflowJS method |
@NeonSpork thanks for the work. @risenW, any idea when is the next version bump featuring this? |
There's no difference function?
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.diff.html
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.pct_change.html
The text was updated successfully, but these errors were encountered: