pub enum ObjectValue {
List(Arc<[Scalar]>),
Bytes(Arc<[u8]>),
Host(HostValue),
}Expand description
A pandas object cell that is not one of Scalar’s value kinds: a list,
or a value of the host language (a Python datetime.date, dict, numpy
dtype) that the core carries without reading (fvsao.33).
Variants§
List(Arc<[Scalar]>)
A list of values, compared and printed as Python’s list.
Bytes(Arc<[u8]>)
A bytes value, compared and printed as Python’s bytes (b'ab'):
str.encode’s cells. The core reads it, so a bytes column needs no
host (4qg5w.8).
Host(HostValue)
A host-language value, opaque to the core.
Implementations§
Source§impl ObjectValue
impl ObjectValue
Sourcepub fn pprint(&self) -> String
pub fn pprint(&self) -> String
The cell as pandas displays it in a repr (pandas’ pprint_thing): a
list’s items unquoted ([1, a]), a host value as the host pprints it.
Sourcepub fn type_name(&self) -> String
pub fn type_name(&self) -> String
The cell’s Python type as Python’s errors name it (list, bytes,
datetime.date).
Sourcepub fn python_eq_scalar(&self, other: &Scalar) -> bool
pub fn python_eq_scalar(&self, other: &Scalar) -> bool
Python’s == between this cell and a plain value: a host value asks
the host (a dtype equals its name), a list or bytes never equals one
(b'a' == 'a' is False).
Sourcepub fn python_cmp(&self, other: &Self) -> Option<Ordering>
pub fn python_cmp(&self, other: &Self) -> Option<Ordering>
Python’s ordering of two cells, None where Python raises: host values by the host, lists item by item (a shorter prefix first), bytes by byte, and cells of different kinds unordered.
Trait Implementations§
Source§impl Clone for ObjectValue
impl Clone for ObjectValue
Source§impl Debug for ObjectValue
impl Debug for ObjectValue
Source§impl<'de> Deserialize<'de> for ObjectValue
impl<'de> Deserialize<'de> for ObjectValue
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl Display for ObjectValue
Python’s str of the cell - what astype(str) and the writers produce:
a list or bytes as its repr (['a', 1], b'ab'), a host value as its
str.
impl Display for ObjectValue
Python’s str of the cell - what astype(str) and the writers produce:
a list or bytes as its repr (['a', 1], b'ab'), a host value as its
str.
impl Eq for ObjectValue
So a cell can key a hash map (groupby, unique, isin): lists by their items’ reprs, host values by the host’s hash (their repr when the host has none).
Source§impl Hash for ObjectValue
impl Hash for ObjectValue
Source§impl Ord for ObjectValue
ObjectValue::total_cmp, so a cell can be an ordered label.
impl Ord for ObjectValue
ObjectValue::total_cmp, so a cell can be an ordered label.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ObjectValue
impl PartialEq for ObjectValue
Source§impl PartialOrd for ObjectValue
impl PartialOrd for ObjectValue
Source§impl Serialize for ObjectValue
A list cell serializes as the sequence of its items, a bytes cell as
{"bytes": [..]}; a host value has no serialized form.
impl Serialize for ObjectValue
A list cell serializes as the sequence of its items, a bytes cell as
{"bytes": [..]}; a host value has no serialized form.