hosseinmoein / DataFrame

C++ DataFrame for statistical, Financial, and ML analysis -- in modern C++ using native types and contiguous memory storage
https://hosseinmoein.github.io/DataFrame/
BSD 3-Clause "New" or "Revised" License
2.41k stars 306 forks source link

Adding support for sort column by absolute value. #233

Closed sierret closed 1 year ago

sierret commented 1 year ago

The sort operation only currently allows for sorting by ascending and descending order. Please consider adding support for an absolute sort whereby the dataframe is sorted on a column by the absolute value of each column row/cell.

In addition, I tried implementing a home-baked solution but that only seemed to erase the whole dataframe. Is there any less efficient solution I could use in the meantime that makes use of the currently available library functions?

hosseinmoein commented 1 year ago

I will add that to my todo list. In the meanwhile you can add a column that has absolute values of your original column and sort with that

hosseinmoein commented 1 year ago

This is now implemented and released to master