uproot.STLMap — Uproot documentation

# uproot.STLMap

Defined in uproot.containers on line 1488.

Inheritance order:
uproot.containers.Container `collections.abc.Mapping` `collections.abc.Collection` `collections.abc.Sized` `collections.abc.Iterable` `collections.abc.Container`

class uproot.containers.STLMap(keys, values)
  Parameters:

    - keys (`numpy.ndarray` or iterable) – Keys of the `std::map`.

    - values (`numpy.ndarray` or iterable) – Values of the `std::map`.

  Representation of a C++ `std::map` as a Python `Mapping`.

  The `keys` and `values` must have the same length.

## from_mapping

classmethod STLMap.from_mapping(mapping)

  Construct a uproot.STLMap from a Python object with `keys()` and `values()`.

## keys

STLMap.keys()

  Keys of the `std::map` as a `numpy.ndarray`.

## values

STLMap.values()

  Values of the `std::map` as a `numpy.ndarray`.

## items

STLMap.items()

  Key, value pairs of the `std::map` as a `numpy.ndarray`.

## get

STLMap.get(where, default=None)

  Get with a default, like dict.get.

## tolist

Inherited from uproot.containers.Container.

STLMap.tolist()

  Convert the data this collection contains into nested lists, sets, and dicts.