dataframe-operations-1.1.0.3: Column operations, expression DSL, and statistics for the dataframe ecosystem.
Safe HaskellNone
LanguageHaskell2010

DataFrame.Operations.Permutation

Synopsis

Documentation

data SortOrder where Source #

Sort order taken as a parameter by the sortBy function.

Constructors

Asc :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder 
Desc :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder 

Instances

Instances details
Eq SortOrder Source # 
Instance details

Defined in DataFrame.Operations.Permutation

prepareSortColumns :: [SortOrder] -> DataFrame -> ([SortOrder], DataFrame) Source #

Materialize any compound sort expressions into synthetic columns on a working dataframe, returning rewritten SortOrders that reference those columns by name.

sortBy :: [SortOrder] -> DataFrame -> DataFrame Source #

O(k log n) Sorts the dataframe by a given row.

sortBy Ascending ["Age"] df

sortOrderComparator :: SortOrder -> DataFrame -> Int -> Int -> Ordering Source #

Build a row-index comparator from a SortOrder and a DataFrame. The Ord dictionary is recovered from the SortOrder GADT.

sortIndices :: (Int -> Int -> Ordering) -> Int -> Vector Int Source #

Sort row indices using a comparator function.