Skip to content

Commit

Permalink
WIP table doc
Browse files Browse the repository at this point in the history
  • Loading branch information
nkanazawa1989 committed Sep 12, 2023
1 parent 4de80e5 commit d64f461
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion qiskit_experiments/curve_analysis/scatter_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,24 @@


class ScatterTable(pd.DataFrame, DefaultColumnsMixIn):
"""A table to store x and y data with metadata associated with the data point."""
"""A table to store x and y data with metadata associated with the data point.
This class is implemented upon the pandas dataframe.
See `pandas dataframe documentation <https://pandas.pydata.org/docs/index.html>`_
for the base class API documentation.
A single ``ScatterTable`` object can contain different kind of intermediate data
generated through the curve fitting, which are categorized by the fit model.
When an experiment has sub-data for ``model_abc``, the formatted x, y, and y-error
array data may be obtained from the original table object as follows:
.. code-block::python
formatted = table.filter(like="formatted", axis="index")
abc_data = formatted[formatted.model_name == "model_abc"]
x, y, e = abc_data.xval.to_numpy(), abc_data.yval.to_numpy(), abc_data.yerr.to_numpy()
"""

@classmethod
def _default_columns(cls) -> List[str]:
Expand Down

0 comments on commit d64f461

Please sign in to comment.