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 finish(self) -> PolarsResult<DataFrame>
fn finish(self) -> PolarsResult<DataFrame>
Read the file and create the DataFrame.
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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