data_sort#

data_sort(series, xdata, ydata, sigma=None, shots=None)[source]#

Sort data.

Input x values may not be lined up in order, since experiment may accept user input array, or data may be concatenated with previous scan. This sometimes confuses the algorithmic generation of initial guesses especially when guess depends on derivative.

This returns data set that is sorted by xdata and series in ascending order.

Deprecated since version 0.6_pending: The function qiskit_experiments.curve_analysis.utils.data_sort() is pending deprecation as of qiskit-experiments 0.6. It will be marked deprecated in a future release, and then removed no earlier than 3 months after the release date. The curve data representation has been replaced by the DataFrame format.

Parameters:
  • series (ndarray) – Series index.

  • xdata (ndarray) – 1D or 2D array of xdata.

  • ydata (ndarray) – Array of ydata.

  • sigma (ndarray | None) – Optional, array of standard deviations in ydata.

  • shots (ndarray | None) – Optional, array of shots used to get a data point.

Returns:

Tuple of (series, xdata, ydata, sigma, shots) sorted in ascending order of xdata and series.

Return type:

Tuple[ndarray, ndarray, ndarray, ndarray, ndarray]