| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.Internal.Row
Synopsis
- data Any where
- Value :: forall a. Columnable a => a -> Any
- Null :: Any
- showValue :: Columnable a => a -> Text
- toAny :: Columnable a => a -> Any
- fromAny :: Columnable a => Any -> Maybe a
- cellAny :: Columnable a => Maybe Bitmap -> Int -> a -> Any
- type Row = Vector Any
- (!?) :: [a] -> Int -> Maybe a
- mkColumnFromRow :: Int -> [[Any]] -> Column
- toRowList :: DataFrame -> [[(Text, Any)]]
- toRowVector :: [Text] -> DataFrame -> Vector Row
- rowValue :: Expr a -> [(Text, Any)] -> Maybe a
- mkRowFromArgs :: [Text] -> DataFrame -> Int -> Row
- mkRowRep :: DataFrame -> [Text] -> Int -> Row
Documentation
Constructors
| Value :: forall a. Columnable a => a -> Any | |
| Null :: Any |
showValue :: Columnable a => a -> Text Source #
toAny :: Columnable a => a -> Any Source #
Wraps a value into an Any type. This helps up represent rows as heterogenous lists.
toRowList :: DataFrame -> [[(Text, Any)]] Source #
Convert the whole dataframe to a list of rows, one per row index in natural
order; each row lists all columns ordered by column index. Materializes every
row, so prefer toRowVector for large frames.
>>>toRowList df[[("name", "Alice"), ("age", 25), ...], [("name", "Bob"), ("age", 30), ...], ...]
toRowVector :: [Text] -> DataFrame -> Vector Row Source #
Convert the dataframe to a vector of rows containing only the named columns, in the given order. An empty name list yields one empty row per dataframe row.
>>>toRowVector ["name", "age"] dfVector of rows with only name and age fields