Jump to content
We've recently updated our Privacy Statement, available here. ×

Is There a "Group By" or "Over" Option for Data Function Python Scripts?

Joel Dror 2

Recommended Posts

I want to code a data function using Python.

My end game is to compute a polynomial fit on series that I get in a certain column.

As a simple example, I tried coding a data function that computes the maximum of a certain column.

I coded this:

Y = Y.to_numpy(dtype=float, na_value=0)

MaxVal = pd.Series([max(Y)]*len(Y))

However, I want the series to be grouped by different columns' values.

So that I get the maximum of each sub-set, similar to what we can do with:

Max([Y]) Over ([ColumnA], [ColumnB])

I see there is an R function called group_by that probably does that, but I don't know R at all so I would like to do it with Python.

How do I do that?

Any help would be appreciated.



P.S where can I thoroughly learn an R language to use in Spotfire?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...