| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.IO.CSV
Synopsis
- chunkSize :: Int
- data PagedVector a = PagedVector {}
- data PagedUnboxedVector a = PagedUnboxedVector {}
- data BuilderColumn
- newPagedVector :: IO (PagedVector a)
- newPagedUnboxedVector :: Unbox a => IO (PagedUnboxedVector a)
- appendPagedVector :: PagedVector a -> a -> IO ()
- appendPagedUnboxedVector :: Unbox a => PagedUnboxedVector a -> a -> IO ()
- freezePagedVector :: PagedVector a -> IO (Vector a)
- freezePagedUnboxedVector :: Unbox a => PagedUnboxedVector a -> IO (Vector a)
- data HeaderSpec
- = NoHeader
- | UseFirstRow
- | ProvideNames [Text]
- data TypeSpec
- data ReadOptions = ReadOptions {
- headerSpec :: HeaderSpec
- typeSpec :: TypeSpec
- safeRead :: Bool
- dateFormat :: String
- shouldInferFromSample :: TypeSpec -> Bool
- schemaTypes :: TypeSpec -> [SchemaType]
- typeInferenceSampleSize :: TypeSpec -> Int
- defaultReadOptions :: ReadOptions
- readCsv :: FilePath -> IO DataFrame
- readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame
- readTsv :: FilePath -> IO DataFrame
- readSeparated :: Char -> ReadOptions -> FilePath -> IO DataFrame
- initializeColumns :: [ByteString] -> ReadOptions -> IO [BuilderColumn]
- processStream :: Records (Vector ByteString) -> [BuilderColumn] -> IO ()
- processRow :: Vector ByteString -> [BuilderColumn] -> IO ()
- isNull :: Text -> Bool
- freezeBuilderColumn :: BuilderColumn -> IO Column
- constructOptional :: (Unbox a, Columnable a) => Vector a -> Vector Word8 -> IO Column
- constructOptionalBoxed :: Vector Text -> Vector Word8 -> IO Column
- writeCsv :: FilePath -> DataFrame -> IO ()
- writeSeparated :: Char -> FilePath -> DataFrame -> IO ()
- getRowAsText :: DataFrame -> Int -> [Text]
- stripQuotes :: Text -> Text
Documentation
data PagedVector a Source #
data PagedUnboxedVector a Source #
data BuilderColumn Source #
Constructors
| BuilderInt !(PagedUnboxedVector Int) !(PagedUnboxedVector Word8) | |
| BuilderDouble !(PagedUnboxedVector Double) !(PagedUnboxedVector Word8) | |
| BuilderText !(PagedVector Text) !(PagedUnboxedVector Word8) |
newPagedVector :: IO (PagedVector a) Source #
newPagedUnboxedVector :: Unbox a => IO (PagedUnboxedVector a) Source #
appendPagedVector :: PagedVector a -> a -> IO () Source #
appendPagedUnboxedVector :: Unbox a => PagedUnboxedVector a -> a -> IO () Source #
freezePagedVector :: PagedVector a -> IO (Vector a) Source #
freezePagedUnboxedVector :: Unbox a => PagedUnboxedVector a -> IO (Vector a) Source #
data HeaderSpec Source #
STANDARD CONFIG TYPES
Constructors
| NoHeader | |
| UseFirstRow | |
| ProvideNames [Text] |
Instances
| Show HeaderSpec Source # | |
Defined in DataFrame.IO.CSV Methods showsPrec :: Int -> HeaderSpec -> ShowS # show :: HeaderSpec -> String # showList :: [HeaderSpec] -> ShowS # | |
| Eq HeaderSpec Source # | |
Defined in DataFrame.IO.CSV | |
Constructors
| InferFromSample Int | |
| SpecifyTypes [SchemaType] | |
| NoInference |
data ReadOptions Source #
CSV read parameters.
Constructors
| ReadOptions | |
Fields
| |
shouldInferFromSample :: TypeSpec -> Bool Source #
schemaTypes :: TypeSpec -> [SchemaType] Source #
readCsv :: FilePath -> IO DataFrame Source #
Read CSV file from path and load it into a dataframe.
Example
ghci> D.readCsv "./data/taxi.csv"
readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame Source #
Read CSV file from path and load it into a dataframe.
Example
ghci> D.readCsvWithOpts "./data/taxi.csv" (D.defaultReadOptions { dateFormat = "%d%-m%-Y" })
readTsv :: FilePath -> IO DataFrame Source #
Read TSV (tab separated) file from path and load it into a dataframe.
Example
ghci> D.readTsv "./data/taxi.tsv"
readSeparated :: Char -> ReadOptions -> FilePath -> IO DataFrame Source #
Read text file with specified delimiter into a dataframe.
Example
ghci> D.readSeparated ';' D.defaultReadOptions "./data/taxi.txt"
initializeColumns :: [ByteString] -> ReadOptions -> IO [BuilderColumn] Source #
processStream :: Records (Vector ByteString) -> [BuilderColumn] -> IO () Source #
processRow :: Vector ByteString -> [BuilderColumn] -> IO () Source #
constructOptional :: (Unbox a, Columnable a) => Vector a -> Vector Word8 -> IO Column Source #
stripQuotes :: Text -> Text Source #