pygsti.data.freedataset.FreeformDataSet#
- class FreeformDataSet(circuits=None, circuit_indices=None)#
Bases:
objectAn association between Circuits and arbitrary data.
- Parameters:
circuits (list of (tuples or Circuits), optional) – Each element is a tuple of operation labels or a Circuit object. Indices for these strings are assumed to ascend from 0. These indices must correspond to the time series of spam-label indices (above). Only specify this argument OR circuit_indices, not both.
circuit_indices (ordered dictionary, optional) – An OrderedDict with keys equal to circuits (tuples of operation labels) and values equal to integer indices associating a row/element of counts with the circuit. Only specify this argument OR circuits, not both.
Methods
__init__([circuits, circuit_indices])copy()Make a copy of this FreeformDataSet.
items()Iterator over (circuit, info_dict) pairs.
keys()Returns the circuits used as keys of this DataSet.
to_dataframe([pivot_valuename, pivot_value, ...])Create a Pandas dataframe with the data from this free-form dataset.
values()Iterator over info-dicts for each circuit.
- items()#
Iterator over (circuit, info_dict) pairs.
- Return type:
Iterator
- keys()#
Returns the circuits used as keys of this DataSet.
- Returns:
A list of Circuit objects which index the data counts within this data set.
- Return type:
list
- to_dataframe(pivot_valuename=None, pivot_value='Value', drop_columns=False)#
Create a Pandas dataframe with the data from this free-form dataset.
- Parameters:
pivot_valuename (str, optional) – If not None, the resulting dataframe is pivoted using pivot_valuename as the column whose values name the pivoted table’s column names. If None and pivot_value is not None,`”ValueName”` is used.
pivot_value (str, optional) – If not None, the resulting dataframe is pivoted such that values of the pivot_value column are rearranged into new columns whose names are given by the values of the pivot_valuename column. If None and pivot_valuename is not None,`”Value”` is used.
drop_columns (bool or list, optional) – A list of column names to drop (prior to performing any pivot). If True appears in this list or is given directly, then all constant-valued columns are dropped as well. No columns are dropped when drop_columns == False.
- Return type:
pandas.DataFrame
- values()#
Iterator over info-dicts for each circuit.
- Return type:
Iterator