danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

Add diff/pctChange to Series

Open joshuakoh1 opened this issue 2 years ago • 3 comments

diff and pctChange features added in https://github.com/javascriptdata/danfojs/pull/418 https://github.com/javascriptdata/danfojs/pull/414 only extend to DataFrames. Currently unable to apply to a single column slice without adding extra steps.

joshuakoh1 avatar Mar 24 '22 05:03 joshuakoh1

@NeonSpork Would you like to work on this?

risenW avatar Apr 02 '22 07:04 risenW

I think we need more information specifically about what you're trying to achieve that's failing, and how @joshuakoh1 ?

The diff/pctChange functions should mirror the behavior of the other math functions like pow etc, and it should accept a single number, series, column, etc, already.

Can you provide example code, errors and more detailed information about what behavior you expected please?

NeonSpork avatar Apr 02 '22 08:04 NeonSpork

@NeonSpork Just trying to calc the diff/pctChange for a single series instead of the full DataFrame. Would like to be able to do df.column.pctChange(1) instead of df.pctChange(1).column. The latter performs unnecessary operations.

joshuakoh1 avatar Apr 05 '22 07:04 joshuakoh1