dataframe-0.3.3.2: A fast, safe, and intuitive DataFrame library.
Safe HaskellNone
LanguageHaskell2010

DataFrame.Operations.Transformations

Synopsis

Documentation

apply Source #

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.

safeApply Source #

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.

applyInt Source #

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.

applyDouble Source #

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.

applyWhere Source #

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

applyAtIndex Source #

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.

impute :: Columnable b => Text -> b -> DataFrame -> DataFrame Source #

Replace all instances of Nothing in a column with the given value.