Skip to main content

ToDatetimeOptions

Struct ToDatetimeOptions 

Source
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,
}

Fields§

§format: Option<&'a str>§unit: Option<&'a str>§utc: bool§origin: Option<ToDatetimeOrigin<'a>>§infer_mixed_timezone: bool§mixed_tz_as_object: bool

When 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: DatetimeErrors

pandas’ 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: bool

pandas’ dayfirst=: a numeric date’s two short slots read day then month (see guess_day_month_format).

§yearfirst: bool

pandas’ yearfirst=: dateutil reads an ambiguous all-numeric date year first (see dateutil_date).

Trait Implementations§

Source§

impl<'a> Clone for ToDatetimeOptions<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for ToDatetimeOptions<'a>

Source§

impl<'a> Debug for ToDatetimeOptions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ToDatetimeOptions<'_>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.