| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
LightGBM.Utils.Csv
Description
- readColumn :: Read a => Int -> HasHeader -> ByteString -> Vector a
- dropColumns :: Foldable t => t Int -> ByteString -> ByteString
- keepColumns :: Foldable t => t Int -> ByteString -> ByteString
- dropNamedColumns :: (Foldable t, Functor t) => t ByteString -> ByteString -> ByteString
- keepNamedColumns :: (Foldable t, Functor t) => t ByteString -> ByteString -> ByteString
Reading from CSV files
readColumn :: Read a => Int -> HasHeader -> ByteString -> Vector a Source #
Read in the n'th column of a CSV file
Reshaping CSV files
dropColumns :: Foldable t => t Int -> ByteString -> ByteString Source #
Drop the selected columns of the CSV file
>>>csv = pack "h0,h1,h2,h3,h4\n0,1,2,3,4\n10,11,12,13,14\n">>>dropColumns [1, 3] csv"h0,h2,h4\r\n0,2,4\r\n10,12,14\r\n"
keepColumns :: Foldable t => t Int -> ByteString -> ByteString Source #
Keep only the selected columns of the CSV file
>>>csv = pack "h0,h1,h2,h3,h4\n0,1,2,3,4\n10,11,12,13,14\n">>>keepColumns [1, 3] csv"h1,h3\r\n1,3\r\n11,13\r\n"
dropNamedColumns :: (Foldable t, Functor t) => t ByteString -> ByteString -> ByteString Source #
keepNamedColumns :: (Foldable t, Functor t) => t ByteString -> ByteString -> ByteString Source #