| 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
- = InferFromSample Int
- | SpecifyTypes [(Text, SchemaType)]
- | NoInference
- data ReadOptions = ReadOptions {
- headerSpec :: HeaderSpec
- typeSpec :: TypeSpec
- safeRead :: Bool
- dateFormat :: String
- columnSeparator :: Char
- numColumns :: Maybe Int
- missingIndicators :: [Text]
- shouldInferFromSample :: TypeSpec -> Bool
- schemaTypeMap :: TypeSpec -> Map Text SchemaType
- typeInferenceSampleSize :: TypeSpec -> Int
- defaultReadOptions :: ReadOptions
- readCsv :: FilePath -> IO DataFrame
- readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame
- readTsv :: FilePath -> IO DataFrame
- readSeparated :: ReadOptions -> FilePath -> IO DataFrame
- decodeSeparated :: ReadOptions -> ByteString -> IO DataFrame
- initializeColumns :: [Text] -> [ByteString] -> ReadOptions -> IO [BuilderColumn]
- processStream :: [Text] -> Records (Vector ByteString) -> Vector BuilderColumn -> Maybe Int -> IO ()
- processRow :: [Text] -> Vector ByteString -> Vector BuilderColumn -> IO ()
- freezeBuilderColumn :: BuilderColumn -> IO Column
- finalizeBuilderColumn :: ReadOptions -> BuilderColumn -> IO Column
- inferColumnFromBS :: ReadOptions -> Vector ByteString -> Vector Word8 -> Column
- makeParsingAssumptionBS :: String -> Vector (Maybe ByteString) -> ParsingAssumption
- handleBSBool :: Vector (Maybe ByteString) -> Column
- handleBSInt :: String -> Vector (Maybe ByteString) -> Column
- handleBSDouble :: Vector (Maybe ByteString) -> Column
- handleBSDate :: String -> Vector (Maybe ByteString) -> Column
- handleBSText :: Vector (Maybe ByteString) -> Column
- handleBSNo :: String -> Vector (Maybe ByteString) -> Column
- constructOptional :: (Unbox a, Columnable a) => Vector a -> Vector Word8 -> IO Column
- constructOptionalBoxed :: Vector Text -> Vector Word8 -> IO Column
- writeCsv :: FilePath -> DataFrame -> IO ()
- writeTsv :: 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
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 [(Text, SchemaType)] | |
| NoInference |
data ReadOptions Source #
CSV read parameters.
Constructors
| ReadOptions | |
Fields
| |
shouldInferFromSample :: TypeSpec -> Bool Source #
schemaTypeMap :: TypeSpec -> Map Text 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 :: ReadOptions -> FilePath -> IO DataFrame Source #
Read text file with specified delimiter into a dataframe.
Example
ghci> D.readSeparated (D.defaultReadOptions { columnSeparator = ';' }) "./data/taxi.txt"
decodeSeparated :: ReadOptions -> ByteString -> IO DataFrame Source #
initializeColumns :: [Text] -> [ByteString] -> ReadOptions -> IO [BuilderColumn] Source #
processStream :: [Text] -> Records (Vector ByteString) -> Vector BuilderColumn -> Maybe Int -> IO () Source #
processRow :: [Text] -> Vector ByteString -> Vector BuilderColumn -> IO () Source #
finalizeBuilderColumn :: ReadOptions -> BuilderColumn -> IO Column Source #
inferColumnFromBS :: ReadOptions -> Vector ByteString -> Vector Word8 -> Column Source #
makeParsingAssumptionBS :: String -> Vector (Maybe ByteString) -> ParsingAssumption Source #
handleBSBool :: Vector (Maybe ByteString) -> Column Source #
handleBSInt :: String -> Vector (Maybe ByteString) -> Column Source #
handleBSDouble :: Vector (Maybe ByteString) -> Column Source #
handleBSDate :: String -> Vector (Maybe ByteString) -> Column Source #
handleBSText :: Vector (Maybe ByteString) -> Column Source #
handleBSNo :: String -> Vector (Maybe ByteString) -> Column Source #
constructOptional :: (Unbox a, Columnable a) => Vector a -> Vector Word8 -> IO Column Source #
stripQuotes :: Text -> Text Source #