pub struct CsvReader<R>where
R: MmapBytesReader,{ /* private fields */ }
Available on crate feature
polars-io
only.Expand description
Create a new DataFrame by reading a csv file.
§Example
use polars_core::prelude::*;
use polars_io::prelude::*;
use std::fs::File;
fn example() -> PolarsResult<DataFrame> {
CsvReadOptions::default()
.with_has_header(true)
.try_into_reader_with_file_path(Some("iris.csv".into()))?
.finish()
}
Implementations§
source§impl<R> CsvReader<R>where
R: MmapBytesReader,
impl<R> CsvReader<R>where
R: MmapBytesReader,
pub fn _with_predicate( self, predicate: Option<Arc<dyn PhysicalIoExpr>>, ) -> CsvReader<R>
source§impl<R> CsvReader<R>where
R: MmapBytesReader,
impl<R> CsvReader<R>where
R: MmapBytesReader,
pub fn batched_borrowed(&mut self) -> Result<BatchedCsvReader<'_>, PolarsError>
source§impl CsvReader<Box<dyn MmapBytesReader>>
impl CsvReader<Box<dyn MmapBytesReader>>
pub fn batched( self, schema: Option<Arc<Schema<DataType>>>, ) -> Result<OwnedBatchedCsvReader, PolarsError>
Trait Implementations§
source§impl<R> SerReader<R> for CsvReader<R>where
R: MmapBytesReader,
impl<R> SerReader<R> for CsvReader<R>where
R: MmapBytesReader,
source§fn new(reader: R) -> CsvReader<R>
fn new(reader: R) -> CsvReader<R>
Create a new CsvReader from a file/stream using default read options. To
use non-default read options, first construct CsvReadOptions and then use
any of the (try)_into_
methods.
source§fn set_rechunk(self, _rechunk: bool) -> Selfwhere
Self: Sized,
fn set_rechunk(self, _rechunk: bool) -> Selfwhere
Self: Sized,
Make sure that all columns are contiguous in memory by
aggregating the chunks into a single array.
Auto Trait Implementations§
impl<R> Freeze for CsvReader<R>where
R: Freeze,
impl<R> !RefUnwindSafe for CsvReader<R>
impl<R> Send for CsvReader<R>
impl<R> Sync for CsvReader<R>
impl<R> Unpin for CsvReader<R>where
R: Unpin,
impl<R> !UnwindSafe for CsvReader<R>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more