What’s new in Scipp
Contents
What’s new in Scipp#
This page highlights feature additions and discusses major changes from recent releases. For a full list of changes see the Release Notes.
[1]:
import numpy as np
import scipp as sc
General#
String formatting#
New in 0.15
Added support for compact formatting of 0-D variables.
Example:
[2]:
var = sc.scalar(12.5, variance=4.0, unit='mm')
print(f'{var}')
print(f'{var:c}')
<scipp.Variable> () float64 [mm] [12.5] [4]
12(2) mm
Implicit conversion to boolean#
New in 0.15
Added support for implicit conversion of 0-D variables to bool.
Examples:
[3]:
if sc.scalar(1, unit='m') < sc.scalar(2, unit='m'):
print('ok')
var = sc.array(values=[1, 2, 3, 4, 5], dims=['x'], unit='m')
if sc.any(var == sc.scalar(3, unit='m')):
print('ok')
ok
ok
Keyword-argument syntax for rename_dims
#
New in 0.15
Added support for keyword arguments in rename_dims
to define dimensions, as also supported by rename
.
Example:
[4]:
var = sc.ones(dims=['x', 'y'], shape=(4, 3))
var.rename_dims(x='xnew', y='ynew')
[4]:
- (xnew: 4, ynew: 3)float64𝟙1.0, 1.0, ..., 1.0, 1.0
Values:
array([[1., 1., 1.], [1., 1., 1.], [1., 1., 1.], [1., 1., 1.]])
Units#
Support for unit=None
#
New in 0.12
Previously Scipp used unit=sc.units.dimensionless
(or the alias unit=sc.units.one
) for anything that does not have a unit, such as strings, booleans, or bins. To allow for distinction of actual physically dimensionless quantities from these cases, Scipp now supports variables and, by extension, data arrays that have their unit set to None
.
This change is accompanied by a number of related changes:
Creation function use a default unit if not given explicitly. The default for numbers (floating point or integer) is
sc.units.dimensionless
. The default for everything else, includingbool
isNone
.Comparison operations, which return variables with
dtype=bool
, haveunit=None
.A new function
index
was added, to allow for creation of 0-D variable withunit=None
. This complementsscalar
, which uses the default unit (depending on thedtype
).
Examples:
[5]:
print(sc.array(dims=['x'], values=[1.1, 2.2, 3.3]))
print(sc.array(dims=['x'], values=[1, 2, 3]))
print(sc.array(dims=['x'], values=[False, True, False]))
print(sc.array(dims=['x'], values=['a', 'b', 'c']))
<scipp.Variable> (x: 3) float64 [dimensionless] [1.1, 2.2, 3.3]
<scipp.Variable> (x: 3) int64 [dimensionless] [1, 2, 3]
<scipp.Variable> (x: 3) bool <no unit> [False, True, False]
<scipp.Variable> (x: 3) string <no unit> ["a", "b", "c"]
[6]:
a = sc.array(dims=['x'], values=[1, 2, 3])
b = sc.array(dims=['x'], values=[1, 3, 3])
print(a == b)
print(a < b)
<scipp.Variable> (x: 3) bool <no unit> [True, False, True]
<scipp.Variable> (x: 3) bool <no unit> [False, True, False]
[7]:
(a == b).unit is None
[7]:
True
For some purposes we may use a coordinate with unique integer-valued identifiers. Since the identifiers to not have a physical meaning, we use unit=None
. Note that this has to be given explicitly since otherwise integers are treated as numbers, i.e., the unit would be dimensionless:
[8]:
da = sc.DataArray(
a, coords={'id': sc.array(dims=['x'], unit=None, values=[34, 21, 14])}
)
da
[8]:
- x: 3
- id(x)int6434, 21, 14
Values:
array([34, 21, 14])
- (x)int64𝟙1, 2, 3
Values:
array([1, 2, 3])
The index
function can now be used to conveniently lookup data by its identifier:
[9]:
da['id', sc.index(21)]
[9]:
- ()int64𝟙2
Values:
array(2)
- id()int6421
Values:
array(21)
Reduced effect of rounding errors when converting units#
New in 0.14
sc.to_unit
(and therefore also the to()
method) now avoid rounding errors when converting from a large unit to a small unit, if the conversion factor is integral.
Example:
[10]:
sc.scalar(1.0, unit='m').to(unit='nm')
[10]:
- ()float64nm1000000000.0
Values:
array(1.e+09)
Support for unit aliases#
New in 0.17
Added support to customize string formatting for specific units and support user defined units. See the Unit Aliases documentation for details.
Checking if coordinates are bin-edges#
New in 0.13
The coords
property (and also the attrs
, meta
, and masks
properties) now provide the is_edges
method to check if an entry is a bin-edge coordinate.
Example:
[11]:
import scipp as sc
x = sc.arange('x', 3)
da = sc.DataArray(x, coords={'x1': x, 'x2': sc.arange('x', 4)})
print(f"{da.coords.is_edges('x1') = }")
print(f"{da.coords.is_edges('x2') = }")
da.coords.is_edges('x1') = False
da.coords.is_edges('x2') = True
Coordinate transformations#
New in 0.15
Several improvements for transform_coords
:
Support a keyword-syntax for defining single-step transformations.
Now works with
lookup
(see below).Now works with callables other than functions, such as the output of
partial
(not with keyword arguments) or instances of classes defining__call__
.
Examples:
[12]:
da = sc.data.table_xyz(nrow=10)
da.transform_coords(xy=lambda x, y: x * y)
[12]:
- row: 10
- xy(row)float64m^20.431, 0.232, ..., 0.166, 0.229
Values:
array([0.43073058, 0.23187028, 0.79733511, 0.22603884, 0.21535264, 0.07792538, 0.17788141, 0.0709546 , 0.16588544, 0.22948474]) - z(row)float64m0.060, 0.684, ..., 0.003, 0.251
Values:
array([0.06013866, 0.68368891, 0.67123802, 0.61101798, 0.06013731, 0.97776927, 0.43895163, 0.53259502, 0.00313229, 0.25126711])
- (row)float64K1.086, 1.043, ..., 1.009, 1.047
Values:
array([1.08584904, 1.04252984, 1.0735819 , 1.09220432, 1.01534742, 1.09922592, 1.01823318, 1.09401129, 1.00868831, 1.04682107])
- x(row)float64m0.977, 0.380, ..., 0.964, 0.264
Values:
array([0.97669977, 0.38019574, 0.92324623, 0.26169242, 0.31909706, 0.11809123, 0.24176629, 0.31853393, 0.96407925, 0.2636498 ]) - y(row)float64m0.441, 0.610, ..., 0.172, 0.870
Values:
array([0.44100612, 0.60987081, 0.8636213 , 0.86375767, 0.67488131, 0.65987435, 0.7357577 , 0.22275366, 0.17206618, 0.87041497])
[13]:
from functools import partial
def linear(a, b, x):
return a * x + b
func = partial(linear, 0.5, sc.scalar(10.0, unit='m'))
da.transform_coords(fx=func)
[13]:
- row: 10
- fx(row)float64m10.488, 10.190, ..., 10.482, 10.132
Values:
array([10.48834988, 10.19009787, 10.46162312, 10.13084621, 10.15954853, 10.05904562, 10.12088315, 10.15926696, 10.48203962, 10.1318249 ]) - y(row)float64m0.441, 0.610, ..., 0.172, 0.870
Values:
array([0.44100612, 0.60987081, 0.8636213 , 0.86375767, 0.67488131, 0.65987435, 0.7357577 , 0.22275366, 0.17206618, 0.87041497]) - z(row)float64m0.060, 0.684, ..., 0.003, 0.251
Values:
array([0.06013866, 0.68368891, 0.67123802, 0.61101798, 0.06013731, 0.97776927, 0.43895163, 0.53259502, 0.00313229, 0.25126711])
- (row)float64K1.086, 1.043, ..., 1.009, 1.047
Values:
array([1.08584904, 1.04252984, 1.0735819 , 1.09220432, 1.01534742, 1.09922592, 1.01823318, 1.09401129, 1.00868831, 1.04682107])
- x(row)float64m0.977, 0.380, ..., 0.964, 0.264
Values:
array([0.97669977, 0.38019574, 0.92324623, 0.26169242, 0.31909706, 0.11809123, 0.24176629, 0.31853393, 0.96407925, 0.2636498 ])
Operations#
Creation functions#
New in 0.16
arange
now supports creation from datetime strings, provided that an explicit dtype='datetime64'
is given.
Example:
[14]:
step = sc.scalar(10, unit='s')
sc.arange('time', '2022-01-11T10:24:00', '2022-01-11T10:25:00', step=step, dtype='datetime64')
[14]:
- (time: 6)datetime64s2022-01-11T10:24:00, 2022-01-11T10:24:10, ..., 2022-01-11T10:24:40, 2022-01-11T10:24:50
Values:
array(['2022-01-11T10:24:00', '2022-01-11T10:24:10', '2022-01-11T10:24:20', '2022-01-11T10:24:30', '2022-01-11T10:24:40', '2022-01-11T10:24:50'], dtype='datetime64[s]')
New in 0.11
Creation functions for datetimes where added:
Added
epoch
,datetime
anddatetimes
.
[15]:
sc.datetime('now', unit='ms')
[15]:
- ()datetime64ms2022-11-28T05:31:35.000
Values:
array('2022-11-28T05:31:35.000', dtype='datetime64[ms]')
[16]:
times = sc.datetimes(
dims=['time'], values=['2022-01-11T10:24:03', '2022-01-11T10:24:03']
)
times
[16]:
- (time: 2)datetime64s2022-01-11T10:24:03, 2022-01-11T10:24:03
Values:
array(['2022-01-11T10:24:03', '2022-01-11T10:24:03'], dtype='datetime64[s]')
The new epoch
function is useful for obtaining the time since epoch, i.e., a time difference (dtype='int64'
) instead of a time point (dtype='datetime64'
):
[17]:
times - sc.epoch(unit=times.unit)
[17]:
- (time: 2)int64s1641896643, 1641896643
Values:
array([1641896643, 1641896643])
New in 0.12
zeros_like
, ones_like
, empty_like
, and full_like
can now be used with data arrays.
Example:
[18]:
x = sc.linspace('x', 0.0, 1.0, num=5)
da = sc.DataArray(sc.ones(dims=['x', 'y'], shape=[4, 6], unit='K'), coords={'x': x})
sc.zeros_like(da)
[18]:
- x: 4
- y: 6
- x(x [bin-edge])float64𝟙0.0, 0.25, 0.5, 0.75, 1.0
Values:
array([0. , 0.25, 0.5 , 0.75, 1. ])
- (x, y)float64K0.0, 0.0, ..., 0.0, 0.0
Values:
array([[0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0.], [0., 0., 0., 0., 0., 0.]])
Utility methods and functions#
New in 0.12
Added
squeeze
method to remove length-1 dimensions from objects.Added
rename
method to rename dimensions and associated dimension-coordinates (or attributes). This complementsrename_dims
, which only changes dimension labels but does not rename coordinates.Added
midpoints
to compute bin-centers.
Example:
[19]:
x = sc.linspace('x', 0.0, 1.0, num=5)
da = sc.DataArray(sc.ones(dims=['x', 'y'], shape=[4, 6], unit='K'), coords={'x': x})
A length-1 x-dimension…
[20]:
da['x', 0:1]
[20]:
- x: 1
- y: 6
- x(x [bin-edge])float64𝟙0.0, 0.25
Values:
array([0. , 0.25])
- (x, y)float64K1.0, 1.0, ..., 1.0, 1.0
Values:
array([[1., 1., 1., 1., 1., 1.]])
… can be removed with squeeze
:
[21]:
da['x', 0:1].squeeze()
[21]:
- y: 6
- (y)float64K1.0, 1.0, ..., 1.0, 1.0
Values:
array([1., 1., 1., 1., 1., 1.])
- x(x)float64𝟙0.0, 0.25
Values:
array([0. , 0.25])
squeeze
returns a new object and leaves the original unchanged.
Renaming is most convenient using keyword arguments:
[22]:
da.rename(x='xnew')
[22]:
- xnew: 4
- y: 6
- xnew(xnew [bin-edge])float64𝟙0.0, 0.25, 0.5, 0.75, 1.0
Values:
array([0. , 0.25, 0.5 , 0.75, 1. ])
- (xnew, y)float64K1.0, 1.0, ..., 1.0, 1.0
Values:
array([[1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1.]])
rename
returns a new object and leaves the original unchanged.
midpoints
can be used to replace a bin-edge coordinate by bin centers:
[23]:
da.coords['x'] = sc.midpoints(da.coords['x'])
da
[23]:
- x: 4
- y: 6
- x(x)float64𝟙0.125, 0.375, 0.625, 0.875
Values:
array([0.125, 0.375, 0.625, 0.875])
- (x, y)float64K1.0, 1.0, ..., 1.0, 1.0
Values:
array([[1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1.], [1., 1., 1., 1., 1., 1.]])
Binning and histogramming operations#
Reworked API for better user experience#
New in 0.15
Simpler interface for binning and histogramming operations:
sc.bin
moved tosc.binning.make_binned
.Most users should use
sc.bin
orsc.group
(see below for new interface).
sc.histogram
moved tosc.binning.make_histogrammed
.Most users should use
sc.hist
(see below for new interface).
bin
,group
,hist
, andrebin
are now available as methods (in addition to free functions).bin
andhist
can be provided with one of:Bin count.
Bin size.
Bin edges.
Examples, given a table:
[24]:
table = sc.data.table_xyz(nrow=100)
table.coords['label'] = (table.coords['x'] * 10).to(dtype='int32')
table
[24]:
- row: 100
- label(row)int32m9, 3, ..., 9, 0
Values:
array([9, 3, 9, 2, 3, 1, 2, 3, 9, 2, 4, 6, 8, 8, 6, 6, 7, 2, 1, 8, 0, 6, 6, 6, 0, 9, 4, 5, 0, 2, 8, 4, 7, 9, 1, 9, 1, 9, 0, 4, 8, 2, 8, 9, 8, 4, 3, 4, 0, 2, 5, 7, 4, 3, 9, 7, 4, 4, 7, 8, 2, 7, 8, 8, 0, 5, 6, 2, 4, 5, 9, 0, 2, 2, 3, 0, 3, 1, 8, 6, 0, 2, 6, 1, 9, 1, 7, 4, 3, 2, 8, 3, 0, 0, 4, 8, 3, 8, 9, 0], dtype=int32) - x(row)float64m0.977, 0.380, ..., 0.947, 0.067
Values:
array([0.97669977, 0.38019574, 0.92324623, 0.26169242, 0.31909706, 0.11809123, 0.24176629, 0.31853393, 0.96407925, 0.2636498 , 0.44100612, 0.60987081, 0.8636213 , 0.86375767, 0.67488131, 0.65987435, 0.7357577 , 0.22275366, 0.17206618, 0.87041497, 0.06013866, 0.68368891, 0.67123802, 0.61101798, 0.06013731, 0.97776927, 0.43895163, 0.53259502, 0.00313229, 0.25126711, 0.85849044, 0.42529835, 0.73581899, 0.92204322, 0.15347417, 0.99225923, 0.18233178, 0.9401129 , 0.08688306, 0.46821072, 0.8289892 , 0.28105226, 0.86909151, 0.97641657, 0.84171366, 0.4488736 , 0.37050843, 0.48266944, 0.09218155, 0.22668311, 0.53656624, 0.73323165, 0.44891079, 0.30550077, 0.9473596 , 0.75103384, 0.47204846, 0.45727588, 0.7463378 , 0.85539988, 0.29350156, 0.7333145 , 0.8088307 , 0.88708697, 0.02483321, 0.51254945, 0.61278568, 0.28034895, 0.45213173, 0.53122109, 0.98863456, 0.00597817, 0.20128829, 0.2568758 , 0.34074484, 0.05300196, 0.3264945 , 0.19835821, 0.82921491, 0.63712163, 0.08544074, 0.22016044, 0.68117601, 0.13441009, 0.95651369, 0.13652398, 0.79770214, 0.49829352, 0.30470773, 0.23420605, 0.89300817, 0.3775365 , 0.07634545, 0.03380685, 0.46161332, 0.87382396, 0.35060949, 0.82352055, 0.94719907, 0.06704071]) - y(row)float64m0.298, 0.619, ..., 0.942, 0.266
Values:
array([0.29784009, 0.61916102, 0.30175743, 0.17484645, 0.4955052 , 0.7605704 , 0.68726158, 0.24815478, 0.62204659, 0.31565569, 0.27721642, 0.92986521, 0.27959527, 0.94883502, 0.20201735, 0.56547841, 0.38030313, 0.80810673, 0.12755367, 0.95133955, 0.72882736, 0.175545 , 0.69275909, 0.09283302, 0.55640157, 0.10249413, 0.04369324, 0.39269051, 0.69105406, 0.72697743, 0.6690316 , 0.59155473, 0.87900055, 0.53765765, 0.0978224 , 0.14129582, 0.96228009, 0.7981039 , 0.00675377, 0.94581154, 0.65542259, 0.91068457, 0.15258466, 0.58863232, 0.5037656 , 0.17380898, 0.0628503 , 0.66454833, 0.03190526, 0.2381556 , 0.51542965, 0.60235782, 0.28295953, 0.84313 , 0.89470557, 0.72319123, 0.92654142, 0.05899723, 0.05014746, 0.12388012, 0.12208044, 0.53115015, 0.91313804, 0.18246727, 0.99149871, 0.87990489, 0.32295563, 0.19131571, 0.49686643, 0.31440532, 0.03030466, 0.09262352, 0.58902035, 0.63403838, 0.96634448, 0.01487968, 0.73315998, 0.63286286, 0.50168492, 0.12093655, 0.85794039, 0.70241087, 0.56861403, 0.98109921, 0.0903527 , 0.72707977, 0.4886337 , 0.28049914, 0.88533027, 0.80772818, 0.43944917, 0.64164812, 0.63103906, 0.00843672, 0.22165835, 0.21689278, 0.22026903, 0.74113721, 0.94155401, 0.2664373 ]) - z(row)float64m0.747, 0.002, ..., 0.314, 0.264
Values:
array([7.47273308e-01, 2.07107674e-03, 8.09356321e-01, 8.06808892e-01, 5.45326666e-02, 9.89362828e-02, 5.53226569e-01, 7.62910553e-01, 7.30931237e-01, 6.82471044e-01, 7.62591309e-01, 5.99412526e-01, 2.35477373e-01, 2.80612918e-02, 9.11675838e-01, 4.14080600e-01, 7.23464080e-01, 2.65950874e-01, 9.80369577e-01, 1.78090002e-01, 4.69184186e-02, 4.94115808e-01, 3.70529117e-01, 6.55574256e-01, 4.61285877e-05, 1.43014725e-01, 8.58975880e-01, 6.82809970e-01, 3.32033306e-01, 2.48161990e-02, 4.22029167e-02, 3.89582513e-01, 9.43011313e-01, 9.18612070e-01, 3.14726967e-01, 3.72220959e-01, 2.66749743e-01, 1.41873954e-01, 5.91518522e-01, 4.63079614e-01, 8.35330328e-01, 4.95433949e-01, 1.77145233e-02, 4.37894709e-01, 1.34038413e-01, 3.32400970e-01, 5.01302700e-01, 5.43368711e-01, 6.94848901e-01, 9.64195746e-01, 3.74901627e-01, 7.55347800e-01, 5.28479739e-01, 8.64631462e-01, 5.60848997e-01, 3.82137452e-01, 4.99961889e-01, 5.29737869e-01, 9.85621960e-01, 6.12813748e-02, 4.48468954e-02, 1.94324791e-01, 3.90880357e-03, 1.05811175e-01, 3.94437734e-01, 2.04830871e-01, 4.81965369e-01, 8.45400145e-01, 6.38468218e-01, 7.67432200e-01, 8.30547857e-01, 1.26939493e-01, 4.42671816e-02, 4.48197124e-01, 4.66555556e-01, 9.60267487e-01, 2.57805778e-01, 4.44110753e-01, 5.59008379e-01, 8.49988825e-01, 1.25328933e-01, 9.28501378e-01, 5.79709037e-01, 4.62533411e-01, 4.43393736e-01, 4.98910467e-02, 2.75026095e-01, 6.19929186e-01, 9.19012177e-01, 9.20682467e-01, 2.56063563e-01, 5.36146329e-01, 3.05924148e-01, 3.67851697e-01, 3.51097154e-01, 4.32807732e-01, 3.26208986e-03, 4.54868778e-01, 3.13958993e-01, 2.63649599e-01])
- (row)float64K1.057, 1.049, ..., 1.039, 1.053
Values:
array([1.0572413 , 1.04910187, 1.07196889, 1.04637864, 1.08511135, 1.07883327, 1.05410473, 1.09462853, 1.0646386 , 1.04214041, 1.02263323, 1.01624572, 1.03547522, 1.02456488, 1.04678623, 1.07764753, 1.00386747, 1.07820403, 1.01681343, 1.0588846 , 1.00044092, 1.08331491, 1.07175395, 1.01784325, 1.09188934, 1.03525373, 1.06123806, 1.02162412, 1.04985638, 1.06833087, 1.01977245, 1.03260294, 1.04336006, 1.05551015, 1.02912231, 1.04728736, 1.01041479, 1.04379077, 1.00211797, 1.01790313, 1.09130702, 1.02068456, 1.03641199, 1.0181115 , 1.05851357, 1.05882001, 1.0892991 , 1.07328981, 1.09436318, 1.01947839, 1.02410795, 1.08659535, 1.08700923, 1.01338181, 1.03628868, 1.00136035, 1.02336109, 1.03458256, 1.03085164, 1.01212304, 1.09532596, 1.03578161, 1.04725279, 1.06947597, 1.0815284 , 1.08894865, 1.05875947, 1.08840914, 1.05540028, 1.07955569, 1.02423292, 1.07494723, 1.02590595, 1.05768937, 1.09356846, 1.06142638, 1.0070585 , 1.08930236, 1.05196076, 1.00841121, 1.03741442, 1.07327263, 1.00929804, 1.06677877, 1.09963128, 1.01891984, 1.06376295, 1.09236163, 1.08124864, 1.02353567, 1.06599126, 1.08741107, 1.06795978, 1.01730203, 1.08231962, 1.08423843, 1.08752373, 1.01219293, 1.0387933 , 1.05254691])
Bin into 10 x and y bins:
[25]:
table.bin(x=10, y=10)
[25]:
- x: 10
- y: 10
- x(x [bin-edge])float64m0.003, 0.102, ..., 0.893, 0.992
Values:
array([0.00313229, 0.10204498, 0.20095768, 0.29987037, 0.39878306, 0.49769576, 0.59660845, 0.69552115, 0.79443384, 0.89334654, 0.99225923]) - y(y [bin-edge])float64m0.007, 0.105, ..., 0.893, 0.991
Values:
array([0.00675377, 0.10522827, 0.20370276, 0.30217725, 0.40065175, 0.49912624, 0.59760074, 0.69607523, 0.79454972, 0.89302422, 0.99149871])
- (x, y)DataArrayViewbinned data [len=5, len=0, ..., len=1, len=2]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:5, ] Coordinates: label int32 [m] (row) [0, 0, ..., 0, 0] x float64 [m] (row) [0.0868831, 0.0921815, ..., 0.053002, 0.0338069] y float64 [m] (row) [0.00675377, 0.0319053, ..., 0.0148797, 0.00843672] z float64 [m] (row) [0.591519, 0.694849, ..., 0.960267, 0.367852] Data: float64 [K] (row) [1.00212, 1.09436, ..., 1.06143, 1.0173] , <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: label int32 [m] (row) [] x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] , ..., <scipp.DataArray> Dimensions: Sizes[row:1, ] Coordinates: label int32 [m] (row) [9] x float64 [m] (row) [0.940113] y float64 [m] (row) [0.798104] z float64 [m] (row) [0.141874] Data: float64 [K] (row) [1.04379] , <scipp.DataArray> Dimensions: Sizes[row:2, ] Coordinates: label int32 [m] (row) [9, 9] x float64 [m] (row) [0.94736, 0.947199] y float64 [m] (row) [0.894706, 0.941554] z float64 [m] (row) [0.560849, 0.313959] Data: float64 [K] (row) [1.03629, 1.03879] ]
Bin based on bin size:
[26]:
table.bin(x=1 * sc.Unit('mm'))
[26]:
- x: 990
- x(x [bin-edge])float64m0.003, 0.004, ..., 0.992, 0.993
Values:
array([0.00313229, 0.00413229, 0.00513229, 0.00613229, 0.00713229, 0.00813229, 0.00913229, 0.01013229, 0.01113229, 0.01213229, 0.01313229, 0.01413229, 0.01513229, 0.01613229, 0.01713229, 0.01813229, 0.01913229, 0.02013229, 0.02113229, 0.02213229, 0.02313229, 0.02413229, 0.02513229, 0.02613229, 0.02713229, 0.02813229, 0.02913229, 0.03013229, 0.03113229, 0.03213229, 0.03313229, 0.03413229, 0.03513229, 0.03613229, 0.03713229, 0.03813229, 0.03913229, 0.04013229, 0.04113229, 0.04213229, 0.04313229, 0.04413229, 0.04513229, 0.04613229, 0.04713229, 0.04813229, 0.04913229, 0.05013229, 0.05113229, 0.05213229, 0.05313229, 0.05413229, 0.05513229, 0.05613229, 0.05713229, 0.05813229, 0.05913229, 0.06013229, 0.06113229, 0.06213229, 0.06313229, 0.06413229, 0.06513229, 0.06613229, 0.06713229, 0.06813229, 0.06913229, 0.07013229, 0.07113229, 0.07213229, 0.07313229, 0.07413229, 0.07513229, 0.07613229, 0.07713229, 0.07813229, 0.07913229, 0.08013229, 0.08113229, 0.08213229, 0.08313229, 0.08413229, 0.08513229, 0.08613229, 0.08713229, 0.08813229, 0.08913229, 0.09013229, 0.09113229, 0.09213229, 0.09313229, 0.09413229, 0.09513229, 0.09613229, 0.09713229, 0.09813229, 0.09913229, 0.10013229, 0.10113229, 0.10213229, 0.10313229, 0.10413229, 0.10513229, 0.10613229, 0.10713229, 0.10813229, 0.10913229, 0.11013229, 0.11113229, 0.11213229, 0.11313229, 0.11413229, 0.11513229, 0.11613229, 0.11713229, 0.11813229, 0.11913229, 0.12013229, 0.12113229, 0.12213229, 0.12313229, 0.12413229, 0.12513229, 0.12613229, 0.12713229, 0.12813229, 0.12913229, 0.13013229, 0.13113229, 0.13213229, 0.13313229, 0.13413229, 0.13513229, 0.13613229, 0.13713229, 0.13813229, 0.13913229, 0.14013229, 0.14113229, 0.14213229, 0.14313229, 0.14413229, 0.14513229, 0.14613229, 0.14713229, 0.14813229, 0.14913229, 0.15013229, 0.15113229, 0.15213229, 0.15313229, 0.15413229, 0.15513229, 0.15613229, 0.15713229, 0.15813229, 0.15913229, 0.16013229, 0.16113229, 0.16213229, 0.16313229, 0.16413229, 0.16513229, 0.16613229, 0.16713229, 0.16813229, 0.16913229, 0.17013229, 0.17113229, 0.17213229, 0.17313229, 0.17413229, 0.17513229, 0.17613229, 0.17713229, 0.17813229, 0.17913229, 0.18013229, 0.18113229, 0.18213229, 0.18313229, 0.18413229, 0.18513229, 0.18613229, 0.18713229, 0.18813229, 0.18913229, 0.19013229, 0.19113229, 0.19213229, 0.19313229, 0.19413229, 0.19513229, 0.19613229, 0.19713229, 0.19813229, 0.19913229, 0.20013229, 0.20113229, 0.20213229, 0.20313229, 0.20413229, 0.20513229, 0.20613229, 0.20713229, 0.20813229, 0.20913229, 0.21013229, 0.21113229, 0.21213229, 0.21313229, 0.21413229, 0.21513229, 0.21613229, 0.21713229, 0.21813229, 0.21913229, 0.22013229, 0.22113229, 0.22213229, 0.22313229, 0.22413229, 0.22513229, 0.22613229, 0.22713229, 0.22813229, 0.22913229, 0.23013229, 0.23113229, 0.23213229, 0.23313229, 0.23413229, 0.23513229, 0.23613229, 0.23713229, 0.23813229, 0.23913229, 0.24013229, 0.24113229, 0.24213229, 0.24313229, 0.24413229, 0.24513229, 0.24613229, 0.24713229, 0.24813229, 0.24913229, 0.25013229, 0.25113229, 0.25213229, 0.25313229, 0.25413229, 0.25513229, 0.25613229, 0.25713229, 0.25813229, 0.25913229, 0.26013229, 0.26113229, 0.26213229, 0.26313229, 0.26413229, 0.26513229, 0.26613229, 0.26713229, 0.26813229, 0.26913229, 0.27013229, 0.27113229, 0.27213229, 0.27313229, 0.27413229, 0.27513229, 0.27613229, 0.27713229, 0.27813229, 0.27913229, 0.28013229, 0.28113229, 0.28213229, 0.28313229, 0.28413229, 0.28513229, 0.28613229, 0.28713229, 0.28813229, 0.28913229, 0.29013229, 0.29113229, 0.29213229, 0.29313229, 0.29413229, 0.29513229, 0.29613229, 0.29713229, 0.29813229, 0.29913229, 0.30013229, 0.30113229, 0.30213229, 0.30313229, 0.30413229, 0.30513229, 0.30613229, 0.30713229, 0.30813229, 0.30913229, 0.31013229, 0.31113229, 0.31213229, 0.31313229, 0.31413229, 0.31513229, 0.31613229, 0.31713229, 0.31813229, 0.31913229, 0.32013229, 0.32113229, 0.32213229, 0.32313229, 0.32413229, 0.32513229, 0.32613229, 0.32713229, 0.32813229, 0.32913229, 0.33013229, 0.33113229, 0.33213229, 0.33313229, 0.33413229, 0.33513229, 0.33613229, 0.33713229, 0.33813229, 0.33913229, 0.34013229, 0.34113229, 0.34213229, 0.34313229, 0.34413229, 0.34513229, 0.34613229, 0.34713229, 0.34813229, 0.34913229, 0.35013229, 0.35113229, 0.35213229, 0.35313229, 0.35413229, 0.35513229, 0.35613229, 0.35713229, 0.35813229, 0.35913229, 0.36013229, 0.36113229, 0.36213229, 0.36313229, 0.36413229, 0.36513229, 0.36613229, 0.36713229, 0.36813229, 0.36913229, 0.37013229, 0.37113229, 0.37213229, 0.37313229, 0.37413229, 0.37513229, 0.37613229, 0.37713229, 0.37813229, 0.37913229, 0.38013229, 0.38113229, 0.38213229, 0.38313229, 0.38413229, 0.38513229, 0.38613229, 0.38713229, 0.38813229, 0.38913229, 0.39013229, 0.39113229, 0.39213229, 0.39313229, 0.39413229, 0.39513229, 0.39613229, 0.39713229, 0.39813229, 0.39913229, 0.40013229, 0.40113229, 0.40213229, 0.40313229, 0.40413229, 0.40513229, 0.40613229, 0.40713229, 0.40813229, 0.40913229, 0.41013229, 0.41113229, 0.41213229, 0.41313229, 0.41413229, 0.41513229, 0.41613229, 0.41713229, 0.41813229, 0.41913229, 0.42013229, 0.42113229, 0.42213229, 0.42313229, 0.42413229, 0.42513229, 0.42613229, 0.42713229, 0.42813229, 0.42913229, 0.43013229, 0.43113229, 0.43213229, 0.43313229, 0.43413229, 0.43513229, 0.43613229, 0.43713229, 0.43813229, 0.43913229, 0.44013229, 0.44113229, 0.44213229, 0.44313229, 0.44413229, 0.44513229, 0.44613229, 0.44713229, 0.44813229, 0.44913229, 0.45013229, 0.45113229, 0.45213229, 0.45313229, 0.45413229, 0.45513229, 0.45613229, 0.45713229, 0.45813229, 0.45913229, 0.46013229, 0.46113229, 0.46213229, 0.46313229, 0.46413229, 0.46513229, 0.46613229, 0.46713229, 0.46813229, 0.46913229, 0.47013229, 0.47113229, 0.47213229, 0.47313229, 0.47413229, 0.47513229, 0.47613229, 0.47713229, 0.47813229, 0.47913229, 0.48013229, 0.48113229, 0.48213229, 0.48313229, 0.48413229, 0.48513229, 0.48613229, 0.48713229, 0.48813229, 0.48913229, 0.49013229, 0.49113229, 0.49213229, 0.49313229, 0.49413229, 0.49513229, 0.49613229, 0.49713229, 0.49813229, 0.49913229, 0.50013229, 0.50113229, 0.50213229, 0.50313229, 0.50413229, 0.50513229, 0.50613229, 0.50713229, 0.50813229, 0.50913229, 0.51013229, 0.51113229, 0.51213229, 0.51313229, 0.51413229, 0.51513229, 0.51613229, 0.51713229, 0.51813229, 0.51913229, 0.52013229, 0.52113229, 0.52213229, 0.52313229, 0.52413229, 0.52513229, 0.52613229, 0.52713229, 0.52813229, 0.52913229, 0.53013229, 0.53113229, 0.53213229, 0.53313229, 0.53413229, 0.53513229, 0.53613229, 0.53713229, 0.53813229, 0.53913229, 0.54013229, 0.54113229, 0.54213229, 0.54313229, 0.54413229, 0.54513229, 0.54613229, 0.54713229, 0.54813229, 0.54913229, 0.55013229, 0.55113229, 0.55213229, 0.55313229, 0.55413229, 0.55513229, 0.55613229, 0.55713229, 0.55813229, 0.55913229, 0.56013229, 0.56113229, 0.56213229, 0.56313229, 0.56413229, 0.56513229, 0.56613229, 0.56713229, 0.56813229, 0.56913229, 0.57013229, 0.57113229, 0.57213229, 0.57313229, 0.57413229, 0.57513229, 0.57613229, 0.57713229, 0.57813229, 0.57913229, 0.58013229, 0.58113229, 0.58213229, 0.58313229, 0.58413229, 0.58513229, 0.58613229, 0.58713229, 0.58813229, 0.58913229, 0.59013229, 0.59113229, 0.59213229, 0.59313229, 0.59413229, 0.59513229, 0.59613229, 0.59713229, 0.59813229, 0.59913229, 0.60013229, 0.60113229, 0.60213229, 0.60313229, 0.60413229, 0.60513229, 0.60613229, 0.60713229, 0.60813229, 0.60913229, 0.61013229, 0.61113229, 0.61213229, 0.61313229, 0.61413229, 0.61513229, 0.61613229, 0.61713229, 0.61813229, 0.61913229, 0.62013229, 0.62113229, 0.62213229, 0.62313229, 0.62413229, 0.62513229, 0.62613229, 0.62713229, 0.62813229, 0.62913229, 0.63013229, 0.63113229, 0.63213229, 0.63313229, 0.63413229, 0.63513229, 0.63613229, 0.63713229, 0.63813229, 0.63913229, 0.64013229, 0.64113229, 0.64213229, 0.64313229, 0.64413229, 0.64513229, 0.64613229, 0.64713229, 0.64813229, 0.64913229, 0.65013229, 0.65113229, 0.65213229, 0.65313229, 0.65413229, 0.65513229, 0.65613229, 0.65713229, 0.65813229, 0.65913229, 0.66013229, 0.66113229, 0.66213229, 0.66313229, 0.66413229, 0.66513229, 0.66613229, 0.66713229, 0.66813229, 0.66913229, 0.67013229, 0.67113229, 0.67213229, 0.67313229, 0.67413229, 0.67513229, 0.67613229, 0.67713229, 0.67813229, 0.67913229, 0.68013229, 0.68113229, 0.68213229, 0.68313229, 0.68413229, 0.68513229, 0.68613229, 0.68713229, 0.68813229, 0.68913229, 0.69013229, 0.69113229, 0.69213229, 0.69313229, 0.69413229, 0.69513229, 0.69613229, 0.69713229, 0.69813229, 0.69913229, 0.70013229, 0.70113229, 0.70213229, 0.70313229, 0.70413229, 0.70513229, 0.70613229, 0.70713229, 0.70813229, 0.70913229, 0.71013229, 0.71113229, 0.71213229, 0.71313229, 0.71413229, 0.71513229, 0.71613229, 0.71713229, 0.71813229, 0.71913229, 0.72013229, 0.72113229, 0.72213229, 0.72313229, 0.72413229, 0.72513229, 0.72613229, 0.72713229, 0.72813229, 0.72913229, 0.73013229, 0.73113229, 0.73213229, 0.73313229, 0.73413229, 0.73513229, 0.73613229, 0.73713229, 0.73813229, 0.73913229, 0.74013229, 0.74113229, 0.74213229, 0.74313229, 0.74413229, 0.74513229, 0.74613229, 0.74713229, 0.74813229, 0.74913229, 0.75013229, 0.75113229, 0.75213229, 0.75313229, 0.75413229, 0.75513229, 0.75613229, 0.75713229, 0.75813229, 0.75913229, 0.76013229, 0.76113229, 0.76213229, 0.76313229, 0.76413229, 0.76513229, 0.76613229, 0.76713229, 0.76813229, 0.76913229, 0.77013229, 0.77113229, 0.77213229, 0.77313229, 0.77413229, 0.77513229, 0.77613229, 0.77713229, 0.77813229, 0.77913229, 0.78013229, 0.78113229, 0.78213229, 0.78313229, 0.78413229, 0.78513229, 0.78613229, 0.78713229, 0.78813229, 0.78913229, 0.79013229, 0.79113229, 0.79213229, 0.79313229, 0.79413229, 0.79513229, 0.79613229, 0.79713229, 0.79813229, 0.79913229, 0.80013229, 0.80113229, 0.80213229, 0.80313229, 0.80413229, 0.80513229, 0.80613229, 0.80713229, 0.80813229, 0.80913229, 0.81013229, 0.81113229, 0.81213229, 0.81313229, 0.81413229, 0.81513229, 0.81613229, 0.81713229, 0.81813229, 0.81913229, 0.82013229, 0.82113229, 0.82213229, 0.82313229, 0.82413229, 0.82513229, 0.82613229, 0.82713229, 0.82813229, 0.82913229, 0.83013229, 0.83113229, 0.83213229, 0.83313229, 0.83413229, 0.83513229, 0.83613229, 0.83713229, 0.83813229, 0.83913229, 0.84013229, 0.84113229, 0.84213229, 0.84313229, 0.84413229, 0.84513229, 0.84613229, 0.84713229, 0.84813229, 0.84913229, 0.85013229, 0.85113229, 0.85213229, 0.85313229, 0.85413229, 0.85513229, 0.85613229, 0.85713229, 0.85813229, 0.85913229, 0.86013229, 0.86113229, 0.86213229, 0.86313229, 0.86413229, 0.86513229, 0.86613229, 0.86713229, 0.86813229, 0.86913229, 0.87013229, 0.87113229, 0.87213229, 0.87313229, 0.87413229, 0.87513229, 0.87613229, 0.87713229, 0.87813229, 0.87913229, 0.88013229, 0.88113229, 0.88213229, 0.88313229, 0.88413229, 0.88513229, 0.88613229, 0.88713229, 0.88813229, 0.88913229, 0.89013229, 0.89113229, 0.89213229, 0.89313229, 0.89413229, 0.89513229, 0.89613229, 0.89713229, 0.89813229, 0.89913229, 0.90013229, 0.90113229, 0.90213229, 0.90313229, 0.90413229, 0.90513229, 0.90613229, 0.90713229, 0.90813229, 0.90913229, 0.91013229, 0.91113229, 0.91213229, 0.91313229, 0.91413229, 0.91513229, 0.91613229, 0.91713229, 0.91813229, 0.91913229, 0.92013229, 0.92113229, 0.92213229, 0.92313229, 0.92413229, 0.92513229, 0.92613229, 0.92713229, 0.92813229, 0.92913229, 0.93013229, 0.93113229, 0.93213229, 0.93313229, 0.93413229, 0.93513229, 0.93613229, 0.93713229, 0.93813229, 0.93913229, 0.94013229, 0.94113229, 0.94213229, 0.94313229, 0.94413229, 0.94513229, 0.94613229, 0.94713229, 0.94813229, 0.94913229, 0.95013229, 0.95113229, 0.95213229, 0.95313229, 0.95413229, 0.95513229, 0.95613229, 0.95713229, 0.95813229, 0.95913229, 0.96013229, 0.96113229, 0.96213229, 0.96313229, 0.96413229, 0.96513229, 0.96613229, 0.96713229, 0.96813229, 0.96913229, 0.97013229, 0.97113229, 0.97213229, 0.97313229, 0.97413229, 0.97513229, 0.97613229, 0.97713229, 0.97813229, 0.97913229, 0.98013229, 0.98113229, 0.98213229, 0.98313229, 0.98413229, 0.98513229, 0.98613229, 0.98713229, 0.98813229, 0.98913229, 0.99013229, 0.99113229, 0.99213229, 0.99313229])
- (x)DataArrayViewbinned data [len=1, len=0, ..., len=0, len=1]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:1, ] Coordinates: label int32 [m] (row) [0] x float64 [m] (row) [0.00313229] y float64 [m] (row) [0.691054] z float64 [m] (row) [0.332033] Data: float64 [K] (row) [1.04986] , <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: label int32 [m] (row) [] x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] , ..., <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: label int32 [m] (row) [] x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] , <scipp.DataArray> Dimensions: Sizes[row:1, ] Coordinates: label int32 [m] (row) [9] x float64 [m] (row) [0.992259] y float64 [m] (row) [0.141296] z float64 [m] (row) [0.372221] Data: float64 [K] (row) [1.04729] ]
Group by label and bin by y:
[27]:
table.group('label').bin(y=20)
[27]:
- label: 10
- y: 20
- label(label)int32m0, 1, ..., 8, 9
Values:
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=int32) - y(y [bin-edge])float64m0.007, 0.056, ..., 0.942, 0.991
Values:
array([0.00675377, 0.05599102, 0.10522827, 0.15446551, 0.20370276, 0.25294001, 0.30217725, 0.3514145 , 0.40065175, 0.44988899, 0.49912624, 0.54836349, 0.59760074, 0.64683798, 0.69607523, 0.74531248, 0.79454972, 0.84378697, 0.89302422, 0.94226146, 0.99149871])
- (label, y)DataArrayViewbinned data [len=4, len=1, ..., len=2, len=0]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:4, ] Coordinates: x float64 [m] (row) [0.0868831, 0.0921815, 0.053002, 0.0338069] y float64 [m] (row) [0.00675377, 0.0319053, 0.0148797, 0.00843672] z float64 [m] (row) [0.591519, 0.694849, 0.960267, 0.367852] Data: float64 [K] (row) [1.00212, 1.09436, 1.06143, 1.0173] , <scipp.DataArray> Dimensions: Sizes[row:1, ] Coordinates: x float64 [m] (row) [0.00597817] y float64 [m] (row) [0.0926235] z float64 [m] (row) [0.126939] Data: float64 [K] (row) [1.07495] , ..., <scipp.DataArray> Dimensions: Sizes[row:2, ] Coordinates: x float64 [m] (row) [0.94736, 0.947199] y float64 [m] (row) [0.894706, 0.941554] z float64 [m] (row) [0.560849, 0.313959] Data: float64 [K] (row) [1.03629, 1.03879] , <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] ]
For more examples see the documentation of the functions.
Multi-dimensional histogramming#
New in 0.15
Added support for multi-dimensional histogramming with hist
. This is partially based on bin
, i.e., performance may be sub-optimal.
Example:
[28]:
table.hist(x=10, y=20)
[28]:
- x: 10
- y: 20
- x(x [bin-edge])float64m0.003, 0.102, ..., 0.893, 0.992
Values:
array([0.00313229, 0.10204498, 0.20095768, 0.29987037, 0.39878306, 0.49769576, 0.59660845, 0.69552115, 0.79443384, 0.89334654, 0.99225923]) - y(y [bin-edge])float64m0.007, 0.056, ..., 0.942, 0.991
Values:
array([0.00675377, 0.05599102, 0.10522827, 0.15446551, 0.20370276, 0.25294001, 0.30217725, 0.3514145 , 0.40065175, 0.44988899, 0.49912624, 0.54836349, 0.59760074, 0.64683798, 0.69607523, 0.74531248, 0.79454972, 0.84378697, 0.89302422, 0.94226146, 0.99149871])
- (x, y)float64K4.175, 1.075, ..., 2.075, 0.0
Values:
array([[4.17520956, 1.07494723, 0. , 0. , 0. , 1.05254691, 0. , 0. , 0. , 0. , 0. , 1.09188934, 1.06795978, 1.04985638, 1.00044092, 0. , 0. , 1.03741442, 0. , 1.0815284 ], [0. , 1.02912231, 1.01681343, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 1.08930236, 0. , 1.01891984, 1.07883327, 0. , 0. , 0. , 2.07719356], [0. , 0. , 1.09532596, 2.13478778, 1.01947839, 0. , 1.04214041, 0. , 0. , 0. , 0. , 1.02590595, 1.05768937, 1.05410473, 2.1416035 , 0. , 2.10173969, 0. , 1.02068456, 0. ], [0. , 1.0892991 , 0. , 0. , 2.18215226, 0. , 0. , 0. , 0. , 1.08511135, 0. , 0. , 2.13651294, 0. , 1.0070585 , 0. , 1.01338181, 1.08124864, 0. , 1.09356846], [1.06123806, 1.03458256, 0. , 1.05882001, 1.08231962, 2.10964246, 0. , 0. , 0. , 1.05540028, 0. , 1.03260294, 0. , 1.07328981, 0. , 0. , 0. , 0. , 1.02336109, 1.01790313], [0. , 0. , 0. , 0. , 0. , 1.09236163, 1.07955569, 1.02162412, 0. , 0. , 1.02410795, 0. , 0. , 0. , 0. , 0. , 0. , 1.08894865, 0. , 0. ], [0. , 1.01784325, 1.00841121, 2.13010114, 0. , 0. , 1.05875947, 0. , 0. , 0. , 0. , 2.08694556, 0. , 1.07175395, 0. , 0. , 0. , 0. , 1.01624572, 0. ], [1.03085164, 0. , 0. , 0. , 0. , 0. , 0. , 1.00386747, 0. , 0. , 1.03578161, 0. , 1.08659535, 0. , 1.00136035, 0. , 0. , 1.04336006, 0. , 0. ], [0. , 0. , 2.04853503, 1.06947597, 1.08423843, 1.03547522, 0. , 0. , 1.06599126, 1.06376295, 2.11047433, 0. , 0. , 2.11107947, 1.01219293, 0. , 0. , 0. , 1.04725279, 2.08344949], [1.02423292, 2.13488502, 1.04728736, 0. , 0. , 2.12921019, 0. , 0. , 0. , 0. , 1.05551015, 1.0181115 , 1.0646386 , 0. , 0. , 0. , 1.04379077, 0. , 2.07508198, 0. ]])
nanhist
#
New in 0.15
Added nanhist
, to skip NaN values when computing a histogram. This is based on bin
, i.e., performance may be sub-optimal.
Binned data#
Concatenating bins along all dimensions#
New in 0.16
The bins.concat
method now supports concatenation of all dims.
Example:
[29]:
da = sc.data.table_xyz(nrow=100).bin(y=2, x=10)
da.bins.concat() # 0-D output, i.e., a single bin
[29]:
- ()DataArrayViewbinned data [len=100]
Values:
<scipp.DataArray> Dimensions: Sizes[row:100, ] Coordinates: x float64 [m] (row) [0.0868831, 0.0921815, ..., 0.94736, 0.947199] y float64 [m] (row) [0.00675377, 0.0319053, ..., 0.894706, 0.941554] z float64 [m] (row) [0.591519, 0.694849, ..., 0.560849, 0.313959] Data: float64 [K] (row) [1.00212, 1.09436, ..., 1.03629, 1.03879]
Interpolation using lookup
#
New in 0.15
lookup
is extended and improved, to facilitate “event filtering” operations:
Support for non-histogram data arrays as input functions. In this case two lookup modes,
previous
andnearest
are provided. This makes this similar toscipy.interpolate.interp1d
.Custom fill values are now supported. This is used for out-of-range as well as for masked values.
Works with
transform_coords
.
Example:
Given a function func
and a data array:
[30]:
x = sc.linspace('x', 0, 1, num=51, unit='m')
func = sc.DataArray(x * x, coords={'x': x}) # approximating f(x) = x**2
table = sc.data.table_xyz(nrow=100)
da = table.bin(y=2, x=10) # note x=10, unlike in func above
We can compute a new coordinate x2
, for both the bin coordinate and the event coordinate:
[31]:
da = da.transform_coords(x2=sc.lookup(func, mode='nearest'))
da
[31]:
- y: 2
- x2: 10
- x2(x2 [bin-edge])float64m^20.0, 0.010, ..., 0.81, 1.0
Values:
array([0. , 0.01, 0.04, 0.09, 0.16, 0.25, 0.36, 0.49, 0.64, 0.81, 1. ]) - y(y [bin-edge])float64m0.007, 0.499, 0.991
Values:
array([0.00675377, 0.49912624, 0.99149871])
- (y, x2)DataArrayViewbinned data [len=6, len=2, ..., len=8, len=6]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:6, ] Coordinates: x2 float64 [m^2] (row) [0.0064, 0.01, ..., 0.0016, 0.0036] y float64 [m] (row) [0.00675377, 0.0319053, ..., 0.00843672, 0.266437] z float64 [m] (row) [0.591519, 0.694849, ..., 0.367852, 0.26365] Data: float64 [K] (row) [1.00212, 1.09436, ..., 1.0173, 1.05255] Attributes: x float64 [m] (row) [0.0868831, 0.0921815, ..., 0.0338069, 0.0670407] , <scipp.DataArray> Dimensions: Sizes[row:2, ] Coordinates: x2 float64 [m^2] (row) [0.0324, 0.0256] y float64 [m] (row) [0.127554, 0.0978224] z float64 [m] (row) [0.98037, 0.314727] Data: float64 [K] (row) [1.01681, 1.02912] Attributes: x float64 [m] (row) [0.172066, 0.153474] , ..., <scipp.DataArray> Dimensions: Sizes[row:8, ] Coordinates: x2 float64 [m^2] (row) [0.7396, 0.7744, ..., 0.6724, 0.6724] y float64 [m] (row) [0.948835, 0.95134, ..., 0.501685, 0.741137] z float64 [m] (row) [0.0280613, 0.17809, ..., 0.559008, 0.454869] Data: float64 [K] (row) [1.02456, 1.05888, ..., 1.05196, 1.01219] Attributes: x float64 [m] (row) [0.863758, 0.870415, ..., 0.829215, 0.823521] , <scipp.DataArray> Dimensions: Sizes[row:6, ] Coordinates: x2 float64 [m^2] (row) [0.9216, 0.8464, ..., 0.8836, 0.8836] y float64 [m] (row) [0.622047, 0.537658, ..., 0.894706, 0.941554] z float64 [m] (row) [0.730931, 0.918612, ..., 0.560849, 0.313959] Data: float64 [K] (row) [1.06464, 1.05551, ..., 1.03629, 1.03879] Attributes: x float64 [m] (row) [0.964079, 0.922043, ..., 0.94736, 0.947199] ]
- x(x2 [bin-edge])float64m0.003, 0.102, ..., 0.893, 0.992
Values:
array([0.00313229, 0.10204498, 0.20095768, 0.29987037, 0.39878306, 0.49769576, 0.59660845, 0.69552115, 0.79443384, 0.89334654, 0.99225923])
[32]:
sc.show(da)
Extracting events based on a coord value or value interval#
New in 0.17
The bins
property now supports __getitem__
, providing a shorthand for extracting events based on a coord value or value interval. This is equivalent functionality to label-based indexing for dense data but considers the coordinates of the underlying bin content.
Example:
[33]:
da = sc.data.table_xyz(nrow=1000).bin(x=10)
start = 0.1 * sc.Unit('m')
stop = 0.2 * sc.Unit('m')
da.bins['y', start:stop]
[33]:
- x: 10
- x(x [bin-edge])float64m4.613e-05, 0.100, ..., 0.899, 0.999
Values:
array([4.61285877e-05, 9.99550314e-02, 1.99863934e-01, 2.99772837e-01, 3.99681740e-01, 4.99590642e-01, 5.99499545e-01, 6.99408448e-01, 7.99317351e-01, 8.99226253e-01, 9.99135156e-01])
- (x)DataArrayViewbinned data [len=10, len=9, ..., len=15, len=4]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:10, ] Coordinates: x float64 [m] (row) [0.0868831, 0.00675377, ..., 0.0281098, 0.0461231] y float64 [m] (row) [0.129214, 0.123998, ..., 0.121251, 0.116315] z float64 [m] (row) [0.313374, 0.934055, ..., 0.511447, 0.753407] Data: float64 [K] (row) [1.06565, 1.04755, ..., 1.04337, 1.0458] , <scipp.DataArray> Dimensions: Sizes[row:9, ] Coordinates: x float64 [m] (row) [0.172066, 0.141874, ..., 0.124112, 0.158134] y float64 [m] (row) [0.166753, 0.112651, ..., 0.137348, 0.129819] z float64 [m] (row) [0.35795, 0.609035, ..., 0.698717, 0.63518] Data: float64 [K] (row) [1.07712, 1.09972, ..., 1.07154, 1.02147] , ..., <scipp.DataArray> Dimensions: Sizes[row:15, ] Coordinates: x float64 [m] (row) [0.863621, 0.863758, ..., 0.880341, 0.810629] y float64 [m] (row) [0.105932, 0.165131, ..., 0.150508, 0.149279] z float64 [m] (row) [0.638615, 0.779722, ..., 0.0799175, 0.376726] Data: float64 [K] (row) [1.06823, 1.06322, ..., 1.04007, 1.09455] , <scipp.DataArray> Dimensions: Sizes[row:4, ] Coordinates: x float64 [m] (row) [0.966344, 0.975194, 0.950059, 0.97777] y float64 [m] (row) [0.132392, 0.160399, 0.185897, 0.127608] z float64 [m] (row) [0.264217, 0.00072429, 0.476242, 0.579698] Data: float64 [K] (row) [1.02881, 1.03364, 1.09637, 1.01852] ]
- y(y)float64m0.1, 0.2
Values:
array([0.1, 0.2])
Reduction operations#
More operations supported by data arrays and datasets#
New in 0.14
DataArray
andDataset
now support more reduction operations, includingsum
,nansum
,mean
,nanmean
,max
,min
,nanmax
,nanmin
,all
, andany
.All of the above are now also supported for the
bins
property.groupby
now also supports all of these operations. Exception:nanmean
.Event-based masks are now supported in all reduction operations.
Example:
[34]:
da = sc.data.binned_x(nevent=100, nbin=3)
da
[34]:
- x: 3
- x(x [bin-edge])float64m0.003, 0.333, 0.663, 0.992
Values:
array([0.00313229, 0.33284127, 0.66255025, 0.99225923])
- (x)DataArrayViewbinned data [len=37, len=26, len=37]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:37, ] Coordinates: x float64 [m] (row) [0.261692, 0.319097, ..., 0.0338069, 0.0670407] y float64 [m] (row) [0.174846, 0.495505, ..., 0.00843672, 0.266437] z float64 [m] (row) [0.806809, 0.0545327, ..., 0.367852, 0.26365] Data: float64 [K] (row) [1.04638, 1.08511, ..., 1.0173, 1.05255] , <scipp.DataArray> Dimensions: Sizes[row:26, ] Coordinates: x float64 [m] (row) [0.380196, 0.441006, ..., 0.461613, 0.350609] y float64 [m] (row) [0.619161, 0.277216, ..., 0.221658, 0.220269] z float64 [m] (row) [0.00207108, 0.762591, ..., 0.351097, 0.00326209] Data: float64 [K] (row) [1.0491, 1.02263, ..., 1.08232, 1.08752] , <scipp.DataArray> Dimensions: Sizes[row:37, ] Coordinates: x float64 [m] (row) [0.9767, 0.923246, ..., 0.823521, 0.947199] y float64 [m] (row) [0.29784, 0.301757, ..., 0.741137, 0.941554] z float64 [m] (row) [0.747273, 0.809356, ..., 0.454869, 0.313959] Data: float64 [K] (row) [1.05724, 1.07197, ..., 1.01219, 1.03879] ]
The maximum value in each bin:
[35]:
da.bins.max()
[35]:
- x: 3
- x(x [bin-edge])float64m0.003, 0.333, 0.663, 0.992
Values:
array([0.00313229, 0.33284127, 0.66255025, 0.99225923])
- (x)float64K1.095, 1.094, 1.100
Values:
array([1.09532596, 1.09356846, 1.09963128])
The maximum value in each bin of a binned variable, here a coordinate:
[36]:
da.bins.coords['x'].bins.max()
[36]:
- (x: 3)float64m0.326, 0.660, 0.992
Values:
array([0.3264945 , 0.65987435, 0.99225923])
Shape operations#
fold
supports size -1#
New in 0.12
fold
now accepts up to one size (or shape) entry with value -1
. This indicates that the size should be computed automatically based on the input size and other provided sizes.
Example:
[37]:
var = sc.arange('xyz', 2448)
var.fold('xyz', sizes={'x': 4, 'y': 4, 'z': -1})
[37]:
- (x: 4, y: 4, z: 153)int64𝟙0, 1, ..., 2446, 2447
Values:
array([[[ 0, 1, 2, ..., 150, 151, 152], [ 153, 154, 155, ..., 303, 304, 305], [ 306, 307, 308, ..., 456, 457, 458], [ 459, 460, 461, ..., 609, 610, 611]], [[ 612, 613, 614, ..., 762, 763, 764], [ 765, 766, 767, ..., 915, 916, 917], [ 918, 919, 920, ..., 1068, 1069, 1070], [1071, 1072, 1073, ..., 1221, 1222, 1223]], [[1224, 1225, 1226, ..., 1374, 1375, 1376], [1377, 1378, 1379, ..., 1527, 1528, 1529], [1530, 1531, 1532, ..., 1680, 1681, 1682], [1683, 1684, 1685, ..., 1833, 1834, 1835]], [[1836, 1837, 1838, ..., 1986, 1987, 1988], [1989, 1990, 1991, ..., 2139, 2140, 2141], [2142, 2143, 2144, ..., 2292, 2293, 2294], [2295, 2296, 2297, ..., 2445, 2446, 2447]]])
broadcast
supports DataArray
#
New in 0.13
broadcast
now also supports data arrays.
flatten
drops mismatching bin edges#
New in 0.15
flatten
now drops mismatching bin edges instead of raising an exception.
Example:
[38]:
hist = sc.data.table_xyz(nrow=100).hist(y=2, x=4)
hist.flatten(to='yx')
[38]:
- yx: 8
- (yx)float64K9.368, 16.031, ..., 9.454, 15.623
Values:
array([ 9.36811784, 16.03081984, 9.412524 , 14.73394598, 16.84836126, 13.62563212, 9.45373887, 15.62294235])
Above the x
edges cannot be joined together so the coordinate is dropped in the result. Note the similar behavior of integer-array indexing, for the same reason:
[39]:
hist['x', [0, 2, 3]] # drops x edges
[39]:
- y: 2
- x: 3
- y(y [bin-edge])float64m0.007, 0.499, 0.991
Values:
array([0.00675377, 0.49912624, 0.99149871])
- (y, x)float64K9.368, 9.413, ..., 9.454, 15.623
Values:
array([[ 9.36811784, 9.412524 , 14.73394598], [16.84836126, 9.45373887, 15.62294235]])
Plotting#
Matplotlib backend no longer defaults to interactive#
New in 0.16
Plots are no longer interactive by default, standard Matplotlib rules apply, i.e., the inline
backend is the default.
Activate the interactive backend:
%matplotlib widgetSciPy compatibility layer#
New in 0.11
A number of subpackages providing wrappers for a subset of functions from the corresponding packages in SciPy was added:
scipp.integrate providing
simpson
andtrapezoid
.scipp.interpolate providing
interp1d
.scipp.optimize providing
curve_fit
.scipp.signal providing
butter
andsosfiltfilt
.
Please refer to the function documentation for working examples.
New in 0.14
scipp.ndimage providing
gaussian_filter
,median_filter
, and more.
Python ecosystem compatibility#
New in 0.15
Added scipp.compat.to_xarray
Example:
[40]:
da = sc.data.data_xy()
sc.compat.to_xarray(da)
[40]:
<xarray.DataArray (x: 100, y: 100)> array([[0.97669977, 0.38019574, 0.92324623, ..., 0.82352055, 0.94719907, 0.06704071], [0.29784009, 0.61916102, 0.30175743, ..., 0.74113721, 0.94155401, 0.2664373 ], [0.74727331, 0.00207108, 0.80935632, ..., 0.45486878, 0.31395899, 0.2636496 ], ..., [0.96361756, 0.24277487, 0.13245066, ..., 0.040788 , 0.68996056, 0.57886072], [0.86150017, 0.23153692, 0.46282186, ..., 0.56816586, 0.67814736, 0.31450947], [0.76446616, 0.39851845, 0.00798981, ..., 0.79800865, 0.17579735, 0.58481827]]) Coordinates: * x (x) float64 0.0 0.0101 0.0202 0.0303 ... 0.9697 0.9798 0.9899 1.0 * y (y) float64 0.0 0.05051 0.101 0.1515 ... 4.848 4.899 4.949 5.0 Attributes: units: dimensionless
Performance#
New in 0.12
sc.bin()
is now faster when binning or grouping into thousands of bins or more.
New in 0.14
Fixed slow import times of scipp
.
New in 0.17
Much faster
obj.bins.concat
operations in presence of many bins.When mapping between many input and output bins: Avoid huge memory use and slow performance in use of
scipp.bin
andscipp.group
when only entire bins are combined (rather than splitting bins based on bin content coordinates). This avoids a number of cases where Python kernel used to crash since Scipp ran out of memory.
Example:
[41]:
nx = 1000
da = sc.data.table_xyz(nrow=1000).bin(x=nx, y=100)
da.bins.concat('x') # This used to be extremely slow and used a lot of memory for large nx
[41]:
- y: 100
- y(y [bin-edge])float64m0.001, 0.011, ..., 0.987, 0.997
Values:
array([9.02154077e-04, 1.08670692e-02, 2.08319843e-02, 3.07968994e-02, 4.07618145e-02, 5.07267296e-02, 6.06916446e-02, 7.06565597e-02, 8.06214748e-02, 9.05863899e-02, 1.00551305e-01, 1.10516220e-01, 1.20481135e-01, 1.30446050e-01, 1.40410965e-01, 1.50375881e-01, 1.60340796e-01, 1.70305711e-01, 1.80270626e-01, 1.90235541e-01, 2.00200456e-01, 2.10165371e-01, 2.20130286e-01, 2.30095201e-01, 2.40060116e-01, 2.50025031e-01, 2.59989947e-01, 2.69954862e-01, 2.79919777e-01, 2.89884692e-01, 2.99849607e-01, 3.09814522e-01, 3.19779437e-01, 3.29744352e-01, 3.39709267e-01, 3.49674182e-01, 3.59639098e-01, 3.69604013e-01, 3.79568928e-01, 3.89533843e-01, 3.99498758e-01, 4.09463673e-01, 4.19428588e-01, 4.29393503e-01, 4.39358418e-01, 4.49323333e-01, 4.59288248e-01, 4.69253164e-01, 4.79218079e-01, 4.89182994e-01, 4.99147909e-01, 5.09112824e-01, 5.19077739e-01, 5.29042654e-01, 5.39007569e-01, 5.48972484e-01, 5.58937399e-01, 5.68902315e-01, 5.78867230e-01, 5.88832145e-01, 5.98797060e-01, 6.08761975e-01, 6.18726890e-01, 6.28691805e-01, 6.38656720e-01, 6.48621635e-01, 6.58586550e-01, 6.68551465e-01, 6.78516381e-01, 6.88481296e-01, 6.98446211e-01, 7.08411126e-01, 7.18376041e-01, 7.28340956e-01, 7.38305871e-01, 7.48270786e-01, 7.58235701e-01, 7.68200616e-01, 7.78165532e-01, 7.88130447e-01, 7.98095362e-01, 8.08060277e-01, 8.18025192e-01, 8.27990107e-01, 8.37955022e-01, 8.47919937e-01, 8.57884852e-01, 8.67849767e-01, 8.77814682e-01, 8.87779598e-01, 8.97744513e-01, 9.07709428e-01, 9.17674343e-01, 9.27639258e-01, 9.37604173e-01, 9.47569088e-01, 9.57534003e-01, 9.67498918e-01, 9.77463833e-01, 9.87428749e-01, 9.97393664e-01])
- (y)DataArrayViewbinned data [len=11, len=10, ..., len=9, len=7]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:11, ] Coordinates: x float64 [m] (row) [0.0280613, 0.0968722, ..., 0.991499, 0.991714] y float64 [m] (row) [0.00416291, 0.00714188, ..., 0.00938611, 0.00106903] z float64 [m] (row) [0.354885, 0.688661, ..., 0.141885, 0.209621] Data: float64 [K] (row) [1.02281, 1.03415, ..., 1.01734, 1.06838] , <scipp.DataArray> Dimensions: Sizes[row:10, ] Coordinates: x float64 [m] (row) [0.174846, 0.191142, ..., 0.815277, 0.978397] y float64 [m] (row) [0.0140576, 0.0170821, ..., 0.011618, 0.0149191] z float64 [m] (row) [0.885087, 0.6359, ..., 0.203508, 0.669179] Data: float64 [K] (row) [1.09905, 1.02628, ..., 1.08499, 1.07695] , ..., <scipp.DataArray> Dimensions: Sizes[row:9, ] Coordinates: x float64 [m] (row) [0.0487904, 0.194784, ..., 0.806809, 0.916985] y float64 [m] (row) [0.98007, 0.979635, ..., 0.978079, 0.985136] z float64 [m] (row) [0.445674, 0.0176133, ..., 0.10021, 0.527998] Data: float64 [K] (row) [1.00799, 1.05134, ..., 1.079, 1.04629] , <scipp.DataArray> Dimensions: Sizes[row:7, ] Coordinates: x float64 [m] (row) [0.049891, 0.255715, ..., 0.762591, 0.818312] y float64 [m] (row) [0.992104, 0.991193, ..., 0.991902, 0.990691] z float64 [m] (row) [0.615745, 0.749908, ..., 0.591638, 0.132023] Data: float64 [K] (row) [1.07842, 1.09163, ..., 1.03226, 1.02604] ]
[42]:
da.coords['x2'] = sc.midpoints(da.coords['x'])
da.bin(x2=100) # This used to be extremely slow and used a lot of memory for large nx
[42]:
- y: 100
- x2: 100
- x2(x2 [bin-edge])float64m0.001, 0.011, ..., 0.989, 0.999
Values:
array([5.45673102e-04, 1.05265725e-02, 2.05074719e-02, 3.04883713e-02, 4.04692706e-02, 5.04501700e-02, 6.04310694e-02, 7.04119688e-02, 8.03928682e-02, 9.03737676e-02, 1.00354667e-01, 1.10335566e-01, 1.20316466e-01, 1.30297365e-01, 1.40278265e-01, 1.50259164e-01, 1.60240063e-01, 1.70220963e-01, 1.80201862e-01, 1.90182761e-01, 2.00163661e-01, 2.10144560e-01, 2.20125460e-01, 2.30106359e-01, 2.40087258e-01, 2.50068158e-01, 2.60049057e-01, 2.70029957e-01, 2.80010856e-01, 2.89991755e-01, 2.99972655e-01, 3.09953554e-01, 3.19934453e-01, 3.29915353e-01, 3.39896252e-01, 3.49877152e-01, 3.59858051e-01, 3.69838950e-01, 3.79819850e-01, 3.89800749e-01, 3.99781649e-01, 4.09762548e-01, 4.19743447e-01, 4.29724347e-01, 4.39705246e-01, 4.49686145e-01, 4.59667045e-01, 4.69647944e-01, 4.79628844e-01, 4.89609743e-01, 4.99590642e-01, 5.09571542e-01, 5.19552441e-01, 5.29533341e-01, 5.39514240e-01, 5.49495139e-01, 5.59476039e-01, 5.69456938e-01, 5.79437838e-01, 5.89418737e-01, 5.99399636e-01, 6.09380536e-01, 6.19361435e-01, 6.29342334e-01, 6.39323234e-01, 6.49304133e-01, 6.59285033e-01, 6.69265932e-01, 6.79246831e-01, 6.89227731e-01, 6.99208630e-01, 7.09189530e-01, 7.19170429e-01, 7.29151328e-01, 7.39132228e-01, 7.49113127e-01, 7.59094026e-01, 7.69074926e-01, 7.79055825e-01, 7.89036725e-01, 7.99017624e-01, 8.08998523e-01, 8.18979423e-01, 8.28960322e-01, 8.38941222e-01, 8.48922121e-01, 8.58903020e-01, 8.68883920e-01, 8.78864819e-01, 8.88845718e-01, 8.98826618e-01, 9.08807517e-01, 9.18788417e-01, 9.28769316e-01, 9.38750215e-01, 9.48731115e-01, 9.58712014e-01, 9.68692914e-01, 9.78673813e-01, 9.88654712e-01, 9.98635612e-01]) - y(y [bin-edge])float64m0.001, 0.011, ..., 0.987, 0.997
Values:
array([9.02154077e-04, 1.08670692e-02, 2.08319843e-02, 3.07968994e-02, 4.07618145e-02, 5.07267296e-02, 6.06916446e-02, 7.06565597e-02, 8.06214748e-02, 9.05863899e-02, 1.00551305e-01, 1.10516220e-01, 1.20481135e-01, 1.30446050e-01, 1.40410965e-01, 1.50375881e-01, 1.60340796e-01, 1.70305711e-01, 1.80270626e-01, 1.90235541e-01, 2.00200456e-01, 2.10165371e-01, 2.20130286e-01, 2.30095201e-01, 2.40060116e-01, 2.50025031e-01, 2.59989947e-01, 2.69954862e-01, 2.79919777e-01, 2.89884692e-01, 2.99849607e-01, 3.09814522e-01, 3.19779437e-01, 3.29744352e-01, 3.39709267e-01, 3.49674182e-01, 3.59639098e-01, 3.69604013e-01, 3.79568928e-01, 3.89533843e-01, 3.99498758e-01, 4.09463673e-01, 4.19428588e-01, 4.29393503e-01, 4.39358418e-01, 4.49323333e-01, 4.59288248e-01, 4.69253164e-01, 4.79218079e-01, 4.89182994e-01, 4.99147909e-01, 5.09112824e-01, 5.19077739e-01, 5.29042654e-01, 5.39007569e-01, 5.48972484e-01, 5.58937399e-01, 5.68902315e-01, 5.78867230e-01, 5.88832145e-01, 5.98797060e-01, 6.08761975e-01, 6.18726890e-01, 6.28691805e-01, 6.38656720e-01, 6.48621635e-01, 6.58586550e-01, 6.68551465e-01, 6.78516381e-01, 6.88481296e-01, 6.98446211e-01, 7.08411126e-01, 7.18376041e-01, 7.28340956e-01, 7.38305871e-01, 7.48270786e-01, 7.58235701e-01, 7.68200616e-01, 7.78165532e-01, 7.88130447e-01, 7.98095362e-01, 8.08060277e-01, 8.18025192e-01, 8.27990107e-01, 8.37955022e-01, 8.47919937e-01, 8.57884852e-01, 8.67849767e-01, 8.77814682e-01, 8.87779598e-01, 8.97744513e-01, 9.07709428e-01, 9.17674343e-01, 9.27639258e-01, 9.37604173e-01, 9.47569088e-01, 9.57534003e-01, 9.67498918e-01, 9.77463833e-01, 9.87428749e-01, 9.97393664e-01])
- (y, x2)DataArrayViewbinned data [len=0, len=0, ..., len=0, len=0]
Values:
[<scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] , <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] , ..., <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] , <scipp.DataArray> Dimensions: Sizes[row:0, ] Coordinates: x float64 [m] (row) [] y float64 [m] (row) [] z float64 [m] (row) [] Data: float64 [K] (row) [] ]