Detail: Series: Accessor Mapping#

Overview: Series: Accessor Mapping

Series.via_mapping.__getitem__(key)
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.__getitem__(key)[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s.via_mapping['c']
8
Series.via_mapping.__iter__
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.__iter__()[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> tuple(s.via_mapping)
(np.str_('a'), np.str_('b'), np.str_('c'))
Series.via_mapping.__len__
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.__len__()[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> len(s.via_mapping)
3
Series.via_mapping.__contains__(key, /)
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.__contains__(key, /)[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> 'c' in s.via_mapping
True
Series.via_mapping.__repr__
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.__repr__()[source]

Return repr(self).

>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> s.via_mapping
SeriesMapping({a: 10, b: 2, c: 8})
Series.via_mapping.keys
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.keys() a set-like object providing a view on D's keys[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> tuple(s.via_mapping.keys())
(np.str_('a'), np.str_('b'), np.str_('c'))
Series.via_mapping.values
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.values() an object providing a view on D's values[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> tuple(s.via_mapping.values())
(np.int64(10), np.int64(2), np.int64(8))
Series.via_mapping.items
Series.via_mapping

Return a wrapper around Series data that fully implements the Python Mapping interface.

SeriesMapping.items() a set-like object providing a view on D's items[source]
>>> s = sf.Series((10, 2, 8), index=('a', 'b', 'c'))
>>> tuple(s.via_mapping.items())
((np.str_('a'), np.int64(10)), (np.str_('b'), np.int64(2)), (np.str_('c'), np.int64(8)))

Series: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Assignment | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Fill Value | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic | Accessor Mapping