| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame
Description
Batteries-included entry point re-exporting the common pieces for GHCi.
Synopsis
- module DataFrame.Core
- module DataFrame.Expression.Operators
- data DisplayOptions = DisplayOptions {}
- defaultDisplayOptions :: DisplayOptions
- display :: DisplayOptions -> DataFrame -> IO ()
- module DataFrame.Operations.Core
- data SchemaType where
- SType :: forall a. (Columnable a, Read a) => Proxy a -> SchemaType
- schemaType :: (Columnable a, Read a) => SchemaType
- makeSchema :: [(Text, SchemaType)] -> Schema
- deriveSchemaValues :: Name -> DecsQ
- deriveSchemaFromType :: Name -> DecsQ
- data ReadOptions = ReadOptions {
- headerSpec :: HeaderSpec
- typeSpec :: TypeSpec
- safeRead :: SafeReadMode
- safeReadOverrides :: [(Text, SafeReadMode)]
- dateFormat :: String
- columnSeparator :: Char
- numRowsToRead :: Maybe Int
- readColumns :: Maybe [Text]
- missingIndicators :: [Text]
- fastCsvOnRaggedRow :: RaggedRowPolicy
- fastCsvOnUnclosedQuote :: UnclosedQuotePolicy
- fastCsvTrimUnquoted :: Bool
- data TypeSpec
- data HeaderSpec
- = NoHeader
- | UseFirstRow
- | ProvideNames [Text]
- defaultReadOptions :: ReadOptions
- readCsv :: FilePath -> IO DataFrame
- readCsvWithSchema :: Schema -> FilePath -> IO DataFrame
- readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame
- readTsv :: FilePath -> IO DataFrame
- readSeparated :: ReadOptions -> FilePath -> IO DataFrame
- writeCsv :: FilePath -> DataFrame -> IO ()
- writeSeparated :: Char -> FilePath -> DataFrame -> IO ()
- fromCsv :: String -> IO (Either String DataFrame)
- fromCsvBytes :: ByteString -> IO DataFrame
- data ParquetReadOptions = ParquetReadOptions {}
- writeParquet :: FilePath -> DataFrame -> IO ()
- writeParquetWithOptions :: ParquetWriteOptions -> FilePath -> DataFrame -> IO ()
- data ParquetWriteOptions = ParquetWriteOptions {
- pageSize :: !Int
- rowGroupSize :: !Int
- batchRows :: !Int
- subBatchRows :: !Int
- compressionCodec :: !CompressionCodec
- strategy :: !WriterStrategy
- maxRowsPerFile :: !(Maybe Int)
- data WriterStrategy
- defaultParquetWriteOptions :: ParquetWriteOptions
- defaultParquetReadOptions :: ParquetReadOptions
- readParquet :: FilePath -> IO DataFrame
- readParquetWithOpts :: ParquetReadOptions -> FilePath -> IO DataFrame
- readParquetFiles :: FilePath -> IO DataFrame
- readParquetFilesWithOpts :: ParquetReadOptions -> FilePath -> IO DataFrame
- module DataFrame.IO.JSON
- run :: LazyDataFrame -> IO DataFrame
- data LazyDataFrame
- fromDataFrame :: DataFrame -> LazyDataFrame
- scanCsv :: Schema -> Text -> LazyDataFrame
- scanCsvWith :: CsvReader -> Schema -> Text -> LazyDataFrame
- scanSeparated :: Char -> Schema -> Text -> LazyDataFrame
- scanSeparatedWith :: CsvReader -> Char -> Schema -> Text -> LazyDataFrame
- scanParquet :: Schema -> Text -> LazyDataFrame
- module DataFrame.Synthesis
- module DataFrame.DecisionTree
- data SafeReadMode
- data ParseOptions = ParseOptions {
- missingValues :: [Text]
- sampleSize :: Int
- parseSafe :: SafeReadMode
- parseSafeOverrides :: [(Text, SafeReadMode)]
- parseDateFormat :: DateFormat
- defaultParseOptions :: ParseOptions
- effectiveSafeRead :: SafeReadMode -> [(Text, SafeReadMode)] -> Text -> SafeReadMode
- parseDefaults :: ParseOptions -> DataFrame -> DataFrame
- filter :: Expr Bool -> DataFrame -> DataFrame
- sample :: RandomGen g => g -> Double -> DataFrame -> DataFrame
- range :: (Int, Int) -> DataFrame -> DataFrame
- take :: Int -> DataFrame -> DataFrame
- drop :: Int -> DataFrame -> DataFrame
- select :: [Text] -> DataFrame -> DataFrame
- filterBy :: Columnable a => (a -> Bool) -> Expr a -> DataFrame -> DataFrame
- filterJust :: Text -> DataFrame -> DataFrame
- filterNothing :: Text -> DataFrame -> DataFrame
- filterAllJust :: DataFrame -> DataFrame
- filterAllNothing :: DataFrame -> DataFrame
- takeLast :: Int -> DataFrame -> DataFrame
- dropLast :: Int -> DataFrame -> DataFrame
- cube :: (Int, Int) -> DataFrame -> DataFrame
- selectRows :: [Int] -> DataFrame -> DataFrame
- randomSplit :: RandomGen g => g -> Double -> DataFrame -> (DataFrame, DataFrame)
- kFolds :: RandomGen g => g -> Int -> DataFrame -> [DataFrame]
- stratifiedSample :: forall a g. (SplittableGen g, Columnable a) => g -> Double -> Expr a -> DataFrame -> DataFrame
- stratifiedSplit :: forall a g. (SplittableGen g, Columnable a) => g -> Double -> Expr a -> DataFrame -> (DataFrame, DataFrame)
- selectBy :: [SelectionCriteria] -> DataFrame -> DataFrame
- exclude :: [Text] -> DataFrame -> DataFrame
- data SelectionCriteria
- byName :: Text -> SelectionCriteria
- byProperty :: (Column -> Bool) -> SelectionCriteria
- byNameProperty :: (Text -> Bool) -> SelectionCriteria
- byNameRange :: (Text, Text) -> SelectionCriteria
- byIndexRange :: (Int, Int) -> SelectionCriteria
- apply :: (Columnable b, Columnable c) => (b -> c) -> Text -> DataFrame -> DataFrame
- derive :: Columnable a => Text -> Expr a -> DataFrame -> DataFrame
- deriveMany :: [NamedExpr] -> DataFrame -> DataFrame
- deriveWithExpr :: Columnable a => Text -> Expr a -> DataFrame -> (Expr a, DataFrame)
- impute :: ImputeOp a => Expr a -> BaseType a -> DataFrame -> DataFrame
- applyInt :: Columnable b => (Int -> b) -> Text -> DataFrame -> DataFrame
- applyDouble :: Columnable b => (Double -> b) -> Text -> DataFrame -> DataFrame
- applyMany :: (Columnable b, Columnable c) => (b -> c) -> [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
- safeApply :: (Columnable b, Columnable c) => (b -> c) -> Text -> DataFrame -> Either DataFrameException DataFrame
- groupBy :: [Text] -> DataFrame -> GroupedDataFrame
- aggregate :: [NamedExpr] -> GroupedDataFrame -> DataFrame
- distinct :: DataFrame -> DataFrame
- shuffle :: RandomGen g => g -> DataFrame -> DataFrame
- sortBy :: [SortOrder] -> DataFrame -> DataFrame
- data SortOrder where
- Asc :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder
- Desc :: forall a. (Columnable a, Ord a) => Expr a -> SortOrder
- topBy :: Int -> Int -> [SortOrder] -> DataFrame -> DataFrame
- module DataFrame.Operations.Merge
- module DataFrame.Operations.SetOps
- join :: JoinType -> [Text] -> DataFrame -> DataFrame -> DataFrame
- data JoinType
- = INNER
- | LEFT
- | RIGHT
- | FULL_OUTER
- joinOn :: JoinType -> [(Text, Text)] -> DataFrame -> DataFrame -> DataFrame
- innerJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
- leftJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
- rightJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
- fullOuterJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame
- module DataFrame.Operations.Statistics
- module DataFrame.Errors
- class HasSchema a where
- type Schema a :: [(Symbol, Type)]
- recordsToColumns :: [a] -> [(Text, Column)]
- recordsFromFrame :: DataFrame -> Either Text [a]
- type family Schema a :: [(Symbol, Type)]
- fromRecords :: HasSchema a => [a] -> DataFrame
- toRecords :: HasSchema a => DataFrame -> Either Text [a]
- schemaColumnNames :: forall (cols :: [(Symbol, Type)]). KnownSchema cols => [Text]
- declareColumnsFromCsvFile :: String -> DecsQ
- declareColumnsFromCsvWithOpts :: ReadOptions -> String -> DecsQ
- deriveSchemaValuesFromCsvFile :: String -> String -> DecsQ
- deriveSchemaValuesFromCsvWithOpts :: ReadOptions -> String -> String -> DecsQ
- declareColumnsFromParquetFile :: String -> DecsQ
- deriveSchemaValuesFromParquetFile :: String -> String -> DecsQ
- declareColumns :: DataFrame -> DecsQ
- declareColumnsWithPrefix :: Text -> DataFrame -> DecsQ
- declareColumnsWithPrefix' :: Maybe Text -> DataFrame -> DecsQ
- declareSchemaValues :: String -> DataFrame -> DecsQ
- module DataFrame.Display.Terminal.Plot
Core data structures
module DataFrame.Core
Operator symbols.
Display operations
data DisplayOptions #
Constructors
| DisplayOptions | |
Fields
| |
defaultDisplayOptions :: DisplayOptions #
Terminal defaults: 10 rows plus the standard column and cell caps.
display :: DisplayOptions -> DataFrame -> IO () #
Render a DataFrame to stdout according to DisplayOptions.
Core dataframe operations
module DataFrame.Operations.Core
Types
data SchemaType where #
A runtime tag for a column’s element type.
Constructors
| SType :: forall a. (Columnable a, Read a) => Proxy a -> SchemaType | Constructor carrying a |
Instances
| Show SchemaType | Show the underlying element type using |
Defined in DataFrame.Internal.Schema Methods showsPrec :: Int -> SchemaType -> ShowS # show :: SchemaType -> String # showList :: [SchemaType] -> ShowS # | |
| Eq SchemaType | Two |
Defined in DataFrame.Internal.Schema | |
schemaType :: (Columnable a, Read a) => SchemaType #
Construct a SchemaType for the given a.
makeSchema :: [(Text, SchemaType)] -> Schema #
Construct a Schema from a list of (columnName, schemaType) pairs.
deriveSchemaValues :: Name -> DecsQ #
Derive an untyped Schema value and per-column accessors from a record.
deriveSchemaFromType :: Name -> DecsQ #
I/O
data ReadOptions #
CSV read parameters.
Constructors
| ReadOptions | |
Fields
| |
How a reader decides each column's type.
Constructors
| InferFromSample Int | Infer each column's type from the first |
| SpecifyTypes [(Text, SchemaType)] TypeSpec | Pin the listed columns to their given types, with a fallback. |
| NoInference | Every column is read as |
data HeaderSpec #
Where a reader's column names come from.
Constructors
| NoHeader | |
| UseFirstRow | Take names from the first row (the default). |
| ProvideNames [Text] | Name the leading columns; any beyond the given list are numbered. |
Instances
| Show HeaderSpec | |
Defined in DataFrame.IO.CSV.Internal.Options Methods showsPrec :: Int -> HeaderSpec -> ShowS # show :: HeaderSpec -> String # showList :: [HeaderSpec] -> ShowS # | |
| Eq HeaderSpec | |
Defined in DataFrame.IO.CSV.Internal.Options | |
defaultReadOptions :: ReadOptions #
The default ReadOptions: infer from 100 rows, header row, all data.
readCsvWithSchema :: Schema -> FilePath -> IO DataFrame #
Read a CSV, coercing columns to the types declared in a Schema.
readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame #
Read a CSV file from a path using the given ReadOptions.
readSeparated :: ReadOptions -> FilePath -> IO DataFrame #
Read a text file with a chosen delimiter into a dataframe.
Write a dataframe to a file using the given field separator.
fromCsv :: String -> IO (Either String DataFrame) #
Parse a CSV string into a DataFrame using default options.
fromCsvBytes :: ByteString -> IO DataFrame #
Parse a lazy ByteString of CSV data using default options.
data ParquetReadOptions #
Options for reading Parquet data.
Constructors
| ParquetReadOptions | |
Fields
| |
Instances
| Show ParquetReadOptions | |
Defined in DataFrame.IO.Parquet Methods showsPrec :: Int -> ParquetReadOptions -> ShowS # show :: ParquetReadOptions -> String # showList :: [ParquetReadOptions] -> ShowS # | |
writeParquet :: FilePath -> DataFrame -> IO () #
writeParquetWithOptions :: ParquetWriteOptions -> FilePath -> DataFrame -> IO () #
data ParquetWriteOptions #
Constructors
| ParquetWriteOptions | |
Fields
| |
Instances
| Show ParquetWriteOptions | |
Defined in DataFrame.IO.Parquet.Writer.Options Methods showsPrec :: Int -> ParquetWriteOptions -> ShowS # show :: ParquetWriteOptions -> String # showList :: [ParquetWriteOptions] -> ShowS # | |
| Eq ParquetWriteOptions | |
Defined in DataFrame.IO.Parquet.Writer.Options Methods (==) :: ParquetWriteOptions -> ParquetWriteOptions -> Bool # (/=) :: ParquetWriteOptions -> ParquetWriteOptions -> Bool # | |
data WriterStrategy #
Instances
| Show WriterStrategy | |
Defined in DataFrame.IO.Parquet.Writer.Options Methods showsPrec :: Int -> WriterStrategy -> ShowS # show :: WriterStrategy -> String # showList :: [WriterStrategy] -> ShowS # | |
| Eq WriterStrategy | |
Defined in DataFrame.IO.Parquet.Writer.Options Methods (==) :: WriterStrategy -> WriterStrategy -> Bool # (/=) :: WriterStrategy -> WriterStrategy -> Bool # | |
defaultParquetReadOptions :: ParquetReadOptions #
Default Parquet read options.
readParquet :: FilePath -> IO DataFrame #
Read a parquet file from path and load it into a dataframe.
readParquetWithOpts :: ParquetReadOptions -> FilePath -> IO DataFrame #
Read a Parquet file using explicit read options.
readParquetFiles :: FilePath -> IO DataFrame #
Read Parquet files from a directory or glob path.
readParquetFilesWithOpts :: ParquetReadOptions -> FilePath -> IO DataFrame #
Read multiple Parquet files (directory or glob) using options.
module DataFrame.IO.JSON
Lazy query engine
data LazyDataFrame #
A lazy query: a LogicalPlan whose execution waits for run.
Instances
| Monoid LazyDataFrame | |
Defined in DataFrame.Lazy.Internal.DataFrame Methods mempty :: LazyDataFrame # mappend :: LazyDataFrame -> LazyDataFrame -> LazyDataFrame # mconcat :: [LazyDataFrame] -> LazyDataFrame # | |
| Semigroup LazyDataFrame | Concatenate rows, as the eager |
Defined in DataFrame.Lazy.Internal.DataFrame Methods (<>) :: LazyDataFrame -> LazyDataFrame -> LazyDataFrame # sconcat :: NonEmpty LazyDataFrame -> LazyDataFrame # stimes :: Integral b => b -> LazyDataFrame -> LazyDataFrame # | |
| Show LazyDataFrame | |
Defined in DataFrame.Lazy.Internal.DataFrame Methods showsPrec :: Int -> LazyDataFrame -> ShowS # show :: LazyDataFrame -> String # showList :: [LazyDataFrame] -> ShowS # | |
fromDataFrame :: DataFrame -> LazyDataFrame #
Lift an already-loaded eager DataFrame into the lazy plan.
scanCsv :: Schema -> Text -> LazyDataFrame #
Scan a CSV file with the default comma separator and strict reader.
scanCsvWith :: CsvReader -> Schema -> Text -> LazyDataFrame #
scanSeparated :: Char -> Schema -> Text -> LazyDataFrame #
Scan a character-separated file with the default strict reader.
scanSeparatedWith :: CsvReader -> Char -> Schema -> Text -> LazyDataFrame #
Like scanSeparated but with an explicit CSV reader.
scanParquet :: Schema -> Text -> LazyDataFrame #
Scan a Parquet file, directory of files, or glob pattern.
Feature synthesis & decision trees
module DataFrame.Synthesis
module DataFrame.DecisionTree
Type conversion
data SafeReadMode #
Constructors
| NoSafeRead | |
| MaybeRead | |
| EitherRead |
Instances
| Read SafeReadMode | |
Defined in DataFrame.Operations.Typing Methods readsPrec :: Int -> ReadS SafeReadMode # readList :: ReadS [SafeReadMode] # | |
| Show SafeReadMode | |
Defined in DataFrame.Operations.Typing Methods showsPrec :: Int -> SafeReadMode -> ShowS # show :: SafeReadMode -> String # showList :: [SafeReadMode] -> ShowS # | |
| Eq SafeReadMode | |
Defined in DataFrame.Operations.Typing | |
data ParseOptions #
Options controlling how text columns are parsed into typed values.
Constructors
| ParseOptions | |
Fields
| |
defaultParseOptions :: ParseOptions #
Sensible out-of-the-box parse options: infer from 100 rows, ISO dates.
effectiveSafeRead :: SafeReadMode -> [(Text, SafeReadMode)] -> Text -> SafeReadMode #
Resolve a column's effective SafeReadMode: override if present.
parseDefaults :: ParseOptions -> DataFrame -> DataFrame #
Operations
sample :: RandomGen g => g -> Double -> DataFrame -> DataFrame #
Sample a dataframe; the fraction must be between 0 and 1 inclusive.
Arguments
| :: Columnable a | |
| => (a -> Bool) | Filter condition |
| -> Expr a | Column to filter by |
| -> DataFrame | Dataframe to filter |
| -> DataFrame |
O(n * k) Keep rows whose value of the expression satisfies the predicate.
filterJust :: Text -> DataFrame -> DataFrame #
O(k) Remove all rows with Nothing in a given column.
filterNothing :: Text -> DataFrame -> DataFrame #
O(k) Return all rows with Nothing in a given column.
filterAllJust :: DataFrame -> DataFrame #
O(n * k) Remove all rows with Nothing from the dataframe.
filterAllNothing :: DataFrame -> DataFrame #
O(n * k) Keep any row with a null value.
cube :: (Int, Int) -> DataFrame -> DataFrame #
O(k) Cut the dataframe to a cube of size (length, width).
selectRows :: [Int] -> DataFrame -> DataFrame #
O(k * n) Select rows by index.
randomSplit :: RandomGen g => g -> Double -> DataFrame -> (DataFrame, DataFrame) #
Split a dataset in two: a sample of fraction p and the remainder.
stratifiedSample :: forall a g. (SplittableGen g, Columnable a) => g -> Double -> Expr a -> DataFrame -> DataFrame #
Sample a dataframe, preserving per-stratum proportions.
stratifiedSplit :: forall a g. (SplittableGen g, Columnable a) => g -> Double -> Expr a -> DataFrame -> (DataFrame, DataFrame) #
Split a dataframe into two, preserving per-stratum proportions.
selectBy :: [SelectionCriteria] -> DataFrame -> DataFrame #
O(n) select columns by column predicate name.
data SelectionCriteria #
byName :: Text -> SelectionCriteria #
Criteria for selecting a column by name.
byProperty :: (Column -> Bool) -> SelectionCriteria #
Criteria for selecting columns whose property satisfies a predicate.
byNameProperty :: (Text -> Bool) -> SelectionCriteria #
Criteria for selecting columns whose name satisfies a predicate.
byNameRange :: (Text, Text) -> SelectionCriteria #
Criteria for selecting columns whose names are in a lexicographic range.
byIndexRange :: (Int, Int) -> SelectionCriteria #
Criteria for selecting columns whose indices are in an inclusive range.
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.
derive :: Columnable a => Text -> Expr a -> DataFrame -> DataFrame #
O(k) Derive a new column named alias from an expression.
deriveMany :: [NamedExpr] -> DataFrame -> DataFrame #
deriveWithExpr :: Columnable a => Text -> Expr a -> DataFrame -> (Expr a, DataFrame) #
O(k) Like derive but also returns a reference to the new column.
impute :: ImputeOp a => Expr a -> BaseType a -> DataFrame -> DataFrame #
Replace all instances of Nothing in a column with the given value.
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.
applyMany :: (Columnable b, Columnable c) => (b -> c) -> [Text] -> DataFrame -> DataFrame #
O(k * n) Apply a function to given column names in a dataframe.
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 where another column matches.
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.
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 apply. Returns the error instead of throwing.
groupBy :: [Text] -> DataFrame -> GroupedDataFrame #
O(k * n) group the dataframe by the given key columns via a hash table.
aggregate :: [NamedExpr] -> GroupedDataFrame -> DataFrame #
Aggregate a grouped dataframe using the expressions given.
sortBy :: [SortOrder] -> DataFrame -> DataFrame #
O(k log n) Sort the dataframe by the given sort orders.
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 |
topBy :: Int -> Int -> [SortOrder] -> DataFrame -> DataFrame #
The rows a sortBy would place at positions [offset, offset + count).
module DataFrame.Operations.Merge
module DataFrame.Operations.SetOps
join :: JoinType -> [Text] -> DataFrame -> DataFrame -> DataFrame #
Join two dataframes using SQL join semantics.
Equivalent to SQL join types.
Constructors
| INNER | |
| LEFT | |
| RIGHT | |
| FULL_OUTER |
joinOn :: JoinType -> [(Text, Text)] -> DataFrame -> DataFrame -> DataFrame #
Join on (leftKey, rightKey) pairs; the result keeps the left names.
innerJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame #
Inner join on two dataframes using the specified key columns.
leftJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame #
Left join on two dataframes, keeping every row from the left dataframe.
rightJoin :: [Text] -> DataFrame -> DataFrame -> DataFrame #
Right join on two dataframes, keeping every row from the right dataframe.
Errors
module DataFrame.Errors
Record bridge
Bridge a Haskell record type to a typed-dataframe schema.
Methods
recordsToColumns :: [a] -> [(Text, Column)] #
recordsFromFrame :: DataFrame -> Either Text [a] #
fromRecords :: HasSchema a => [a] -> DataFrame #
Build an untyped DataFrame from a list of records.
toRecords :: HasSchema a => DataFrame -> Either Text [a] #
Parse a list of records out of an untyped DataFrame.
schemaColumnNames :: forall (cols :: [(Symbol, Type)]). KnownSchema cols => [Text] #
The column names a schema declares, in schema order.
Template Haskell column-binding splices
declareColumnsFromCsvFile :: String -> DecsQ #
Splice an Expr T binding for every column of a CSV file.
declareColumnsFromCsvWithOpts :: ReadOptions -> String -> DecsQ #
Like declareColumnsFromCsvFile but with custom ReadOptions.
deriveSchemaValuesFromCsvFile :: String -> String -> DecsQ #
deriveSchemaValuesFromCsvWithOpts :: ReadOptions -> String -> String -> DecsQ #
declareColumnsFromParquetFile :: String -> DecsQ #
Splice a binding for every column of a parquet file or directory.
deriveSchemaValuesFromParquetFile :: String -> String -> DecsQ #
declareColumns :: DataFrame -> DecsQ #
Splice a binding for every column of df, named after the column.
declareColumnsWithPrefix :: Text -> DataFrame -> DecsQ #
Like declareColumns but prefixes every binding name with prefix_.
declareColumnsWithPrefix' :: Maybe Text -> DataFrame -> DecsQ #
Like declareColumnsWithPrefix but takes an optional prefix.
declareSchemaValues :: String -> DataFrame -> DecsQ #