Free functions

General

bin(x, *[, edges, groups, erase])

Create binned data by binning input along all dimensions given by edges.

bins(*, data, dim[, begin, end])

Create a binned variable from bin indices.

bins_like(x, fill_value)

Create a binned variable by "broadcasting" fill values to bins of given sizes.

choose(key, choices, dim)

Choose slices of choices base on coord values.

collapse(scipp_obj, keep)

Slice down the input object until only the supplied keep dimension is left (effectively 'collapsing' all but one dimension), and return a dict of 1D slices.

histogram(x, *, bins)

Create dense data by histogramming data along all dimension given by edges.

logical_and(*args, **kwargs)

Overloaded function.

logical_or(*args, **kwargs)

Overloaded function.

logical_xor(*args, **kwargs)

Overloaded function.

lookup(func, dim)

Create a "lookup table" from a histogram (data array with bin-edge coord).

merge(lhs, rhs)

Merge two datasets into one.

rebin(x, dim, bins)

Rebin a dimension of a data array or dataset.

reduce(x)

Create helper object for reduction operations over list or tuple of inputs.

slices(scipp_obj, dim)

Slice input along given dim, and return all the slices in a dict.

sort(x, key[, order])

Sort variable along a dimension by a sort key or dimension label

stddevs(x)

Return object containing the stddevs of the input as values.

to_unit(x, unit, *[, copy])

Convert the variable to a different unit.

transform_coords(x, targets, graph, *[, ...])

Compute new coords based on transformations of input coords.

values(x)

Return the object without variances.

variances(x)

Return object containing the variances of the input as values.

where(condition, x, y)

Return elements chosen from x or y depending on condition.

Math

abs(x, *[, out])

Element-wise absolute value.

add(a, b)

Element-wise addition.

ceil(x, *[, out])

Round up to the nearest integer of all values passed in x.

cross(x, y)

Element-wise cross product.

divide(dividend, divisor)

Element-wise true division.

dot(x, y)

Element-wise dot product.

erf(x)

Computes the error function.

erfc(x)

Computes the complementary error function.

exp(x, *[, out])

Element-wise exponential.

floor(x, *[, out])

Round down to the nearest integer of all values passed in x.

floor_divide(dividend, divisor)

Element-wise floor division.

log(x, *[, out])

Element-wise natural logarithm.

log10(x, *[, out])

Element-wise base 10 logarithm.

mod(dividend, divisor)

Element-wise remainder.

multiply(a, b)

Element-wise product.

norm(x)

Element-wise norm.

reciprocal(x, *[, out])

Element-wise reciprocal.

round(x, *[, out])

Round to the nearest integer if all values passed in x.

sqrt(x, *[, out])

Element-wise square-root.

subtract(minuend, subtrahend)

Element-wise difference.

Shape

broadcast(x, dims, shape)

Broadcast a variable.

concat(x, dim)

Concatenate input arrays along the given dimension.

concatenate(x, y, dim)

Concatenate input arrays along the given dimension.

flatten(x[, dims, to])

Flatten multiple dimensions of a variable or data array into a single dimension.

fold(x, dim[, sizes, dims, shape])

Fold a single dimension of a variable or data array into multiple dims.

transpose(x[, dims])

Transpose dimensions of a variable, an data array, or a dataset.

Comparison

Comparison operators compare element-wise and ignore variances.

allclose(x, y[, rtol, atol, equal_nan])

Verifies that ALL element-wise comparisons meet the condition:

allsorted(x, dim[, order])

Check if the values of a variable are sorted.

equal(x, y)

Element-wise '==' (equal).

greater(x, y)

Element-wise '>' (greater).

greater_equal(x, y)

Element-wise '>=' (greater_equal).

identical(x, y)

Full comparison of x and y.

isclose(x, y, *[, rtol, atol, equal_nan])

Compares values (x, y) element by element against absolute and relative tolerances (non-symmetric).

islinspace(x[, dim])

Check if the values of a variable are evenly spaced.

issorted(x, dim[, order])

Check if the values of a variable are sorted.

less(x, y)

Element-wise '<' (less).

less_equal(x, y)

Element-wise '<=' (less_equal).

not_equal(x, y)

Element-wise '!=' (not_equal).

inf and nan handling

Special-value (inf and nan) checks. inf and nan in the variances is ignored.

isnan(x)

Element-wise isnan (true if an element is nan).

isinf(x)

Element-wise isinf (true if an element is inf).

isfinite(x)

Element-wise isfinite (true if an element is finite).

isposinf(x)

Element-wise isposinf (true if an element is a positive infinity).

isneginf(x)

Element-wise isneginf (true if an element is a negative infinity).

nan_to_num(x, *[, nan, posinf, neginf, out])

Element-wise special value replacement.

Reduction

Reduction operations are operations to remove one or more dimension, e.g., by performing a sum over all elements along a dimension.

all(x[, dim, out])

Element-wise AND over the specified dimension or all dimensions if not provided.

any(x[, dim, out])

Element-wise OR over the specified dimension or all dimensions if not provided.

cumsum(a[, dim, mode])

Return the cumulative sum along the specified dimension.

max(x[, dim, out])

Element-wise max over the specified dimension or all dimensions if not provided.

mean(x[, dim, out])

Element-wise mean over the specified dimension.

min(x[, dim, out])

Element-wise min over the specified dimension or all dimensions if not provided.

nanmax(x[, dim, out])

Element-wise max ignoring not a number values over the specified dimension or all dimensions if not provided.

nanmean(x[, dim, out])

Element-wise mean over the specified dimension ignoring NaNs.

nanmin(x[, dim, out])

Element-wise min ignoring not at number values over the specified dimension or all dimensions if not provided.

nansum(x[, dim, out])

Element-wise sum over the specified dimension; NaNs ignored.

sum(x[, dim, out])

Element-wise sum over the specified dimension.

Trigonometric

sin(x, *[, out])

Element-wise sine.

cos(x, *[, out])

Element-wise cosine.

tan(x, *[, out])

Element-wise tangent.

asin(x, *[, out])

Element-wise inverse sine.

acos(x, *[, out])

Element-wise inverse cosine.

atan(x, *[, out])

Element-wise inverse tangent.

atan2(*, y, x[, out])

Element-wise inverse tangent of y/x determining the correct quadrant.

Geometric

geometry.position(x, y, z)

Element-wise zip functionality to produce a 3 element vector.

geometry.rotation_matrix_from_quaternion_coeffs(value)

Construct a rotation matrix from quaternions.

Group-by (split-apply-combine)

Reduction

groupby(data, group, *[, bins])

Group dataset or data array based on values of specified labels.

Counts

“Counts” refers to the default unit of data after histogramming. It is also known as frequency. This can be converted into a counts (frequency) density, e.g., for visualization purposes.

counts_to_density(x, dim)

Converts counts to count density on a given dimension.

density_to_counts(x, dim)

Converts counts to count density on a given dimension.

Visualization

show(container)

Show a graphical representation of a variable or dataset.

show_graph(graph[, size, simplified])

Show graphical representation of a graph as required by transform_coords()

table(scipp_obj)

Create a html table from the contents of a Dataset (0D and 1D Variables only), DataArray, Variable or raw numpy array.

to_html(container)

plot(*args, **kwargs)

Plot a Scipp object.

Compatibility

to_dict(scipp_obj)

Convert a scipp object (Variable, DataArray or Dataset) to a python dict.

from_dict(dict_obj)

Convert a python dict to a scipp Variable, DataArray or Dataset.

compat.from_pandas(pd_obj)

Converts a pandas.DataFrame or pandas.Series object into a scipp Dataset or DataArray respectively.

compat.from_xarray(obj)

Convenience method to convert an xarray object into the corresponding scipp object.

Logging

get_logger()

Return the global logger used by scipp.

display_logs()

Display the log widget associated with the global scipp logger.