Safe Haskell | None |
---|---|
Language | Haskell2010 |
DataFrame.Operations.Transformations
Synopsis
- apply :: (Columnable b, Columnable c) => (b -> c) -> Text -> DataFrame -> DataFrame
- safeApply :: (Columnable b, Columnable c) => (b -> c) -> Text -> DataFrame -> Either DataFrameException DataFrame
- derive :: Columnable a => Text -> Expr a -> DataFrame -> DataFrame
- applyMany :: (Columnable b, Columnable c) => (b -> c) -> [Text] -> DataFrame -> DataFrame
- applyInt :: Columnable b => (Int -> b) -> Text -> DataFrame -> DataFrame
- applyDouble :: Columnable b => (Double -> b) -> Text -> DataFrame -> DataFrame
- applyWhere :: (Columnable a, Columnable b) => (a -> Bool) -> Text -> (b -> b) -> Text -> DataFrame -> DataFrame
- applyAtIndex :: Columnable a => Int -> (a -> a) -> Text -> DataFrame -> DataFrame
- impute :: Columnable b => Text -> b -> DataFrame -> DataFrame
Documentation
Arguments
:: (Columnable b, Columnable c) | |
=> (b -> c) | function to apply |
-> Text | Column name |
-> DataFrame | DataFrame to apply operation to |
-> DataFrame |
O(k) Apply a function to a given column in a dataframe.
Arguments
:: (Columnable b, Columnable c) | |
=> (b -> c) | function to apply |
-> Text | Column name |
-> DataFrame | DataFrame to apply operation to |
-> Either DataFrameException DataFrame |
O(k) Safe version of the apply function. Returns (instead of throwing) the error.
derive :: Columnable a => Text -> Expr a -> DataFrame -> DataFrame Source #
O(k) Apply a function to a combination of columns in a dataframe and
add the result into alias
column.
applyMany :: (Columnable b, Columnable c) => (b -> c) -> [Text] -> DataFrame -> DataFrame Source #
O(k * n) Apply a function to given column names in a dataframe.
Arguments
:: Columnable b | |
=> (Int -> b) | function to apply |
-> Text | Column name |
-> DataFrame | DataFrame to apply operation to |
-> DataFrame |
O(k) Convenience function that applies to an int column.
Arguments
:: Columnable b | |
=> (Double -> b) | function to apply |
-> Text | Column name |
-> DataFrame | DataFrame to apply operation to |
-> DataFrame |
O(k) Convenience function that applies to an double column.
Arguments
:: (Columnable a, Columnable b) | |
=> (a -> Bool) | Filter condition |
-> Text | Criterion Column |
-> (b -> b) | function to apply |
-> Text | Column name |
-> DataFrame | DataFrame to apply operation to |
-> DataFrame |
O(k * n) Apply a function to a column only if there is another column value that matches the given criterion.
applyWhere (<20) "Age" (const "Gen-Z") "Generation" df
Arguments
:: Columnable a | |
=> Int | Index |
-> (a -> a) | function to apply |
-> Text | Column name |
-> DataFrame | DataFrame to apply operation to |
-> DataFrame |
O(k) Apply a function to the column at a given index.