Struct polars_lazy::frame::LazyCsvReader
source · [−]pub struct LazyCsvReader<'a> { /* private fields */ }
Implementations
sourceimpl<'a> LazyCsvReader<'a>
impl<'a> LazyCsvReader<'a>
pub fn new(path: String) -> Self
sourcepub fn with_skip_rows_after_header(self, offset: usize) -> Self
pub fn with_skip_rows_after_header(self, offset: usize) -> Self
Skip this number of rows after the header location.
sourcepub fn with_row_count(self, row_count: Option<RowCount>) -> Self
pub fn with_row_count(self, row_count: Option<RowCount>) -> Self
Add a row_count
column.
sourcepub fn with_n_rows(self, num_rows: Option<usize>) -> Self
pub fn with_n_rows(self, num_rows: Option<usize>) -> Self
Try to stop parsing when n
rows are parsed. During multithreaded parsing the upper bound n
cannot
be guaranteed.
sourcepub fn with_infer_schema_length(self, num_rows: Option<usize>) -> Self
pub fn with_infer_schema_length(self, num_rows: Option<usize>) -> Self
Set the number of rows to use when inferring the csv schema.
the default is 100 rows.
Setting to None
will do a full table scan, very slow.
sourcepub fn with_ignore_parser_errors(self, ignore: bool) -> Self
pub fn with_ignore_parser_errors(self, ignore: bool) -> Self
Continue with next batch when a ParserError is encountered.
sourcepub fn with_schema(self, schema: SchemaRef) -> Self
pub fn with_schema(self, schema: SchemaRef) -> Self
Set the CSV file’s schema
sourcepub fn with_skip_rows(self, skip_rows: usize) -> Self
pub fn with_skip_rows(self, skip_rows: usize) -> Self
Skip the first n
rows during parsing. The header will be parsed at row n
.
sourcepub fn with_dtype_overwrite(self, schema: Option<&'a Schema>) -> Self
pub fn with_dtype_overwrite(self, schema: Option<&'a Schema>) -> Self
Overwrite the schema with the dtypes in this given Schema. The given schema may be a subset of the total schema.
sourcepub fn has_header(self, has_header: bool) -> Self
pub fn has_header(self, has_header: bool) -> Self
Set whether the CSV file has headers
sourcepub fn with_delimiter(self, delimiter: u8) -> Self
pub fn with_delimiter(self, delimiter: u8) -> Self
Set the CSV file’s column delimiter as a byte character
sourcepub fn with_comment_char(self, comment_char: Option<u8>) -> Self
pub fn with_comment_char(self, comment_char: Option<u8>) -> Self
Set the comment character. Lines starting with this character will be ignored.
sourcepub fn with_quote_char(self, quote: Option<u8>) -> Self
pub fn with_quote_char(self, quote: Option<u8>) -> Self
Set the char
used as quote char. The default is b'"'
. If set to [None]
quoting is disabled.
sourcepub fn with_null_values(self, null_values: Option<NullValues>) -> Self
pub fn with_null_values(self, null_values: Option<NullValues>) -> Self
Set values that will be interpreted as missing/ null.
sourcepub fn with_cache(self, cache: bool) -> Self
pub fn with_cache(self, cache: bool) -> Self
Cache the DataFrame after reading.
sourcepub fn low_memory(self, toggle: bool) -> Self
pub fn low_memory(self, toggle: bool) -> Self
Reduce memory usage in expensive of performance
sourcepub fn with_rechunk(self, toggle: bool) -> Self
pub fn with_rechunk(self, toggle: bool) -> Self
Rechunk the memory to contiguous chunks when parsing is done.
sourcepub fn with_encoding(self, enc: CsvEncoding) -> Self
pub fn with_encoding(self, enc: CsvEncoding) -> Self
Set CsvEncoding
sourcepub fn with_parse_dates(self, toggle: bool) -> Self
pub fn with_parse_dates(self, toggle: bool) -> Self
Automatically try to parse dates/ datetimes and time. If parsing fails, columns remain of dtype [DataType::Utf8]
.
sourcepub fn with_schema_modify<F>(self, f: F) -> Result<Self> where
F: Fn(Schema) -> Result<Schema>,
pub fn with_schema_modify<F>(self, f: F) -> Result<Self> where
F: Fn(Schema) -> Result<Schema>,
Modify a schema before we run the lazy scanning.
Important! Run this function latest in the builder!
pub fn finish_impl(self) -> Result<LazyFrame>
pub fn finish(self) -> Result<LazyFrame>
Trait Implementations
sourceimpl<'a> Clone for LazyCsvReader<'a>
impl<'a> Clone for LazyCsvReader<'a>
sourcefn clone(&self) -> LazyCsvReader<'a>
fn clone(&self) -> LazyCsvReader<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for LazyCsvReader<'a>
impl<'a> Send for LazyCsvReader<'a>
impl<'a> Sync for LazyCsvReader<'a>
impl<'a> Unpin for LazyCsvReader<'a>
impl<'a> UnwindSafe for LazyCsvReader<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more