| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Operations.Permutation
Synopsis
- data SortOrder where
- Asc :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder
- Desc :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder
- sortOrderColumns :: SortOrder -> [Text]
- mustFlipCompare :: SortOrder -> Bool
- prepareSortColumns :: [SortOrder] -> DataFrame -> ([SortOrder], DataFrame)
- materializeSortOrder :: Int -> SortOrder -> DataFrame -> (SortOrder, DataFrame)
- syntheticName :: Int -> Text
- sortBy :: [SortOrder] -> DataFrame -> DataFrame
- sortOrderComparator :: SortOrder -> DataFrame -> Int -> Int -> Ordering
- sortIndices :: (Int -> Int -> Ordering) -> Int -> Vector Int
- shuffle :: RandomGen g => g -> DataFrame -> DataFrame
- shuffledIndices :: (HasCallStack, RandomGen g) => g -> Int -> Vector Int
Documentation
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 |
sortOrderColumns :: SortOrder -> [Text] Source #
mustFlipCompare :: SortOrder -> Bool Source #
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.
syntheticName :: Int -> Text Source #
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.
shuffledIndices :: (HasCallStack, RandomGen g) => g -> Int -> Vector Int Source #