[−][src]Struct polars::frame::csv::CsvReader
Creates a DataFrame after reading a csv.
Implementations
impl<R> CsvReader<R> where
R: Read + Seek,
[src]
R: Read + Seek,
pub fn new(reader: R) -> Self
[src]
Create a new DataFrame by reading a csv file.
Example
use polars::prelude::*; use std::fs::File; fn example() -> Result<DataFrame> { let file = File::open("iris.csv").expect("could not open file"); CsvReader::new(file) .infer_schema(None) .has_header(true) .finish() }
Create a new CsvReader from a file/ stream
pub fn set_rechunk(self, rechunk: bool) -> Self
[src]
Rechunk to one contiguous chunk of memory after all data is read
pub fn with_schema(self, schema: Arc<Schema>) -> Self
[src]
Set the CSV file's schema
pub fn has_header(self, has_header: bool) -> Self
[src]
Set whether the CSV file has headers
pub fn with_delimiter(self, delimiter: u8) -> Self
[src]
Set the CSV file's column delimiter as a byte character
pub fn infer_schema(self, max_records: Option<usize>) -> Self
[src]
Set the CSV reader to infer the schema of the file
pub fn with_batch_size(self, batch_size: usize) -> Self
[src]
Set the batch size (number of records to load at one time)
pub fn with_projection(self, projection: Vec<usize>) -> Self
[src]
Set the reader's column projection
pub fn finish(self) -> Result<DataFrame>
[src]
Read the file and create the DataFrame.
Auto Trait Implementations
impl<R> RefUnwindSafe for CsvReader<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for CsvReader<R> where
R: Send,
R: Send,
impl<R> Sync for CsvReader<R> where
R: Sync,
R: Sync,
impl<R> Unpin for CsvReader<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for CsvReader<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,