pub struct CsvReader<R>where
R: MmapBytesReader,{ /* private fields */ }
Available on crate features
csv
or json
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>>) -> Self
source§impl<R: MmapBytesReader> CsvReader<R>
impl<R: MmapBytesReader> CsvReader<R>
pub fn batched_borrowed(&mut self) -> PolarsResult<BatchedCsvReader<'_>>
source§impl CsvReader<Box<dyn MmapBytesReader>>
impl CsvReader<Box<dyn MmapBytesReader>>
pub fn batched( self, schema: Option<SchemaRef> ) -> PolarsResult<OwnedBatchedCsvReader>
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) -> Self
fn new(reader: R) -> Self
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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