Stream: helpdesk (published)

Topic: Sort & Shuffle


view this post on Zulip Timothy (Mar 22 2022 at 10:27):

I'm looking to sort a dataframe by a column, and when the values are equal shuffle them. In small-scale tests using sortperm(column_values, lt = (a, b) -> a < b || (a == b && rand() < 0.5)) seemed to work, but with longer lists of values it seems you can get segfaults (ref: https://github.com/JuliaLang/julia/issues/44698).

Might someone have advice on how I can accomplish this without segfaulting?


Last updated: Oct 02 2023 at 04:34 UTC