Discovered in #2102 (comment)
val df = dataFrameOf(
columnOf("Alice", "Bob", "Charlie", "Charlie") named "name",
columnOf(null, null, null, null) named "group",
)
df.meanFor { group default 0 }.toDataFrame()
The result is NaN even though a default is set.
It turns out that this default is never used for DataFrame.xFor {} calls, as a statistic function can never return null, which is where the default would be used. Probably this default is only used for Pivot(GroupBy) calls.
We should either:
- remove this
default call
- Make it work on
NaN too (might require some changes in aggregators)
- Make it apply the default before running the statistic
The KDocs will also need to be updated accordingly
Discovered in #2102 (comment)
The result is
NaNeven though a default is set.It turns out that this default is never used for
DataFrame.xFor {}calls, as a statistic function can never return null, which is where the default would be used. Probably this default is only used forPivot(GroupBy)calls.We should either:
defaultcallNaNtoo (might require some changes in aggregators)The KDocs will also need to be updated accordingly