| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Functions
Synopsis
- count :: Columnable a => Expr a -> Expr Int
- match :: Text -> Expr Text -> Expr (Maybe Text)
- max :: (Columnable a, Ord a) => Expr a -> Expr a -> Expr a
- min :: (Columnable a, Ord a) => Expr a -> Expr a -> Expr a
- not :: Expr Bool -> Expr Bool
- isJust :: Columnable a => Expr (Maybe a) -> Expr Bool
- isNothing :: Columnable a => Expr (Maybe a) -> Expr Bool
- fromJust :: Columnable a => Expr (Maybe a) -> Expr a
- fromMaybe :: Columnable a => a -> Expr (Maybe a) -> Expr a
- sum :: (Columnable a, Num a) => Expr a -> Expr a
- maximum :: (Columnable a, Ord a) => Expr a -> Expr a
- minimum :: (Columnable a, Ord a) => Expr a -> Expr a
- and :: Expr Bool -> Expr Bool -> Expr Bool
- or :: Expr Bool -> Expr Bool -> Expr Bool
- div :: (Integral a, Columnable a) => Expr a -> Expr a -> Expr a
- mod :: (Integral a, Columnable a) => Expr a -> Expr a -> Expr a
- reduce :: (Columnable a, Columnable b) => Expr b -> a -> (a -> b -> a) -> Expr a
- lift :: (Columnable a, Columnable b) => (a -> b) -> Expr a -> Expr b
- cast :: (Columnable a, Read a) => Text -> Expr (Maybe a)
- eq :: (Columnable a, Eq a, a ~ BaseType a) => Expr a -> Expr a -> Expr Bool
- sanitize :: Text -> Text
- toMaybe :: Columnable a => Expr a -> Expr (Maybe a)
- nullLift2 :: (NullLift2Op a b r (NullLift2Result a b r), Columnable (NullLift2Result a b r)) => (BaseType a -> BaseType b -> r) -> Expr a -> Expr b -> Expr (NullLift2Result a b r)
- nullLift :: (NullLift1Op a r (NullLift1Result a r), Columnable (NullLift1Result a r)) => (BaseType a -> r) -> Expr a -> Expr (NullLift1Result a r)
- mode :: (Ord a, Columnable a, Eq a) => Expr a -> Expr a
- matchAll :: Text -> Expr Text -> Expr [Text]
- splitOn :: Text -> Expr Text -> Expr [Text]
- mean :: (Columnable a, Real a) => Expr a -> Expr Double
- meanMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> Expr Double
- median :: (Columnable a, Real a, Unbox a) => Expr a -> Expr Double
- medianMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> Expr Double
- percentile :: Int -> Expr Double -> Expr Double
- variance :: (Columnable a, Real a, Unbox a) => Expr a -> Expr Double
- lift2 :: (Columnable c, Columnable b, Columnable a) => (c -> b -> a) -> Expr c -> Expr b -> Expr a
- countAll :: Expr Int
- collect :: Columnable a => Expr a -> Expr [a]
- over :: Columnable a => [Text] -> Expr a -> Expr a
- castExpr :: (Columnable b, Columnable src, Read b) => Expr src -> Expr (Maybe b)
- castExprWithDefault :: (Columnable b, Columnable src, Read b) => b -> Expr src -> Expr b
- castExprEither :: (Columnable b, Columnable src, Read b) => Expr src -> Expr (Either Text b)
- unsafeCastExpr :: (Columnable b, Columnable src, Read b) => Expr src -> Expr b
- toDouble :: (Columnable a, Real a) => Expr a -> Expr Double
- sumMaybe :: (Columnable a, Num a) => Expr (Maybe a) -> Expr a
- stddev :: (Columnable a, Real a, Unbox a) => Expr a -> Expr Double
- stddevMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> Expr Double
- zScore :: Expr Double -> Expr Double
- pow :: (Columnable a, Num a) => Expr a -> Int -> Expr a
- relu :: (Columnable a, Num a, Ord a) => Expr a -> Expr a
- whenPresent :: (Columnable a, Columnable b) => (a -> b) -> Expr (Maybe a) -> Expr (Maybe b)
- whenBothPresent :: (Columnable a, Columnable b, Columnable c) => (a -> b -> c) -> Expr (Maybe a) -> Expr (Maybe b) -> Expr (Maybe c)
- recode :: (Columnable a, Columnable b, Show (a, b)) => [(a, b)] -> Expr a -> Expr (Maybe b)
- recodeWithCondition :: (Columnable a, Columnable b) => Expr b -> [(Expr a -> Expr Bool, b)] -> Expr a -> Expr b
- recodeWithDefault :: (Columnable a, Columnable b, Show (a, b)) => b -> [(a, b)] -> Expr a -> Expr b
- firstOrNothing :: Columnable a => Expr [a] -> Expr (Maybe a)
- lastOrNothing :: Columnable a => Expr [a] -> Expr (Maybe a)
- parseDate :: (ParseTime t, Columnable t) => Text -> Expr Text -> Expr (Maybe t)
- daysBetween :: Expr Day -> Expr Day -> Expr Int
- bind :: forall a b m. (Columnable a, Columnable (m a), Monad m, Columnable b, Columnable (m b)) => (a -> m b) -> Expr (m a) -> Expr (m b)
- castWithDefault :: (Columnable a, Read a) => a -> Text -> Expr a
- castEither :: (Columnable a, Read a) => Text -> Expr (Either Text a)
- unsafeCast :: (Columnable a, Read a) => Text -> Expr a
- lt :: (Columnable a, Ord a, a ~ BaseType a) => Expr a -> Expr a -> Expr Bool
- gt :: (Columnable a, Ord a, a ~ BaseType a) => Expr a -> Expr a -> Expr Bool
- leq :: (Columnable a, Ord a, Eq a, a ~ BaseType a) => Expr a -> Expr a -> Expr Bool
- geq :: (Columnable a, Ord a, Eq a, a ~ BaseType a) => Expr a -> Expr a -> Expr Bool
- topK :: (Columnable a, Ord a) => Int -> Expr a -> Expr [a]
- kExtremes :: (Columnable a, Ord a) => Text -> (a -> a -> Bool) -> Int -> Expr a -> Expr [a]
- bottomK :: (Columnable a, Ord a) => Int -> Expr a -> Expr [a]
- optionalToDoubleVector :: Real a => Vector (Maybe a) -> Vector Double
- isNull :: Columnable a => Expr (Maybe a) -> Expr Bool
- isNotNull :: Columnable a => Expr (Maybe a) -> Expr Bool
- isReservedId :: Text -> Bool
- isVarId :: Text -> Bool
- isHaskellIdentifier :: Text -> Bool
- module DataFrame.Operators
- add :: (Num a, Columnable a) => Expr a -> Expr a -> Expr a
- sub :: (Num a, Columnable a) => Expr a -> Expr a -> Expr a
- mult :: (Num a, Columnable a) => Expr a -> Expr a -> Expr a
- divide :: (Fractional a, Columnable a) => Expr a -> Expr a -> Expr a
- prettyPrint :: Expr a -> String
Documentation
reduce :: (Columnable a, Columnable b) => Expr b -> a -> (a -> b -> a) -> Expr a Source #
lift :: (Columnable a, Columnable b) => (a -> b) -> Expr a -> Expr b Source #
nullLift2 :: (NullLift2Op a b r (NullLift2Result a b r), Columnable (NullLift2Result a b r)) => (BaseType a -> BaseType b -> r) -> Expr a -> Expr b -> Expr (NullLift2Result a b r) Source #
Lift a binary function over nullable or non-nullable column expressions.
Any Nothing operand short-circuits to Nothing in the result.
The return type is inferred via NullLift2Result: no annotation needed.
nullLift :: (NullLift1Op a r (NullLift1Result a r), Columnable (NullLift1Result a r)) => (BaseType a -> r) -> Expr a -> Expr (NullLift1Result a r) Source #
Lift a unary function over a nullable or non-nullable column expression.
When the input is Maybe a, Nothing short-circuits (like fmap).
When the input is plain a, the function is applied directly.
The return type is inferred via NullLift1Result: no annotation needed.
medianMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> Expr Double Source #
lift2 :: (Columnable c, Columnable b, Columnable a) => (c -> b -> a) -> Expr c -> Expr b -> Expr a Source #
over :: Columnable a => [Text] -> Expr a -> Expr a Source #
Window function: evaluate an expression partitioned by the given columns.
Each partition computes the inner expression independently, and the result
is broadcast back to every row in that partition. This is analogous to
Polars' .over() or SQL OVER (PARTITION BY ...).
-- Per-country median, broadcast to every row: F.over ["country"] (F.median (F.col @Double "amount")) -- Deviation from group mean: F.col @Double "amount" - F.over ["group"] (F.mean (F.col @Double "amount"))
castExpr :: (Columnable b, Columnable src, Read b) => Expr src -> Expr (Maybe b) Source #
castExprWithDefault :: (Columnable b, Columnable src, Read b) => b -> Expr src -> Expr b Source #
castExprEither :: (Columnable b, Columnable src, Read b) => Expr src -> Expr (Either Text b) Source #
unsafeCastExpr :: (Columnable b, Columnable src, Read b) => Expr src -> Expr b Source #
stddevMaybe :: (Columnable a, Real a) => Expr (Maybe a) -> Expr Double Source #
whenPresent :: (Columnable a, Columnable b) => (a -> b) -> Expr (Maybe a) -> Expr (Maybe b) Source #
whenBothPresent :: (Columnable a, Columnable b, Columnable c) => (a -> b -> c) -> Expr (Maybe a) -> Expr (Maybe b) -> Expr (Maybe c) Source #
recode :: (Columnable a, Columnable b, Show (a, b)) => [(a, b)] -> Expr a -> Expr (Maybe b) Source #
recodeWithCondition :: (Columnable a, Columnable b) => Expr b -> [(Expr a -> Expr Bool, b)] -> Expr a -> Expr b Source #
recodeWithDefault :: (Columnable a, Columnable b, Show (a, b)) => b -> [(a, b)] -> Expr a -> Expr b Source #
firstOrNothing :: Columnable a => Expr [a] -> Expr (Maybe a) Source #
lastOrNothing :: Columnable a => Expr [a] -> Expr (Maybe a) Source #
bind :: forall a b m. (Columnable a, Columnable (m a), Monad m, Columnable b, Columnable (m b)) => (a -> m b) -> Expr (m a) -> Expr (m b) Source #
castWithDefault :: (Columnable a, Read a) => a -> Text -> Expr a Source #
Lenient coercion that substitutes a default for unconvertible values.
Looks up column name, coerces its values to a, and uses def wherever
conversion fails or the source value is Nothing.
castEither :: (Columnable a, Read a) => Text -> Expr (Either Text a) Source #
unsafeCast :: (Columnable a, Read a) => Text -> Expr a Source #
Lenient coercion for assertedly non-nullable columns.
Substitutes error for Nothing, so it will crash at evaluation time if
any Nothing is actually encountered. For non-nullable and
fully-populated nullable columns no cost is paid.
kExtremes :: (Columnable a, Ord a) => Text -> (a -> a -> Bool) -> Int -> Expr a -> Expr [a] Source #
Top k values after applying an ordering function. Floating-point NaNs are dropped: they have no place in a total order, and admitting them would make the merge non-associative (results would depend on chunk boundaries in the lazy executor).
bottomK :: (Columnable a, Ord a) => Int -> Expr a -> Expr [a] Source #
The k smallest values per group.
isReservedId :: Text -> Bool Source #
isHaskellIdentifier :: Text -> Bool Source #
module DataFrame.Operators
divide :: (Fractional a, Columnable a) => Expr a -> Expr a -> Expr a #
prettyPrint :: Expr a -> String #
Render an expression as readable, width-aware pseudo-code at the default
width (defaultWidth). See prettyPrintWidth to control wrapping.