Skip to content

DataFrame.describe() Sortable by Type #822

@jeffgnpc

Description

@jeffgnpc

When I run df.describe() I would like to group columns of like types together. When I try and click the sort button on the dataframe I get this error:
Column 'type' has type 'kotlin.Any' that is not Comparable java.lang.RuntimeException: Column 'type' has type 'kotlin.Any' that is not Comparable at org.jetbrains.kotlinx.dataframe.impl.columns.UtilsKt.assertIsComparable(Utils.kt:98) at org.jetbrains.kotlinx.dataframe.impl.api.SortKt.createComparator(sort.kt:60) at org.jetbrains.kotlinx.dataframe.impl.api.SortKt.sortByImpl(sort.kt:49) at

It would seem to me that sorting based on toString() when a Comparable is not available.

I was able to get around the problem with this code:

df.describe().sortWith { r1, r2 -> r1["type"].toString().compareTo(r2["type"].toString()) }[0]["type"]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions