dataframe-0.3.3.2: A fast, safe, and intuitive DataFrame library.
Safe HaskellNone
LanguageHaskell2010

DataFrame.IO.CSV

Synopsis

Documentation

data GrowingVector a Source #

Constructors

GrowingVector 

Fields

data GrowingUnboxedVector a Source #

Constructors

GrowingUnboxedVector 

Fields

data ReadOptions Source #

CSV read parameters.

Constructors

ReadOptions 

Fields

  • hasHeader :: Bool

    Whether or not the CSV file has a header. (default: True)

  • inferTypes :: Bool

    Whether to try and infer types. (default: True)

  • safeRead :: Bool

    Whether to partially parse values into Maybe/Either. (default: True)

  • chunkSize :: Int

    Default chunk size (in bytes) for csv reader. (default: 512'000)

  • dateFormat :: String

    Format of date fields as recognized by the Data.Time.Format module.

    Examples:

       > parseTimeM True defaultTimeLocale "%Y%-m%-d" "2010304" :: Maybe Day
       Just 2010-03-04
       > parseTimeM True defaultTimeLocale "%d%-m%-Y" "0432010" :: Maybe Day
       Just 2010-03-04
       

readCsv :: FilePath -> IO DataFrame Source #

Read CSV file from path and load it into a dataframe.

Example

Expand
ghci> D.readCsv "./data/taxi.csv"

readCsvWithOpts :: ReadOptions -> FilePath -> IO DataFrame Source #

Read CSV file from path and load it into a dataframe.

Example

Expand
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

Expand
ghci> D.readTsv "./data/taxi.tsv"

readSeparated :: Char -> ReadOptions -> FilePath -> IO DataFrame Source #

Read text file with specified delimiter into a dataframe.

Example

Expand
ghci> D.readSeparated ';' D.defaultReadOptions "./data/taxi.txt"

writeSeparated Source #

Arguments

:: Char

Separator

-> FilePath

Path to write to

-> DataFrame 
-> IO ()