Skip to content

Add some cumulative Column operations#193

Merged
MarcoGorelli merged 3 commits into
data-apis:mainfrom
MarcoGorelli:cumulative-functions
Jul 5, 2023
Merged

Add some cumulative Column operations#193
MarcoGorelli merged 3 commits into
data-apis:mainfrom
MarcoGorelli:cumulative-functions

Conversation

@MarcoGorelli

Copy link
Copy Markdown
Contributor

I noticed plotly uses some cumulative functions (Series.cumsum) - OK to start adding some simple and common cumulative operations to Column?

@jorisvandenbossche

Copy link
Copy Markdown
Member

If we add them, we might want to use the full name (cumulative_...), xref data-apis/array-api#597 (comment)

@kgryte

kgryte commented Jul 4, 2023

Copy link
Copy Markdown
Contributor

These APIs are likely to be added to the 2023 revision of the array API standard. May be preferable to either wait until the naming convention is sorted there, or help participate in that discussion. Apart from cumulative_sum, another alternative is cusum.

@MarcoGorelli

Copy link
Copy Markdown
Contributor Author

have updated, thanks

let's go with cumulative_, and we can always update later again if necessary?

@rgommers

rgommers commented Jul 5, 2023

Copy link
Copy Markdown
Member

let's go with cumulative_, and we can always update later again if necessary?

That sounds fine to me - keeps the ball rolling.

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine to me, thanks Marco. Assuming folks want the min/max too; they seem commonly implemented in dataframe libraries at least.

And checking: typing is going to need Column[Any] perhaps, given the other typing PR?

@MarcoGorelli

Copy link
Copy Markdown
Contributor Author

for sum and prod, yes

for cumulative_min and cumulative_max, I think we could be more precise: Column[DType] (it should be preserved for these two operations, right?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants