You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The Series.map() function should enable the usage of index in the passed lambda, just like the normal Array.map() function does. My example use case is calculating a moving average, which requires referencing values next to the current position in the Series.
Describe the solution you'd like
I would like to be able to write this (which I initially tried to, and had to track down the reason it wasn't working, until I realized the internal map() just doesn't use or provide an index)
df[column].map((val, i) => {
if (i < 5) return 'N/A'
return df[column].iloc([`${i - 5}:${i}`]).mean()
})
Describe alternatives you've considered
The alternative option is to just get the actual Array object and use the Array.map() instead.
df[column].values.map((val, i) => {
if (i < 5) return 'N/A'
return df[column].iloc([`${i - 5}:${i}`]).mean()
})
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The Series.map() function should enable the usage of index in the passed lambda, just like the normal Array.map() function does. My example use case is calculating a moving average, which requires referencing values next to the current position in the Series.
Describe the solution you'd like
I would like to be able to write this (which I initially tried to, and had to track down the reason it wasn't working, until I realized the internal map() just doesn't use or provide an index)
Describe alternatives you've considered
The alternative option is to just get the actual Array object and use the Array.map() instead.
The text was updated successfully, but these errors were encountered: