readable stream containing csv data
Optional
options: Partial<ReadCsvOptions>Promise
>>> const readStream = new Stream.Readable({read(){}});
>>> readStream.push(`a,b\n`);
>>> readStream.push(`1,2\n`);
>>> readStream.push(`2,2\n`);
>>> readStream.push(`3,2\n`);
>>> readStream.push(`4,2\n`);
>>> readStream.push(null);
>>> pl.readCSVStream(readStream).then(df => console.log(df));
shape: (4, 2)
┌─────┬─────┐
│ a ┆ b │
│ --- ┆ --- │
│ i64 ┆ i64 │
╞═════╪═════╡
│ 1 ┆ 2 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 2 ┆ 2 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 3 ┆ 2 │
├╌╌╌╌╌┼╌╌╌╌╌┤
│ 4 ┆ 2 │
└─────┴─────┘
Read a stream into a Dataframe.
Warning: this is much slower than
scanCSV
orreadCSV
This will consume the entire stream into a single buffer and then call
readCSV
Only use it when you must consume from a stream, or when performance is not a major consideration