pub struct TimeSeriesCsv {
pub csv: CsvFile,
pub time_column: String,
}Expand description
A time-series CSV file: a CsvFile with an explicit time column.
The time column is identified by name (default "time").
Fields§
§csv: CsvFileUnderlying CSV data.
time_column: StringName of the time column.
Implementations§
Source§impl TimeSeriesCsv
impl TimeSeriesCsv
Sourcepub fn new(csv: CsvFile, time_column: &str) -> Self
pub fn new(csv: CsvFile, time_column: &str) -> Self
Wrap an existing CsvFile, treating column time_column as time.
Sourcepub fn from_str(s: &str, time_column: &str) -> Result<Self, String>
pub fn from_str(s: &str, time_column: &str) -> Result<Self, String>
Parse a CSV string and treat time_column as the time axis.
Sourcepub fn times(&self) -> Option<Vec<f64>>
pub fn times(&self) -> Option<Vec<f64>>
Extract the time column as Vecf64. Returns None` if the column
doesn’t exist or contains non-numeric values.
Auto Trait Implementations§
impl Freeze for TimeSeriesCsv
impl RefUnwindSafe for TimeSeriesCsv
impl Send for TimeSeriesCsv
impl Sync for TimeSeriesCsv
impl Unpin for TimeSeriesCsv
impl UnsafeUnpin for TimeSeriesCsv
impl UnwindSafe for TimeSeriesCsv
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.