Struct polars_io::csv::read::CsvParseOptions
source · pub struct CsvParseOptions {
pub separator: u8,
pub quote_char: Option<u8>,
pub eol_char: u8,
pub encoding: CsvEncoding,
pub null_values: Option<NullValues>,
pub missing_is_null: bool,
pub truncate_ragged_lines: bool,
pub comment_prefix: Option<CommentPrefix>,
pub try_parse_dates: bool,
pub decimal_comma: bool,
}
csv
or json
only.Fields§
§separator: u8
§quote_char: Option<u8>
§eol_char: u8
§encoding: CsvEncoding
§null_values: Option<NullValues>
§missing_is_null: bool
§truncate_ragged_lines: bool
§comment_prefix: Option<CommentPrefix>
§try_parse_dates: bool
§decimal_comma: bool
Implementations§
source§impl CsvParseOptions
impl CsvParseOptions
sourcepub fn with_separator(self, separator: u8) -> Self
pub fn with_separator(self, separator: u8) -> Self
The character used to separate fields in the CSV file. This is most often a comma ‘,’.
sourcepub fn with_quote_char(self, quote_char: Option<u8>) -> Self
pub fn with_quote_char(self, quote_char: Option<u8>) -> Self
Set the character used for field quoting. This is most often double quotes ‘“’. Set this to None to disable quote parsing.
sourcepub fn with_eol_char(self, eol_char: u8) -> Self
pub fn with_eol_char(self, eol_char: u8) -> Self
Set the character used to indicate an end-of-line (eol).
sourcepub fn with_encoding(self, encoding: CsvEncoding) -> Self
pub fn with_encoding(self, encoding: CsvEncoding) -> Self
Set the encoding used by the file.
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.
Note: These values are matched before quote-parsing, so if the null values are quoted then those quotes also need to be included here.
sourcepub fn with_missing_is_null(self, missing_is_null: bool) -> Self
pub fn with_missing_is_null(self, missing_is_null: bool) -> Self
Treat missing fields as null.
sourcepub fn with_truncate_ragged_lines(self, truncate_ragged_lines: bool) -> Self
pub fn with_truncate_ragged_lines(self, truncate_ragged_lines: bool) -> Self
Truncate lines that are longer than the schema.
sourcepub fn with_comment_prefix<T: Into<CommentPrefix>>(
self,
comment_prefix: Option<T>
) -> Self
pub fn with_comment_prefix<T: Into<CommentPrefix>>( self, comment_prefix: Option<T> ) -> Self
Sets the comment prefix for this instance. Lines starting with this prefix will be ignored.
sourcepub fn with_try_parse_dates(self, try_parse_dates: bool) -> Self
pub fn with_try_parse_dates(self, try_parse_dates: bool) -> Self
Automatically try to parse dates/datetimes and time. If parsing fails,
columns remain of dtype [DataType::String]
.
sourcepub fn with_decimal_comma(self, decimal_comma: bool) -> Self
pub fn with_decimal_comma(self, decimal_comma: bool) -> Self
Parse floats with a comma as decimal separator.
Trait Implementations§
source§impl Clone for CsvParseOptions
impl Clone for CsvParseOptions
source§fn clone(&self) -> CsvParseOptions
fn clone(&self) -> CsvParseOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CsvParseOptions
impl Debug for CsvParseOptions
source§impl Default for CsvParseOptions
impl Default for CsvParseOptions
Options related to parsing the CSV format.
source§impl<'de> Deserialize<'de> for CsvParseOptions
impl<'de> Deserialize<'de> for CsvParseOptions
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for CsvParseOptions
impl Hash for CsvParseOptions
source§impl PartialEq for CsvParseOptions
impl PartialEq for CsvParseOptions
source§fn eq(&self, other: &CsvParseOptions) -> bool
fn eq(&self, other: &CsvParseOptions) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CsvParseOptions
impl Serialize for CsvParseOptions
impl Eq for CsvParseOptions
impl StructuralPartialEq for CsvParseOptions
Auto Trait Implementations§
impl Freeze for CsvParseOptions
impl RefUnwindSafe for CsvParseOptions
impl Send for CsvParseOptions
impl Sync for CsvParseOptions
impl Unpin for CsvParseOptions
impl UnwindSafe for CsvParseOptions
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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>
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>
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