pub struct Writer { /* private fields */ }Expand description
DataFrame reading struct
§Example
use blackjack::prelude::*;
let mut df = DataFrame::new();
df.add_column(Series::arange(0, 10));
df.add_column(Series::arange(0, 10));
let result = Writer::new(&"/tmp/test.csv.gz").delimiter(b',').write(df).is_ok(); // Gzip compression inferred.
assert_eq!(result, true);Implementations§
Source§impl Writer
impl Writer
Sourcepub fn new<S: AsRef<OsStr> + ToString>(path: &S) -> Self
pub fn new<S: AsRef<OsStr> + ToString>(path: &S) -> Self
Create a new instance of Reader with defaults CSV params
Sourcepub fn has_headers(self, yes: bool) -> Self
pub fn has_headers(self, yes: bool) -> Self
Whether to write headers in the file or not with the dataframe output.
Sourcepub fn delimiter(self, delimiter: u8) -> Self
pub fn delimiter(self, delimiter: u8) -> Self
Set the CSV delimiter, default is b',' (comma delimited)
Sourcepub fn terminator(self, terminator: u8) -> Self
pub fn terminator(self, terminator: u8) -> Self
Set the CSV line terminator, default treats any of \r, \n or \r\n as a line terminator
Sourcepub fn write<I: PartialEq + PartialOrd + BlackJackData>(
&self,
df: DataFrame<I>,
) -> Result<(), BlackJackError>
pub fn write<I: PartialEq + PartialOrd + BlackJackData>( &self, df: DataFrame<I>, ) -> Result<(), BlackJackError>
Write a dataframe to CSV, consumes self, and thus will not double memory whilst writing to CSV.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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