[][src]Struct polars::frame::ser::csv::CsvReader

pub struct CsvReader<R> where
    R: Read + Seek
{ /* fields omitted */ }

Creates a DataFrame after reading a csv.

Implementations

impl<R> CsvReader<R> where
    R: Read + Seek
[src]

pub fn with_schema(self, schema: Arc<Schema>) -> 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()
}

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

Trait Implementations

impl<R> SerReader<R> for CsvReader<R> where
    R: Read + Seek
[src]

fn new(reader: R) -> Self[src]

Create a new CsvReader from a file/ stream

fn set_rechunk(self, rechunk: bool) -> Self[src]

Rechunk to one contiguous chunk of memory after all data is read

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

impl<R> Send for CsvReader<R> where
    R: Send

impl<R> Sync for CsvReader<R> where
    R: Sync

impl<R> Unpin for CsvReader<R> where
    R: Unpin

impl<R> UnwindSafe for CsvReader<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,