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
If you have a DataFrame consisting of a mix of Number types, calling median on it will break.
Example:
val df = dataFrameOf("a")(
1,
2L,
2.0f,
3.0,
)
df.median("a")
Will throw:
java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap') at java.base/java.lang.Integer.compareTo(Integer.java:59) at org.jetbrains.kotlinx.dataframe.math.MedianKt.quickSelect(median.kt:43)
The text was updated successfully, but these errors were encountered:
Yup, as mentioned here #558 only Comparable is supported, Number is not supported (yet) but can still be called. This should be fixed indeed. I would say Number should be attempted to be converted toDouble() if it's not a known type.
If you have a
DataFrame
consisting of a mix ofNumber
types, callingmedian
on it will break.Example:
Will throw:
java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap') at java.base/java.lang.Integer.compareTo(Integer.java:59) at org.jetbrains.kotlinx.dataframe.math.MedianKt.quickSelect(median.kt:43)
The text was updated successfully, but these errors were encountered: