danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

Sorting bug when NaN values exist

Open GauravBhagchandani opened this issue 1 year ago • 5 comments

Describe the bug Sorting seems to break when there's a NaN value in the series

Expected behavior Values should be sorted in ascending order

Screenshots image

GauravBhagchandani avatar Mar 20 '24 15:03 GauravBhagchandani

what part of the code needs to be fixed a clue please

Harmedino avatar Mar 24 '24 09:03 Harmedino

You can check here

https://github.com/javascriptdata/danfojs/blob/76386815061436f031fb778c9a1e4595077a3812/src/danfojs-base/core/series.ts#L834

And you can dropna and then sort

steveoni avatar Mar 24 '24 11:03 steveoni

I need the rows with NaN though, because the other columns have usable values. It would make sense if the NaN values were all together somehow, at the start or the end.

GauravB159 avatar Mar 24 '24 16:03 GauravB159

I am seeing the same issue with DataFrame sortValues function.

jacobnorris0703 avatar Jul 18 '24 18:07 jacobnorris0703

I don't think there's an active maintainer on this repository. It's a shame, it's the best one similar to Pandas that I've found.

GauravB159 avatar Jul 18 '24 20:07 GauravB159