Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

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.

Parameters:
  • series (ndarray) – Series index.

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

  • ydata (ndarray) – Array of ydata.

  • sigma (Optional[ndarray]) – Optional, array of standard deviations in ydata.

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

Return type:

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

Returns:

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