Warning

You are reading the documentation related to the development version. Go here if you are looking for the documentation of the stable release.

spectrochempy.round

round(dataset, decimals=0)[source]

Evenly round to the given number of decimals.

Parameters
  • dataset (NDDataset) – Input dataset.

  • decimals (int, optional) – Number of decimal places to round to (default: 0). If decimals is negative, it specifies the number of positions to the left of the decimal point.

Returns

rounded_array – NDDataset containing the rounded values. The real and imaginary parts of complex numbers are rounded separately. The result of rounding a float is a float. If the dataset contains masked data, the mask remain unchanged.

See also

numpy.round, around, spectrochempy.round, spectrochempy.around, methods., ceil, fix, floor, rint, trunc