pub struct ExcelReader { /* private fields */ }Expand description
An Excel file reader supporting .xlsx format.
Uses the calamine crate for parsing. Available when the format-excel
feature is enabled.
§Example
use plotlars_core::io::ExcelReader;
let df = ExcelReader::new("data/report.xlsx")
.sheet("Q1 Sales")
.finish()
.unwrap();Implementations§
Source§impl ExcelReader
impl ExcelReader
Sourcepub fn new(path: impl AsRef<Path>) -> ExcelReader
pub fn new(path: impl AsRef<Path>) -> ExcelReader
Create a new Excel reader for the given file path.
Sourcepub fn sheet(self, sheet: &str) -> ExcelReader
pub fn sheet(self, sheet: &str) -> ExcelReader
Select the sheet to read by name. Defaults to the first sheet.
Sourcepub fn has_header(self, has_header: bool) -> ExcelReader
pub fn has_header(self, has_header: bool) -> ExcelReader
Set whether the first row is a header row. Defaults to true.
Sourcepub fn skip_rows(self, skip_rows: usize) -> ExcelReader
pub fn skip_rows(self, skip_rows: usize) -> ExcelReader
Set the number of rows to skip before reading data.
Sourcepub fn finish(self) -> Result<DataFrame, PlotlarsError>
pub fn finish(self) -> Result<DataFrame, PlotlarsError>
Execute the read and return a DataFrame.
§Errors
Returns PlotlarsError::ExcelParse if the file cannot be read or parsed.
Trait Implementations§
Source§impl Clone for ExcelReader
impl Clone for ExcelReader
Source§fn clone(&self) -> ExcelReader
fn clone(&self) -> ExcelReader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExcelReader
impl RefUnwindSafe for ExcelReader
impl Send for ExcelReader
impl Sync for ExcelReader
impl Unpin for ExcelReader
impl UnsafeUnpin for ExcelReader
impl UnwindSafe for ExcelReader
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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> ⓘ
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