pub enum ToNumericErrors {
Raise,
Coerce,
Ignore,
}Expand description
Convert a Series to a numeric dtype.
Matches pd.to_numeric(series, errors='coerce'). Attempts to parse
each value as numeric. Non-parseable values become NaN.
Returns Int64 if all values are integers, Float64 otherwise.
errors= policy for to_numeric_with_options, matching the same-named
pd.to_numeric(errors=...) argument.
Variants§
Raise
Raise on the first value that cannot be parsed as a number. This is the
pandas default (and the bare to_numeric default), matching the
sibling ToTimedeltaErrors.
Coerce
Replace unparseable values with NaN (pandas errors='coerce').
Ignore
Leave the input unchanged when any value cannot be parsed (pandas
errors='ignore'; deprecated in pandas 2.x but still accepted).
Trait Implementations§
Source§impl Clone for ToNumericErrors
impl Clone for ToNumericErrors
Source§fn clone(&self) -> ToNumericErrors
fn clone(&self) -> ToNumericErrors
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ToNumericErrors
Source§impl Debug for ToNumericErrors
impl Debug for ToNumericErrors
Source§impl Default for ToNumericErrors
impl Default for ToNumericErrors
Source§fn default() -> ToNumericErrors
fn default() -> ToNumericErrors
Returns the “default value” for a type. Read more
impl Eq for ToNumericErrors
Source§impl PartialEq for ToNumericErrors
impl PartialEq for ToNumericErrors
impl StructuralPartialEq for ToNumericErrors
Auto Trait Implementations§
impl Freeze for ToNumericErrors
impl RefUnwindSafe for ToNumericErrors
impl Send for ToNumericErrors
impl Sync for ToNumericErrors
impl Unpin for ToNumericErrors
impl UnsafeUnpin for ToNumericErrors
impl UnwindSafe for ToNumericErrors
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.