pub struct ToDatetimeOptions<'a> {
pub format: Option<&'a str>,
pub unit: Option<&'a str>,
pub utc: bool,
pub origin: Option<ToDatetimeOrigin<'a>>,
pub infer_mixed_timezone: bool,
pub mixed_tz_as_object: bool,
pub errors: DatetimeErrors,
pub dayfirst: bool,
pub yearfirst: bool,
pub list_input: bool,
}Fields§
§format: Option<&'a str>§unit: Option<&'a str>§utc: bool§origin: Option<ToDatetimeOrigin<'a>>§infer_mixed_timezone: bool§mixed_tz_as_object: boolWhen a string column mixes tz-naive and tz-aware values, pandas
read_csv(parse_dates=...) cannot unify them into datetime64[ns] and
keeps the column as object (a Series of mixed Timestamp objects). With
this set, FrankenPandas reproduces that: instead of coercing to
Datetime64, each value is normalized to its pandas str(Timestamp) form
(naive YYYY-MM-DD HH:MM:SS, aware ... +HH:MM). Used by CSV
parse_dates (br-frankenpandas-unz0t); off for bare to_datetime.
errors: DatetimeErrorspandas’ errors=: a string that does not parse, or does not match
the column’s one inferred format, is NaT (Coerce, the default
here, which read_csv(parse_dates=) relies on) or pandas’ ValueError
(Raise, what pd.to_datetime defaults to).
dayfirst: boolpandas’ dayfirst=: a numeric date’s two short slots read day then
month (see guess_day_month_format).
yearfirst: boolpandas’ yearfirst=: dateutil reads an ambiguous all-numeric date
year first (see dateutil_date).
list_input: boolThe values came from a Python list, which pandas reads value by
value: an int past datetime64[ns] under unit is its “cannot
convert input …, at position n”; an array or a column overflows
as a whole, naming the instant (br-frankenpandas-39q44).
Trait Implementations§
Source§impl<'a> Clone for ToDatetimeOptions<'a>
impl<'a> Clone for ToDatetimeOptions<'a>
impl<'a> Copy for ToDatetimeOptions<'a>
Source§impl<'a> Debug for ToDatetimeOptions<'a>
impl<'a> Debug for ToDatetimeOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for ToDatetimeOptions<'a>
impl<'a> RefUnwindSafe for ToDatetimeOptions<'a>
impl<'a> Send for ToDatetimeOptions<'a>
impl<'a> Sync for ToDatetimeOptions<'a>
impl<'a> Unpin for ToDatetimeOptions<'a>
impl<'a> UnsafeUnpin for ToDatetimeOptions<'a>
impl<'a> UnwindSafe for ToDatetimeOptions<'a>
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
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> ⓘ
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> ⓘ
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