-
Hi, given the following table: Item Price Quantity I want to obtain the mean Price for intervals of Quantity. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The first thing that comes to mind is to create a new column for the quantity intervals and then use mapInto() which takes as arguments a function and and the new column. It's something like quantity.mapInto(myFunctionThatTakesAnIntAndReturnsAString, myOutputColumn) Then you can just use the usual summarize().by() to do the calculations. |
Beta Was this translation helpful? Give feedback.
The first thing that comes to mind is to create a new column for the quantity intervals and then use mapInto() which takes as arguments a function and and the new column. It's something like
quantity.mapInto(myFunctionThatTakesAnIntAndReturnsAString, myOutputColumn)
Then you can just use the usual summarize().by() to do the calculations.