pygsti.tools.typeddict

The TypedDict class

Module Contents

Classes

TypedDict

A dictionary that holds per-key type information.

Functions

_columndict_to_dataframe(columns, seriestypes)

pygsti.tools.typeddict._columndict_to_dataframe(columns, seriestypes)
class pygsti.tools.typeddict.TypedDict(types=None, items=())

Bases: dict

A dictionary that holds per-key type information.

This type of dict is used for the “leaves” in a tree of nested NamedDict objects, specifying a collection of data of different types pertaining to some set of category labels (the index-path of the named dictionaries).

When converted to a data frame, each key specifies a different column and values contribute the values of a single data frame row. Columns will be series of the held data types.

Parameters
  • types (dict, optional) – Keys are the keys that can appear in this dictionary, and values are valid data frame type strings, e.g. “int”, “float”, or “category”, that specify the type of each value.

  • items (dict or list) – Initial data, used for serialization.

__reduce__(self)

Helper for pickle.

as_dataframe(self)

Render this dict as a pandas data frame.

Returns

pandas.DataFrame

_add_to_columns(self, columns, seriestypes, row_prefix)