# Multi-dimensional datasets#

This is the continuation of 1-D datasets and tables.

## Creation, slicing, and visualization#

[1]:

import numpy as np
import scipp as sc


To create variables with more than one dimension we specify a list of dimension labels and provide data with a corresponding shape. When inserted into a dataset it is important to note that while the dimensions extents have to match, individual variables may have transposed memory layout.

[2]:

d = sc.Dataset(
data={
'alice': sc.Variable(dims=['z', 'y', 'x'], values=np.random.rand(10, 10, 10),
variances=0.1*np.random.rand(10, 10, 10)),
'bob': sc.Variable(dims=['x', 'z'], values=np.arange(0.0, 10.0, 0.1).reshape(10, 10),
variances=0.1*np.random.rand(10, 10))
},
coords={
'x': sc.arange('x', 11.0, unit=sc.units.m),
'y': sc.arange('y', 11.0, unit=sc.units.m),
'z': sc.arange('z', 11.0, unit=sc.units.m)})


Note that in this example the coordinates are exceeding the shape of the data by 1. This means that the coordinates represent bin edges:

[3]:

sc.show(d)
d

[3]:

scipp.Dataset (17.45 KB)
• z: 10
• y: 10
• x: 10
• x
(x [bin-edge])
float64
m
0.0, 1.0, ..., 9.0, 10.0
Values:array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])
• y
(y [bin-edge])
float64
m
0.0, 1.0, ..., 9.0, 10.0
Values:array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])
• z
(z [bin-edge])
float64
m
0.0, 1.0, ..., 9.0, 10.0
Values:array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])
• alice
(z, y, x)
float64
𝟙
0.471, 0.459, ..., 0.305, 0.473
σ = 0.171, 0.242, ..., 0.063, 0.302
Values:array([[[0.47109067, 0.45877841, 0.85186923, 0.66929677, 0.14151467,
0.48917051, 0.4118433 , 0.78140959, 0.74166729, 0.77362883],
[0.04846401, 0.10108144, 0.7089457 , 0.91911504, 0.73809775,
0.85012461, 0.74545411, 0.75620903, 0.13348741, 0.72903957],
[0.56478438, 0.27409736, 0.35104106, 0.86450286, 0.51978711,
0.93703231, 0.87239095, 0.21176923, 0.38220055, 0.74785516],
[0.72256232, 0.99473657, 0.73975295, 0.235806  , 0.34355599,
0.20998788, 0.61481375, 0.00702423, 0.87991207, 0.44037361],
[0.474793  , 0.22556159, 0.65809512, 0.45048487, 0.62711038,
0.12000584, 0.17497947, 0.51501479, 0.33554694, 0.66626186],
[0.22333523, 0.34319326, 0.86549972, 0.38484612, 0.41805871,
0.98418798, 0.72139829, 0.99374525, 0.41068336, 0.32790051],
[0.79839803, 0.49281332, 0.27113032, 0.84679068, 0.01066074,
0.26490102, 0.82540913, 0.60962152, 0.53674712, 0.83961841],
[0.93212127, 0.91397899, 0.71243192, 0.41782424, 0.64807319,
0.49524314, 0.30455538, 0.49957207, 0.5763791 , 0.54435636],
[0.51914717, 0.51382035, 0.85232577, 0.17488731, 0.13232155,
0.3247343 , 0.5948792 , 0.80709306, 0.79565649, 0.61692386],
[0.91262297, 0.04093831, 0.32848939, 0.53767166, 0.68546924,
0.36585831, 0.7394875 , 0.94216499, 0.13970512, 0.50350896]],

[[0.99893278, 0.14233182, 0.85884531, 0.09350694, 0.87217538,
0.30494587, 0.68980215, 0.13050979, 0.11867328, 0.49610446],
[0.59649317, 0.61708593, 0.78244822, 0.90488983, 0.1335663 ,
0.48269325, 0.9214257 , 0.73366102, 0.40117201, 0.79368635],
[0.77973285, 0.90192946, 0.79719211, 0.40990831, 0.19345354,
0.06360675, 0.31030654, 0.28781798, 0.94849828, 0.19688734],
[0.10761639, 0.21826209, 0.97382683, 0.46487429, 0.33117312,
0.85971267, 0.34895589, 0.72602954, 0.00709368, 0.52672938],
[0.17444254, 0.29962666, 0.6501713 , 0.8905504 , 0.02551821,
0.57622525, 0.7757194 , 0.03968142, 0.53066341, 0.7588264 ],
[0.3122962 , 0.10717005, 0.45352703, 0.05553722, 0.80668674,
0.4804522 , 0.98090366, 0.46959505, 0.85625998, 0.46455878],
[0.76563605, 0.47261253, 0.85080417, 0.61064025, 0.82672425,
0.99528451, 0.90047176, 0.82660537, 0.26870664, 0.19979235],
[0.53714728, 0.32870207, 0.68302494, 0.12397878, 0.55502058,
0.77920901, 0.33661481, 0.081261  , 0.67431452, 0.90091978],
[0.52225674, 0.74098856, 0.38629194, 0.51791212, 0.17969521,
0.3398814 , 0.35565032, 0.85762034, 0.91442591, 0.56591733],
[0.58829699, 0.52498537, 0.46124986, 0.26033653, 0.62437424,
0.25384593, 0.04587459, 0.98955799, 0.36056921, 0.08680218]],

[[0.9970612 , 0.84368348, 0.77927996, 0.95780627, 0.85494325,
0.46005107, 0.23395778, 0.11726047, 0.7475999 , 0.13803486],
[0.86265372, 0.91146877, 0.74143507, 0.34495072, 0.01775397,
0.27575765, 0.06906956, 0.60635536, 0.56620348, 0.37286326],
[0.61269165, 0.70099515, 0.43780594, 0.27835778, 0.46270417,
0.41921998, 0.21953438, 0.24512275, 0.48880692, 0.4763311 ],
[0.87770231, 0.86007017, 0.77969277, 0.68486155, 0.24795355,
0.64497097, 0.89708807, 0.98350074, 0.08215356, 0.6613956 ],
[0.64039295, 0.77441472, 0.29179282, 0.7518841 , 0.13269994,
0.88131419, 0.1109402 , 0.14705314, 0.52695049, 0.56133585],
[0.66647103, 0.24727225, 0.72187386, 0.52665091, 0.04231846,
0.70810413, 0.59468456, 0.37090364, 0.92787762, 0.89111922],
[0.19576459, 0.21182642, 0.19973272, 0.81101907, 0.11527907,
0.35090651, 0.87798714, 0.49970072, 0.92589221, 0.4649596 ],
[0.41561793, 0.7540163 , 0.19965832, 0.79404241, 0.80098137,
0.26033202, 0.12457147, 0.99703114, 0.21563464, 0.02150862],
[0.31272845, 0.62247195, 0.79760808, 0.92520467, 0.99641993,
0.40612622, 0.60688079, 0.98238763, 0.85480101, 0.42332493],
[0.46581074, 0.29577593, 0.47667044, 0.27548425, 0.51060077,
0.97075627, 0.8488711 , 0.26522601, 0.11305687, 0.01146336]],

[[0.17782634, 0.95080763, 0.37773216, 0.46938325, 0.30419655,
0.37652262, 0.45891621, 0.5567718 , 0.94380562, 0.10274181],
[0.62155547, 0.33233031, 0.00856265, 0.4736173 , 0.42479114,
0.81113374, 0.04858239, 0.54259939, 0.30560017, 0.0951372 ],
[0.74572808, 0.47979694, 0.57029349, 0.11520492, 0.6289535 ,
0.98277247, 0.28046469, 0.85633736, 0.02334949, 0.63406154],
[0.49822262, 0.15612925, 0.00229134, 0.57237844, 0.25729564,
0.9739921 , 0.03929748, 0.18436251, 0.30730467, 0.26374622],
[0.92091088, 0.62790466, 0.96740188, 0.26914116, 0.41293539,
0.80999339, 0.23810158, 0.13763719, 0.92243888, 0.59590919],
[0.13411047, 0.161882  , 0.82189159, 0.58758478, 0.72094059,
0.20827588, 0.51754579, 0.83750631, 0.708753  , 0.71640419],
[0.25078167, 0.90813467, 0.78471318, 0.51238301, 0.55848026,
0.62574072, 0.50992998, 0.62802126, 0.39200207, 0.6613431 ],
[0.82994302, 0.16540099, 0.0718185 , 0.10014813, 0.84188567,
0.5063503 , 0.57084375, 0.74389897, 0.53418339, 0.27940408],
[0.77957362, 0.45005551, 0.49865176, 0.53076877, 0.32886025,
0.14971971, 0.60552631, 0.95673012, 0.30145396, 0.97136557],
[0.13293205, 0.35960056, 0.15881098, 0.70510685, 0.57251627,
0.92222397, 0.62349007, 0.9849234 , 0.60186279, 0.79716354]],

[[0.93704056, 0.06717168, 0.11403632, 0.61467494, 0.59778584,
0.63451798, 0.83416738, 0.44753583, 0.55679014, 0.09799502],
[0.10663272, 0.4840012 , 0.48134598, 0.71785627, 0.61904897,
0.27801005, 0.18152372, 0.98740144, 0.33876311, 0.48890927],
[0.08303569, 0.66842113, 0.26313179, 0.82479705, 0.82516461,
0.85803522, 0.3005045 , 0.08720443, 0.07824404, 0.24300751],
[0.45678761, 0.3223483 , 0.74906505, 0.74081774, 0.89915748,
0.01462479, 0.07347028, 0.11372431, 0.85957458, 0.8927258 ],
[0.67899412, 0.67049607, 0.95165008, 0.30125612, 0.15060858,
0.84234489, 0.36825633, 0.12469139, 0.39935959, 0.69956099],
[0.35925956, 0.87493492, 0.38585771, 0.34038543, 0.65980752,
0.30562759, 0.90979358, 0.36351335, 0.18796291, 0.18793019],
[0.52518714, 0.25700019, 0.91223489, 0.33887056, 0.30818274,
0.95456926, 0.14244152, 0.32905857, 0.8904143 , 0.09247   ],
[0.23086488, 0.00561723, 0.6467309 , 0.87385421, 0.22710578,
0.3945538 , 0.89221556, 0.11852504, 0.35544087, 0.59247495],
[0.87551155, 0.22842011, 0.79450159, 0.50079247, 0.4046905 ,
0.37789752, 0.54230257, 0.89142923, 0.21405209, 0.46661332],
[0.23393449, 0.83653857, 0.90145123, 0.80544378, 0.0978969 ,
0.36827806, 0.356348  , 0.31911862, 0.02425159, 0.02228716]],

[[0.13825843, 0.83730032, 0.0780138 , 0.78176359, 0.32646375,
0.08947679, 0.81115208, 0.28621587, 0.45185459, 0.59905571],
[0.01518858, 0.87017033, 0.500125  , 0.97232114, 0.38393736,
0.14725712, 0.88237106, 0.45141995, 0.03610044, 0.70207634],
[0.67063318, 0.27383496, 0.12586183, 0.45669656, 0.86058903,
0.56555697, 0.88032478, 0.69705953, 0.82317668, 0.95714871],
[0.89799083, 0.96703651, 0.30015351, 0.72614374, 0.58402418,
0.44679042, 0.99924337, 0.26751926, 0.39980779, 0.77001997],
[0.2225833 , 0.86385264, 0.59197582, 0.01913068, 0.7358064 ,
0.36641943, 0.89935822, 0.72459732, 0.11561008, 0.27698972],
[0.45969206, 0.66721493, 0.33014608, 0.55001787, 0.97989439,
0.07882429, 0.78509672, 0.49897469, 0.26575723, 0.01738949],
[0.63816178, 0.47333769, 0.92412894, 0.44171215, 0.39268112,
0.14106783, 0.28187261, 0.54409986, 0.61987548, 0.24906513],
[0.27872959, 0.42387112, 0.87871886, 0.04282965, 0.10985328,
0.8204305 , 0.42900731, 0.74113135, 0.53317981, 0.24107885],
[0.92869349, 0.85822071, 0.3673351 , 0.00857542, 0.8814249 ,
0.65226995, 0.38344107, 0.42849677, 0.24548654, 0.54653284],
[0.79250805, 0.21361998, 0.26424597, 0.41286264, 0.91511592,
0.15875654, 0.415752  , 0.38858379, 0.78569599, 0.64300786]],

[[0.54056157, 0.15864025, 0.69439406, 0.84538696, 0.94170806,
0.88178933, 0.67371682, 0.82871631, 0.10978749, 0.76308431],
[0.82547645, 0.06961054, 0.99284586, 0.24516656, 0.62083199,
0.31229862, 0.29722081, 0.70607012, 0.06042573, 0.6833117 ],
[0.60914711, 0.95507656, 0.33903738, 0.43471823, 0.18485469,
0.52899508, 0.67301754, 0.18636404, 0.66091273, 0.00861374],
[0.1276016 , 0.30172306, 0.47785371, 0.24462585, 0.26101987,
0.91049741, 0.2557316 , 0.64425081, 0.96474512, 0.64345646],
[0.64708517, 0.41853461, 0.55781273, 0.70369802, 0.86140201,
0.17690403, 0.12306883, 0.7475488 , 0.76642215, 0.05336107],
[0.55616176, 0.94194524, 0.80271388, 0.19677995, 0.77020252,
0.78771412, 0.8698077 , 0.67645248, 0.98310728, 0.04153496],
[0.33277261, 0.83134091, 0.75783719, 0.20595924, 0.63313929,
0.56706556, 0.30781171, 0.55674469, 0.83435468, 0.81402211],
[0.12500021, 0.41543758, 0.3261114 , 0.47801704, 0.54796022,
0.66816054, 0.07036311, 0.94871834, 0.60081107, 0.35840048],
[0.16864992, 0.6790365 , 0.30502117, 0.04710699, 0.60104463,
0.56570506, 0.37623865, 0.29301057, 0.06544349, 0.91136824],
[0.75121751, 0.77273091, 0.2187469 , 0.32715686, 0.84230327,
0.31713085, 0.79797382, 0.2611236 , 0.41789563, 0.82802801]],

[[0.81470208, 0.75675762, 0.70704245, 0.36616034, 0.84647245,
0.85678118, 0.06492674, 0.0538042 , 0.09751642, 0.28665721],
[0.9840828 , 0.98945824, 0.57563255, 0.90276717, 0.11144496,
0.70867938, 0.65785905, 0.13546887, 0.91288459, 0.75726859],
[0.97381061, 0.39270294, 0.24868486, 0.86144634, 0.03652021,
0.78617295, 0.10109003, 0.4000368 , 0.34865954, 0.9975012 ],
[0.15590309, 0.31967047, 0.86235715, 0.1523348 , 0.11139261,
0.79687365, 0.13412415, 0.78232273, 0.88876738, 0.13523795],
[0.81986425, 0.25429505, 0.54418729, 0.16442979, 0.56658632,
0.97145048, 0.87184135, 0.31844947, 0.01847383, 0.01248823],
[0.19833147, 0.93352881, 0.82322724, 0.10273965, 0.50707232,
0.11229547, 0.0557141 , 0.75098846, 0.59742591, 0.33451596],
[0.96495619, 0.10729219, 0.94845642, 0.43161886, 0.13081678,
0.15764996, 0.41575852, 0.95852829, 0.59968505, 0.73267035],
[0.24005306, 0.52840347, 0.65731085, 0.83287641, 0.93211971,
0.51902233, 0.17952639, 0.16186786, 0.58811116, 0.36038361],
[0.67904169, 0.12341329, 0.26506996, 0.19922313, 0.64841674,
0.4768445 , 0.59922737, 0.37918412, 0.02702883, 0.84163949],
[0.94625812, 0.47147525, 0.51772757, 0.75320705, 0.02867371,
0.31281567, 0.72916976, 0.33489445, 0.96476639, 0.8598657 ]],

[[0.11708569, 0.99563631, 0.19266764, 0.10880448, 0.27332903,
0.43979793, 0.83893993, 0.98395535, 0.06046235, 0.414742  ],
[0.18362322, 0.69040503, 0.09935621, 0.645731  , 0.28447595,
0.31383407, 0.63368638, 0.89922576, 0.11810811, 0.11361116],
[0.03026131, 0.45883385, 0.04560085, 0.7717028 , 0.61882672,
0.35658345, 0.57485727, 0.23836391, 0.96670878, 0.85912306],
[0.57744065, 0.09198399, 0.36611333, 0.26537287, 0.89687119,
0.93831415, 0.48010203, 0.09981449, 0.65938348, 0.03729513],
[0.50331555, 0.45452544, 0.09657932, 0.25354714, 0.45359699,
0.3831081 , 0.13914447, 0.5286059 , 0.69745633, 0.11545143],
[0.18548789, 0.83000751, 0.43431762, 0.95171332, 0.08793983,
0.77251382, 0.60448324, 0.94621504, 0.05195769, 0.58783422],
[0.25432456, 0.21415259, 0.14636876, 0.61257898, 0.19506765,
0.62740608, 0.78110269, 0.629794  , 0.43700631, 0.01115804],
[0.88620548, 0.89004206, 0.63846993, 0.98219181, 0.90019355,
0.39798574, 0.2724262 , 0.11740845, 0.27571363, 0.26288225],
[0.28854026, 0.83574649, 0.26173945, 0.39671238, 0.13535391,
0.40299209, 0.60988303, 0.88120396, 0.26069922, 0.92104246],
[0.71959809, 0.8326097 , 0.13766801, 0.63544783, 0.12453783,
0.44244058, 0.68998856, 0.19547411, 0.68160198, 0.24277723]],

[[0.28476359, 0.36615857, 0.32273977, 0.50211882, 0.73697936,
0.92833387, 0.77947261, 0.44064574, 0.84068954, 0.13237581],
[0.31556874, 0.15699738, 0.90852032, 0.44637894, 0.77319963,
0.45749964, 0.72220115, 0.63107125, 0.55206673, 0.89255245],
[0.3612511 , 0.52979152, 0.55544406, 0.81150963, 0.20434055,
0.64255154, 0.40201006, 0.53375132, 0.04433562, 0.64013053],
[0.83118719, 0.27337042, 0.54763211, 0.82311198, 0.18842922,
0.51226   , 0.48620142, 0.16637302, 0.89686171, 0.91321722],
[0.31285015, 0.64298951, 0.2758834 , 0.94977885, 0.19820274,
0.65702345, 0.2457455 , 0.90291553, 0.43894982, 0.03142796],
[0.09587442, 0.03884092, 0.38350186, 0.50149561, 0.336858  ,
0.57007108, 0.31794037, 0.35864286, 0.40852056, 0.53340439],
[0.91729514, 0.10309789, 0.75805302, 0.95614833, 0.57524665,
0.84781489, 0.31915494, 0.59623099, 0.56024013, 0.42906387],
[0.14819743, 0.18277036, 0.80858273, 0.68982895, 0.75526086,
0.01015411, 0.79541647, 0.15515116, 0.34977655, 0.7832099 ],
[0.93089652, 0.73543172, 0.88460678, 0.8498174 , 0.1114521 ,
0.69291797, 0.53412349, 0.09500289, 0.0815263 , 0.20752033],
[0.24765917, 0.28846219, 0.13080715, 0.67098662, 0.94718932,
0.14184888, 0.60838506, 0.54718116, 0.3045554 , 0.47287062]]])Variances (σ²):array([[[2.93221223e-02, 5.83736379e-02, 5.81037943e-02, 1.36366756e-02,
9.31303768e-02, 6.87874759e-02, 9.86456303e-02, 6.62581741e-02,
7.23704061e-02, 1.28330049e-02],
[1.42003936e-02, 9.05600552e-02, 6.86564299e-03, 8.06503467e-02,
4.22559090e-02, 5.93682864e-02, 8.23758886e-02, 1.39073450e-02,
5.22522328e-03, 7.10675535e-02],
[5.71778347e-02, 7.50418926e-02, 9.05954525e-03, 3.50117117e-03,
4.31209278e-02, 7.43169790e-02, 8.74754030e-02, 8.71355872e-02,
7.83003325e-02, 6.92770221e-02],
[9.85406190e-02, 5.19415083e-02, 6.74983708e-02, 3.13063596e-02,
2.88386148e-02, 7.07971031e-02, 6.41189392e-02, 5.79492789e-02,
6.06003885e-02, 4.25176784e-02],
[9.05260673e-02, 4.00190215e-03, 5.21644599e-02, 5.33392730e-02,
6.65447288e-02, 5.85118207e-02, 2.03726001e-02, 6.43046228e-02,
8.77754768e-02, 9.63144755e-02],
[5.65995229e-02, 9.16730425e-02, 1.87412157e-02, 3.79881112e-02,
5.74845744e-04, 5.88540273e-02, 3.55260248e-02, 7.74939920e-02,
8.83440794e-02, 9.42448426e-02],
[1.50039434e-02, 6.12340653e-02, 6.47097251e-02, 1.04429099e-02,
3.18573785e-02, 1.04744409e-03, 7.42848300e-02, 4.27528099e-02,
6.38665200e-02, 5.29908049e-02],
[9.13896655e-02, 1.76550889e-02, 4.73538088e-02, 6.57426010e-02,
2.61705696e-02, 4.30182639e-02, 5.33882585e-02, 3.40258349e-02,
3.87770938e-03, 3.47637115e-02],
[9.38555508e-02, 8.51097538e-02, 1.23589445e-02, 7.65275120e-02,
2.16661551e-02, 3.75698880e-02, 2.94531854e-02, 5.90719008e-02,
4.23759885e-02, 2.99197909e-02],
[4.63521390e-02, 4.36182077e-02, 3.61913049e-02, 6.03878686e-03,
5.35159597e-02, 8.90053421e-02, 3.83750250e-02, 4.75063665e-02,
5.67081517e-02, 6.78647150e-02]],

[[3.78547030e-02, 7.64035253e-02, 9.24183313e-03, 7.02772534e-02,
3.94165349e-02, 8.64960165e-02, 9.13392550e-02, 1.79808806e-02,
4.30464360e-02, 9.85289062e-02],
[5.52429156e-02, 7.03998246e-02, 7.74839451e-02, 4.26043249e-02,
3.28108036e-02, 3.17551690e-02, 2.11268421e-02, 8.59344460e-02,
1.28906280e-02, 8.56661878e-02],
[9.21634970e-02, 3.67731385e-02, 4.42007166e-02, 2.41429128e-02,
9.15373763e-02, 4.51293594e-02, 6.67185973e-02, 9.56377675e-02,
5.09801358e-02, 6.24093200e-02],
[7.39595129e-02, 4.86402910e-03, 2.47627991e-02, 7.18453945e-02,
3.56287513e-02, 5.98174551e-02, 8.70717126e-02, 9.89395402e-02,
9.83505113e-02, 5.68189534e-02],
[6.85204764e-02, 9.87819920e-02, 1.54407279e-02, 2.39074132e-02,
5.41895752e-02, 7.21478266e-03, 3.62289390e-02, 4.96087063e-02,
9.43460833e-02, 9.94856834e-02],
[9.78707264e-02, 2.74605996e-02, 8.30615926e-02, 9.74169964e-02,
9.65053851e-02, 1.50912535e-02, 6.08313219e-02, 9.73878087e-02,
3.62281309e-02, 2.93052396e-02],
[4.04640382e-02, 7.11997154e-02, 5.37996351e-02, 8.22701972e-02,
8.25345416e-02, 4.88393815e-02, 2.56231182e-02, 7.58440131e-02,
3.53682208e-03, 9.58292352e-02],
[3.05824676e-02, 2.14723038e-02, 5.01283365e-03, 1.91000457e-02,
3.60502255e-02, 4.81942467e-02, 1.75711017e-03, 8.76034902e-03,
5.87463175e-02, 3.76486989e-02],
[2.34055213e-02, 5.11666437e-02, 4.21419163e-02, 7.97105103e-02,
7.75360159e-02, 3.46863778e-03, 2.01759438e-02, 2.67079712e-02,
1.12202163e-02, 1.36376962e-02],
[5.22661717e-02, 3.21368211e-02, 1.96000147e-04, 1.88419720e-02,
3.64045586e-02, 6.49585746e-02, 6.62566230e-02, 9.54973622e-02,
7.42226483e-02, 2.30190051e-02]],

[[2.31894446e-02, 3.76266149e-02, 4.26638901e-02, 9.47355253e-02,
5.61718747e-02, 5.99237793e-02, 4.41317378e-02, 6.30496245e-02,
7.94678085e-02, 6.71243002e-02],
[9.75480814e-03, 9.88173718e-02, 4.40090287e-02, 3.24906994e-02,
6.01719041e-02, 9.37967982e-02, 7.49568139e-02, 2.40677057e-02,
6.24154541e-02, 6.18417256e-02],
[3.31271403e-02, 9.21462389e-02, 8.40450856e-02, 8.87879121e-02,
3.49164308e-02, 5.13973768e-02, 6.08519176e-02, 4.90390390e-02,
2.93212558e-02, 1.54924483e-02],
[8.71001662e-02, 7.71910305e-02, 3.83181612e-02, 2.75648115e-02,
1.94875829e-02, 4.39087563e-02, 4.16472927e-02, 2.14178551e-02,
4.48547008e-02, 9.87823243e-02],
[2.34529733e-02, 1.19316410e-02, 9.32958685e-02, 5.54794272e-03,
1.78533960e-02, 8.02772623e-02, 7.84255290e-02, 7.03567373e-02,
4.86507822e-02, 5.95654231e-02],
[4.78083401e-02, 6.09068863e-03, 6.56808720e-02, 6.47482844e-02,
7.19594184e-02, 3.28516230e-03, 1.75692803e-02, 3.38335973e-02,
7.26850613e-02, 6.52226791e-02],
[7.12488518e-03, 3.03444744e-02, 4.32126010e-02, 8.04152255e-03,
4.27716292e-02, 6.19276170e-02, 8.45851689e-02, 9.01193382e-02,
8.60868815e-02, 6.94023581e-02],
[3.37154868e-02, 8.40882408e-02, 9.45969710e-02, 1.75237421e-02,
7.92743268e-02, 2.73147596e-03, 1.53446306e-02, 6.21009232e-02,
3.58570486e-02, 8.84939309e-02],
[7.49984476e-02, 1.50419021e-02, 8.92136842e-02, 9.29959670e-02,
2.81691780e-02, 3.30093341e-02, 3.45254783e-02, 7.86629342e-02,
3.25553632e-02, 7.69726703e-02],
[6.11721252e-02, 6.03845177e-03, 8.85814121e-02, 7.93275106e-02,
3.39273575e-02, 6.23280296e-02, 9.36050748e-02, 1.40843462e-02,
9.03704468e-02, 2.53040924e-02]],

[[8.40201893e-04, 9.73632095e-03, 3.68231024e-03, 2.66278010e-02,
4.64872799e-02, 9.60785196e-02, 1.92602504e-02, 3.29739982e-02,
3.52599548e-02, 6.32970949e-02],
[5.45801437e-02, 9.74239262e-02, 1.87065619e-02, 2.62643206e-02,
6.73086841e-02, 1.77741256e-02, 9.24147883e-02, 5.74717148e-02,
8.39718774e-02, 5.14998869e-02],
[5.84198563e-02, 9.18834578e-02, 5.10581528e-02, 4.52009629e-02,
5.55465752e-02, 8.93523748e-02, 6.34855775e-02, 8.14630028e-02,
8.73764191e-02, 1.00507941e-02],
[4.17245543e-02, 8.23910774e-02, 2.66020081e-02, 6.96455623e-03,
7.28410657e-02, 8.73408516e-02, 4.06382842e-02, 1.07912770e-02,
6.77024319e-02, 7.03161839e-02],
[1.93655183e-02, 9.33894180e-02, 8.38046129e-02, 2.54002957e-02,
2.62024790e-02, 2.94543315e-02, 3.41078176e-02, 3.55361156e-02,
3.51586666e-02, 1.02851554e-02],
[6.14503095e-02, 7.69585304e-02, 2.04054286e-02, 2.48002834e-02,
1.40902412e-03, 8.87295446e-02, 1.78015103e-02, 6.53874400e-02,
3.20434847e-02, 2.60421404e-02],
[6.16059635e-02, 9.99599862e-02, 4.97896779e-02, 6.01580767e-02,
7.62150329e-02, 9.34239107e-02, 5.78797994e-02, 5.56854043e-02,
5.87039636e-02, 5.53122172e-02],
[7.75602528e-02, 5.90062185e-02, 6.43362566e-02, 4.49483368e-02,
1.75959469e-02, 8.07865107e-02, 3.37655293e-03, 7.55204680e-02,
7.82037766e-02, 8.92745294e-02],
[6.98494657e-02, 3.48099429e-02, 5.78754368e-02, 1.17764706e-02,
7.82514819e-02, 2.08923092e-02, 8.55871663e-02, 9.42595060e-02,
8.22548351e-02, 2.46679039e-02],
[1.56732614e-02, 9.52818284e-02, 8.94090498e-02, 3.85595144e-03,
9.74452440e-02, 7.45065790e-02, 7.24242515e-02, 4.75472539e-02,
8.13816866e-02, 5.29270470e-02]],

[[5.44618126e-02, 5.87784793e-02, 1.97041596e-02, 2.33824310e-02,
2.06717049e-02, 9.73569772e-02, 4.42758889e-02, 4.59186188e-02,
9.92116591e-02, 3.54634178e-02],
[6.25327544e-03, 9.33155440e-02, 3.66764755e-02, 9.86515287e-03,
2.75428488e-02, 7.37591655e-02, 7.79009866e-02, 2.37705251e-02,
1.70304284e-02, 3.30960219e-02],
[5.36785708e-02, 9.50180712e-02, 3.83522849e-03, 4.86653367e-02,
3.74822323e-02, 1.24984820e-02, 4.77063376e-02, 5.82145443e-02,
9.23727763e-02, 6.97413623e-02],
[6.59751983e-02, 1.39456405e-03, 8.55946133e-02, 8.38060790e-02,
4.82060392e-02, 6.58094256e-02, 3.96099075e-03, 4.87261664e-02,
9.80765734e-02, 3.90091224e-02],
[3.23149363e-02, 7.15641339e-02, 7.34498740e-02, 9.90844108e-02,
5.91163473e-02, 7.08408497e-02, 7.59388178e-02, 9.98909635e-02,
7.51941423e-02, 8.46109575e-02],
[4.31293270e-02, 5.39679254e-03, 5.66727121e-02, 9.83005381e-02,
8.91442207e-02, 4.16245084e-02, 2.47064841e-02, 6.01249624e-02,
1.64547490e-02, 8.22981988e-02],
[7.42811760e-02, 8.26070660e-02, 6.34818372e-02, 8.03174026e-02,
6.88967942e-02, 5.08226246e-02, 1.27426914e-02, 9.18718989e-02,
2.20569879e-02, 2.44674452e-02],
[5.11759528e-02, 9.61205207e-02, 5.51415052e-02, 6.66979902e-02,
8.14761215e-02, 1.42135948e-02, 4.87825545e-02, 5.58236865e-02,
7.96533471e-04, 8.22693159e-02],
[3.86328395e-03, 9.66478325e-02, 1.34059702e-02, 6.18507806e-02,
7.29655305e-03, 1.60676724e-02, 8.48181303e-02, 9.10599842e-02,
5.50595289e-02, 1.93910252e-02],
[8.58736502e-02, 6.91288499e-02, 3.58113165e-02, 5.00612685e-02,
1.30971088e-02, 8.49915737e-02, 5.24893840e-02, 5.06686624e-02,
5.57189950e-02, 7.29810993e-02]],

[[8.53336146e-02, 1.23994336e-02, 4.24871187e-02, 6.09169186e-02,
5.68926233e-02, 5.78124921e-02, 4.81002611e-02, 4.88918196e-02,
8.87157721e-03, 7.25975842e-02],
[4.92302741e-02, 4.46917755e-02, 8.57636274e-02, 7.01744367e-02,
9.31724095e-02, 1.75288246e-02, 7.04947404e-02, 3.08914352e-02,
3.93350886e-02, 9.19076951e-02],
[6.53050858e-03, 8.64281160e-03, 2.47036051e-02, 7.66590122e-02,
3.11808036e-02, 1.48254747e-02, 5.12749875e-02, 3.58048919e-02,
1.23803542e-02, 1.26233767e-02],
[4.24050190e-02, 1.44132944e-02, 1.83975069e-02, 5.57966202e-02,
3.91014053e-02, 5.21692911e-02, 7.86728493e-02, 8.58381811e-02,
2.75041784e-02, 3.35076719e-02],
[8.51399692e-02, 9.00259546e-02, 8.52933265e-02, 4.48436516e-02,
4.62444488e-02, 5.79978820e-02, 1.32743980e-02, 4.24950111e-02,
2.73870228e-02, 3.64594766e-02],
[9.97263112e-02, 4.42934066e-04, 3.28841012e-02, 6.28518596e-02,
5.34133280e-02, 5.05358983e-02, 7.78917181e-02, 7.01973017e-02,
9.47293171e-02, 3.15552306e-02],
[7.55022472e-02, 7.25227343e-02, 5.52376675e-02, 5.09661582e-02,
5.14373148e-02, 2.45461043e-02, 7.26288827e-02, 2.77410922e-02,
7.14344239e-02, 2.86298734e-02],
[4.09348270e-02, 4.46385583e-02, 3.68813110e-02, 2.75291191e-02,
6.51413562e-02, 9.24598220e-02, 9.46812651e-02, 1.53388262e-03,
7.63409668e-02, 8.60973081e-02],
[4.08050716e-02, 1.00442276e-02, 2.20493025e-02, 7.37943857e-02,
6.76051488e-02, 5.67058932e-02, 6.35113217e-02, 1.57163901e-02,
7.85968256e-03, 4.24258836e-02],
[6.16295272e-02, 3.90024106e-02, 4.53284178e-02, 8.42109772e-02,
2.61951617e-02, 5.71845780e-02, 8.42590691e-02, 2.28846893e-02,
4.39116903e-02, 8.38834989e-02]],

[[5.85985129e-02, 9.07427327e-02, 3.15106509e-02, 7.57486667e-02,
5.20595819e-02, 6.56864528e-02, 8.23388826e-02, 2.84907405e-02,
4.00680882e-02, 1.85308175e-02],
[4.67187273e-02, 6.75552891e-02, 6.12736311e-02, 5.32843604e-04,
2.01343199e-02, 4.91028329e-02, 5.35996987e-03, 1.03216028e-02,
5.61109571e-02, 2.15930083e-02],
[8.63737729e-02, 9.87659431e-02, 6.28839650e-02, 7.00185625e-02,
2.30322525e-02, 9.62298367e-02, 3.83325528e-02, 9.39493492e-02,
2.75909429e-02, 2.18499371e-02],
[8.24388035e-05, 2.16087942e-02, 4.76272573e-02, 5.81685800e-02,
7.92997360e-02, 4.26101205e-02, 5.73722082e-02, 8.80226028e-02,
9.79723152e-02, 1.19177805e-02],
[9.83742999e-02, 4.55607222e-02, 1.30253880e-04, 8.41868427e-03,
4.57247798e-03, 3.80086373e-02, 3.42256618e-02, 3.64221243e-02,
3.03168618e-02, 3.56005995e-04],
[7.97770986e-02, 2.91365218e-02, 7.65952988e-02, 4.61974447e-02,
5.57528293e-02, 6.91292314e-02, 2.90805053e-02, 8.64279369e-02,
9.82726559e-02, 7.46219555e-02],
[2.73069591e-02, 5.46087869e-02, 4.15183797e-02, 8.77596099e-02,
2.61956987e-02, 7.95784486e-02, 3.67314303e-02, 1.10695725e-02,
1.60666366e-02, 3.10431433e-02],
[5.31606476e-02, 6.11641940e-02, 9.18898612e-02, 7.27429408e-02,
2.85242058e-02, 4.52656655e-02, 3.43870677e-02, 1.72142693e-04,
1.22351716e-02, 1.57755087e-02],
[2.24245450e-03, 8.73856756e-02, 9.11405692e-02, 4.45279925e-02,
6.12036533e-02, 4.01742466e-02, 2.62869001e-02, 3.30051536e-02,
7.41340711e-03, 9.44743721e-02],
[9.03103593e-02, 8.12924429e-02, 5.91114708e-02, 7.59910531e-02,
2.85771554e-02, 9.02165097e-02, 9.74473543e-02, 5.89911537e-02,
6.96448238e-04, 6.25953508e-02]],

[[4.73122277e-02, 6.75486200e-02, 4.30529630e-02, 7.88410777e-02,
6.30758357e-02, 6.84974763e-02, 5.52174770e-03, 8.09443837e-02,
9.43621156e-02, 2.34583064e-02],
[7.56371931e-02, 7.12849295e-02, 2.46728666e-02, 7.88877842e-02,
7.19843153e-02, 4.54271909e-02, 4.44044880e-02, 7.37261023e-02,
9.37723201e-02, 8.58705729e-02],
[7.45236108e-02, 7.07061206e-02, 1.34163318e-02, 8.02596528e-02,
4.96210606e-02, 4.52484623e-02, 2.44276994e-02, 2.66068107e-02,
3.27267117e-02, 6.96417341e-02],
[5.52320679e-02, 1.50706979e-02, 6.43708289e-02, 1.27903317e-02,
6.41129564e-03, 2.17742608e-02, 4.49684004e-02, 6.15845901e-02,
9.81713019e-02, 2.28378875e-02],
[7.47496947e-02, 6.74678611e-03, 5.61874579e-02, 6.85014775e-02,
6.33435838e-02, 7.33795402e-02, 4.92450797e-02, 1.56992843e-02,
1.39611352e-02, 7.29637719e-02],
[2.16312926e-03, 9.21258153e-02, 1.63122475e-02, 1.51843443e-02,
6.31191611e-02, 8.08339053e-02, 5.92980766e-02, 4.06866261e-02,
8.17800463e-03, 9.09115609e-02],
[3.43200112e-03, 3.88413719e-02, 4.26645433e-02, 3.51472163e-02,
5.30110317e-02, 1.01111669e-02, 8.99216202e-02, 4.59068564e-02,
9.75787987e-02, 3.34026385e-02],
[1.51124459e-02, 8.35233338e-02, 1.92626350e-02, 1.54837527e-02,
8.87581890e-02, 1.97985387e-03, 6.57245487e-02, 5.28951171e-02,
3.98435373e-02, 9.50898696e-02],
[7.76504627e-05, 3.71434080e-02, 2.09252822e-02, 8.20276566e-02,
2.93894474e-02, 8.05511509e-02, 2.19001157e-02, 1.09210810e-02,
6.07317659e-02, 3.28928638e-03],
[1.36585355e-02, 1.64972782e-02, 8.04687832e-02, 1.01102083e-02,
7.66948818e-02, 9.86050729e-02, 8.57364038e-02, 5.74658294e-02,
2.05028090e-02, 3.13418059e-02]],

[[9.81149634e-02, 2.05216379e-02, 1.30807081e-02, 8.96912530e-02,
1.41606899e-02, 5.33898792e-02, 6.22587344e-02, 9.70995980e-03,
6.84504794e-02, 8.70673511e-02],
[5.71128498e-02, 4.21731650e-02, 7.45710741e-02, 5.97387143e-02,
4.81730474e-02, 8.11264952e-02, 1.00805495e-02, 2.82934864e-02,
6.04778032e-02, 2.89280171e-02],
[2.24550618e-02, 3.79340698e-02, 1.51358239e-02, 5.94124990e-03,
9.87590916e-03, 7.04380977e-02, 9.98955466e-02, 9.27614381e-02,
9.15753480e-02, 3.54107296e-02],
[9.89875094e-02, 1.99805359e-02, 7.82553707e-02, 5.79118910e-02,
1.91082469e-02, 9.01440322e-02, 8.80449765e-02, 4.04603814e-02,
4.49491143e-02, 1.64109722e-02],
[7.50108640e-02, 7.76590803e-02, 2.53077740e-02, 8.43319238e-02,
8.45518098e-02, 4.42782797e-02, 5.18378791e-03, 3.86275678e-02,
3.77105229e-02, 5.17823049e-02],
[2.07610054e-02, 1.86521254e-02, 7.07147612e-02, 8.27652184e-02,
4.17754070e-02, 7.60696321e-02, 3.81865863e-02, 1.72722786e-02,
5.40919969e-02, 5.86024476e-02],
[3.63853049e-02, 9.15010483e-02, 3.81703779e-03, 5.64108016e-02,
9.56948657e-02, 7.84987430e-02, 5.48071169e-02, 6.02078385e-02,
6.91583901e-02, 1.04998286e-02],
[3.46778380e-02, 5.46974663e-02, 4.98878390e-02, 7.21640901e-02,
8.89381797e-02, 9.38398395e-02, 5.25366345e-02, 6.80892129e-02,
2.75390825e-02, 2.69131396e-02],
[1.95002769e-02, 1.49749118e-02, 8.49441564e-02, 5.44822831e-02,
7.45282598e-02, 4.33280900e-02, 2.49695619e-02, 1.49762927e-02,
9.17168998e-02, 8.48158456e-02],
[9.75620316e-02, 3.49540102e-02, 1.18874395e-02, 8.10073028e-03,
4.95598426e-02, 8.99072211e-02, 4.40370586e-02, 9.02554226e-02,
1.48630352e-02, 8.30530168e-02]],

[[8.94203536e-02, 6.54654506e-02, 2.04845813e-02, 9.05859358e-02,
9.54799790e-02, 2.87208116e-02, 2.89310701e-03, 1.05921917e-03,
4.38980956e-02, 7.78943206e-02],
[5.00749131e-02, 3.58585109e-03, 9.23524633e-04, 5.60324896e-02,
4.81492127e-02, 9.71057837e-02, 1.87772426e-02, 8.59008344e-02,
5.21397253e-02, 3.89746664e-02],
[5.55181551e-02, 5.37417433e-02, 8.14763796e-02, 8.74369957e-02,
3.76201503e-02, 7.32358282e-02, 2.88584767e-02, 4.71892220e-02,
4.49917873e-02, 9.28842394e-02],
[4.01482021e-02, 7.09885696e-02, 5.55886768e-02, 5.67316685e-02,
2.30541199e-02, 4.21819843e-02, 4.55367575e-03, 5.09568174e-02,
9.07661510e-02, 9.95973508e-02],
[6.75709073e-02, 1.65659235e-02, 9.80806420e-03, 8.54741659e-02,
8.88024929e-02, 4.05888124e-02, 4.75272008e-02, 5.63802604e-02,
7.16280239e-03, 4.86304158e-02],
[3.52309572e-02, 5.88238845e-02, 8.62916312e-02, 9.54603744e-02,
6.18382060e-02, 7.34177579e-02, 6.31891581e-02, 4.62929240e-02,
3.74245035e-02, 7.76723990e-02],
[2.58312050e-03, 5.39555245e-02, 5.45345664e-02, 7.55081810e-02,
2.86915213e-02, 6.40332917e-03, 2.08496910e-02, 7.84056912e-02,
5.84505984e-02, 1.33805820e-02],
[1.77656903e-02, 9.69590191e-03, 8.43313167e-02, 7.15422142e-02,
1.66329268e-02, 1.01931576e-02, 6.76671778e-02, 9.33407068e-02,
5.00919023e-02, 4.01598036e-02],
[6.19137070e-02, 4.54855878e-02, 7.18676616e-02, 1.83897858e-02,
5.79676444e-02, 3.97720377e-02, 2.21075573e-02, 2.70861222e-02,
8.20215608e-02, 3.30623374e-02],
[9.38581331e-02, 7.53342394e-02, 6.33222434e-02, 5.06113563e-02,
2.33692417e-02, 2.67073904e-04, 4.81565095e-02, 7.14925177e-02,
4.00755080e-03, 9.14325196e-02]]])
• bob
(x, z)
float64
𝟙
0.0, 0.1, ..., 9.8, 9.9
σ = 0.245, 0.282, ..., 0.278, 0.271
Values:array([[0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
[1. , 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9],
[2. , 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9],
[3. , 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9],
[4. , 4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8, 4.9],
[5. , 5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9],
[6. , 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 6.9],
[7. , 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9],
[8. , 8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8, 8.9],
[9. , 9.1, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 9.9]])Variances (σ²):array([[0.06009376, 0.07954659, 0.01266846, 0.01032734, 0.06003846,
0.06272304, 0.0983202 , 0.04612469, 0.09811105, 0.00643278],
[0.03602549, 0.03749174, 0.01438478, 0.03231173, 0.07605514,
0.06201856, 0.05207678, 0.05535868, 0.06400324, 0.04669692],
[0.00634942, 0.01671446, 0.03778454, 0.08780816, 0.09801152,
0.01717516, 0.09556081, 0.09517192, 0.015428  , 0.00212398],
[0.04769662, 0.00572146, 0.04607225, 0.04012155, 0.07212165,
0.0202306 , 0.0566836 , 0.03580939, 0.06772616, 0.04103869],
[0.01514882, 0.01739261, 0.09021325, 0.08978755, 0.05570573,
0.01655166, 0.0767639 , 0.05976336, 0.04403937, 0.01849107],
[0.01155231, 0.09013935, 0.04039127, 0.08541436, 0.00369746,
0.04855942, 0.06641958, 0.09125777, 0.09108691, 0.04385336],
[0.02885948, 0.00362106, 0.039537  , 0.03359937, 0.04770215,
0.00492679, 0.03661642, 0.02638803, 0.07960807, 0.08796137],
[0.0998241 , 0.03952582, 0.0332016 , 0.0260433 , 0.01135412,
0.05763856, 0.02449758, 0.06898107, 0.06802092, 0.05648043],
[0.06024752, 0.04263125, 0.04617574, 0.01613657, 0.08838462,
0.08377034, 0.07985889, 0.06200791, 0.03636528, 0.03562168],
[0.00312501, 0.04867272, 0.06187251, 0.04166824, 0.09887234,
0.01107812, 0.07859664, 0.01759361, 0.07731071, 0.07330908]])

To slice in multiple dimensions, we can simply chain the slicing notation used previously for 1D data. This gives us a number of different options for visualizing our data:

[4]:

sc.table(d['x', 5]['z', 2])


We can plot and item of a Dataset using:

[5]:

sc.plot(d['bob'])


Plotting a 3-dimensional data cube will show a 2D image with a slider to navigate through the third dimension (note that interactive sliders will only appear in a Jupyter notebook and not in the documentation pages):

[6]:

sc.plot(d['alice'])


Finally, by extracting a 1D variable, we obtain a 1D plot:

[7]:

sc.plot(d['x', 8]['y', 2])


Note that this is now plotted as a histogram since the coordinate in the dataset represents bin edges, in contrast to the 1D data plotted in 1-D datasets and tables.

Operations automatically broadcast based on dimension labels. That is, if one of the operands lacks one (or multiple) dimensions that the other operands have, the operand is considered constant along those dimensions. Its values are implicitly “duplicated” so the shape matches. In contrast to numpy or MATLAB there is no need to keep track of dimension order:

[8]:

d['alice'] -= d['bob']
d['alice'] -= d['alice']['y', 5]
sc.plot(d['alice']['x', 4])


### Exercise 1#

Remove the X and Z surface layer of the volume, i.e., remove the first and last slice in each of the dimensions 'x' and 'z'.

### Solution 1#

[9]:

d = d['x', 1:-1]['z', 1:-1].copy()
d

[9]:

scipp.Dataset (11.23 KB)
• z: 8
• y: 10
• x: 8
• x
(x [bin-edge])
float64
m
1.0, 2.0, ..., 8.0, 9.0
Values:array([1., 2., 3., 4., 5., 6., 7., 8., 9.])
• y
(y [bin-edge])
float64
m
0.0, 1.0, ..., 9.0, 10.0
Values:array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])
• z
(z [bin-edge])
float64
m
1.0, 2.0, ..., 8.0, 9.0
Values:array([1., 2., 3., 4., 5., 6., 7., 8., 9.])
• alice
(z, y, x)
float64
𝟙
0.035, 0.405, ..., -0.751, 0.630
σ = 0.423, 0.355, ..., 0.494, 0.376
Values:array([[[ 0.03516177,  0.40531828,  0.03796971,  0.06548864,
-0.17550633, -0.29110151, -0.33908526, -0.7375867 ],
[ 0.50991588,  0.32892119,  0.84935261, -0.67312044,
0.00224105, -0.05947797,  0.26406597, -0.45508797],
[ 0.7947594 ,  0.34366508,  0.35437109, -0.6132332 ,
-0.41684546, -0.67059713, -0.18177707,  0.09223831],
[ 0.11109204,  0.5202998 ,  0.40933706, -0.47551362,
0.37926047, -0.63194777,  0.25643449, -0.8491663 ],
[ 0.1924566 ,  0.19664427,  0.83501317, -0.78116853,
0.09577305, -0.20518426, -0.42991363, -0.32559657],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[ 0.36544247,  0.39727714,  0.55510302,  0.02003751,
0.5148323 , -0.0804319 ,  0.35701032, -0.58755333],
[ 0.22153202,  0.22949791,  0.06844155, -0.25166616,
0.29875681, -0.64428885, -0.38833405, -0.18194546],
[ 0.63381851, -0.06723509,  0.4623749 , -0.62699153,
-0.14057081, -0.62525335,  0.38802529,  0.05816594],
[ 0.41781532,  0.00772283,  0.20479931, -0.1823125 ,
-0.22660628, -0.93502907,  0.51996294, -0.49569077]],

[[ 0.59641123,  0.05740611,  0.43115536,  0.81262478,
-0.24805306, -0.36072678, -0.25364316, -0.18027772],
[ 0.66419652,  0.01956121, -0.18170019, -0.0245645 ,
-0.43234648, -0.525615  ,  0.23545172, -0.36167414],
[ 0.4537229 , -0.28406792, -0.24829313,  0.42038571,
-0.28888415, -0.37515018, -0.12578088, -0.43907069],
[ 0.61279792,  0.05781891,  0.15821064,  0.20563508,
-0.06313315,  0.30240351,  0.6125971 , -0.84572405],
[ 0.52714247, -0.43008103,  0.22523319,  0.09038148,
0.17321006, -0.48374436, -0.22385049, -0.40092713],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.03544583, -0.52214114,  0.28436816,  0.07296061,
-0.35719761,  0.28330258,  0.12879708, -0.0019854 ],
[ 0.50674405, -0.52221554,  0.2673915 ,  0.75866291,
-0.4477721 , -0.47011309,  0.62612751, -0.71224297],
[ 0.3751997 ,  0.07573423,  0.39855376,  0.95410147,
-0.30197791,  0.01219623,  0.61148399, -0.07307661],
[ 0.04850368, -0.24520342, -0.25116666,  0.46828231,
0.26265214,  0.25418654, -0.10567762, -0.81482074]],

[[ 0.78892564, -0.44415943, -0.11820153, -0.41674404,
0.16824674, -0.05862958, -0.28073451,  0.23505262],
[ 0.17044831, -0.81332894, -0.11396748, -0.29614946,
0.60285786, -0.4689634 , -0.29490692, -0.40315284],
[ 0.31791494, -0.2515981 , -0.47237986, -0.09198709,
0.77449659, -0.2370811 ,  0.01883105, -0.68540351],
[-0.00575275, -0.81960025, -0.01520634, -0.46364495,
0.76571622, -0.4782483 , -0.6531438 , -0.40144833],
[ 0.46602266,  0.14551029, -0.31844362, -0.30800521,
0.60171752, -0.27944421, -0.69986912,  0.21368588],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[ 0.74625268, -0.03717841, -0.07520177, -0.16246033,
0.41746484, -0.00761581, -0.20948505, -0.31675093],
[ 0.00351899, -0.75007309, -0.48743665,  0.12094507,
0.29807443,  0.05329796, -0.09360734, -0.17456961],
[ 0.28817351, -0.32323983, -0.05681601, -0.39208034,
-0.05855617,  0.08798052,  0.11922381, -0.40729905],
[ 0.19771857, -0.66308061,  0.11752207, -0.14842433,
0.71394809,  0.10594429,  0.14741709, -0.10689021]],

[[-0.80776324, -0.2718214 ,  0.27428951, -0.06202169,
0.32889038, -0.0756262 ,  0.08402247,  0.36882723],
[-0.39093372,  0.09548826,  0.37747084, -0.04075856,
-0.02761754, -0.72826986,  0.62388809,  0.1508002 ],
[-0.20651379, -0.12272592,  0.48441162,  0.16535708,
0.55240763, -0.60928908, -0.27630892, -0.10971887],
[-0.55258662,  0.36320734,  0.40043231,  0.23934996,
-0.2910028 , -0.8363233 , -0.24978905,  0.67161167],
[-0.20443885,  0.56579237, -0.03912932, -0.50919894,
0.5367173 , -0.54153725, -0.23882196,  0.21139668],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.61793472,  0.52637718, -0.00151487, -0.35162478,
0.64894167, -0.76735206, -0.03445478,  0.70245139],
[-0.86931768,  0.26087318,  0.53346878, -0.43270175,
0.08892621, -0.01757802, -0.24498831,  0.16747796],
[-0.6465148 ,  0.40864387,  0.16040704, -0.25511702,
0.07226993, -0.36749101,  0.52791588,  0.02608918],
[-0.03839635,  0.51559352,  0.46505835, -0.56191062,
0.06265047, -0.55344558, -0.04439473, -0.16371132]],

[[ 0.17008539, -0.25213228,  0.23174572, -0.65343064,
0.0106525 ,  0.02605536, -0.21275881,  0.18609736],
[ 0.20295539,  0.16997892,  0.42230327, -0.59595703,
0.06843284,  0.09727434, -0.04755473, -0.22965679],
[-0.39337997, -0.20428425, -0.09332131, -0.11930536,
0.48673268,  0.09522806,  0.19808485,  0.55741945],
[ 0.29982157, -0.02999257,  0.17612586, -0.39587021,
0.36796614,  0.21414665, -0.23145543,  0.13405056],
[ 0.19663771,  0.26182973, -0.5308872 , -0.24408799,
0.28759514,  0.1142615 ,  0.22562264, -0.15014715],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.19387725,  0.59398285, -0.10830572, -0.58721327,
0.06224355, -0.50322411,  0.04512517,  0.35411825],
[-0.24334382,  0.54857278, -0.50718822, -0.87004111,
0.74160622, -0.35608941,  0.24215666,  0.26742258],
[ 0.19100578,  0.03718902, -0.54144245, -0.09846949,
0.57344566, -0.40165565, -0.07047791, -0.02027069],
[-0.45359495, -0.06590011, -0.13715523, -0.06477846,
0.07993225, -0.36934472, -0.1103909 ,  0.51993876]],

[[-0.78330499, -0.10831982,  0.64860701,  0.17150554,
0.09407522, -0.19609089,  0.15226383, -0.87331979],
[-0.87233471,  0.19013198,  0.04838661, -0.14937053,
-0.47541549, -0.57258689,  0.02961764, -0.92268155],
[ 0.01313132, -0.4636765 ,  0.23793829, -0.58534783,
-0.25871904, -0.19679016, -0.49008845, -0.32219455],
[-0.64022218, -0.32486017,  0.0478459 , -0.50918265,
0.1227833 , -0.6140761 , -0.03220167, -0.01836216],
[-0.52341064, -0.24490115,  0.50691808,  0.09119949,
-0.61081009, -0.74673888,  0.07109632, -0.21668512],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.11060433, -0.04487669,  0.0091793 , -0.13706323,
-0.22064856, -0.56199599, -0.1197078 , -0.1487526 ],
[-0.52650767, -0.47660248,  0.2812371 , -0.2222423 ,
-0.11955357, -0.79944459,  0.27226585, -0.3822962 ],
[-0.26290874, -0.49769271, -0.14967295, -0.16915789,
-0.22200906, -0.49356905, -0.38344191, -0.91766378],
[-0.16921433, -0.58396698,  0.13037692,  0.07210075,
-0.47058327, -0.07183389, -0.41532889, -0.56521165]],

[[-0.17677119, -0.11618479,  0.26342069,  0.33940013,
0.74448571,  0.00921263, -0.69718426, -0.49990949],
[ 0.05592944, -0.24759469,  0.80002752, -0.39562737,
0.5963839 ,  0.60214495, -0.61551959,  0.31545868],
[-0.54082586, -0.57454239,  0.75870669, -0.47055211,
0.67387748,  0.04537592, -0.35095165, -0.24876636],
[-0.61385834,  0.03912991,  0.04959515, -0.39567972,
0.68457818,  0.07841004,  0.03133427,  0.29134147],
[-0.67923376, -0.27903995,  0.06169014,  0.05951399,
0.85915501,  0.81612725, -0.43253899, -0.57895208],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.82623661,  0.12522918,  0.32887921, -0.37625554,
0.04535449,  0.36004442,  0.20753983,  0.00225914],
[-0.40512534, -0.16591639,  0.73013676,  0.42504739,
0.40672686,  0.12381229, -0.5891206 , -0.00931475],
[-0.81011551, -0.55815729,  0.09648348,  0.14134442,
0.36454903,  0.54351327, -0.37180433, -0.57039707],
[-0.46205356, -0.30549967,  0.6504674 , -0.47839861,
0.2005202 ,  0.67345566, -0.41609401,  0.36734048]],

[[ 0.1656288 , -0.24164998, -0.84290885,  0.1853892 ,
-0.33271589,  0.23445669,  0.03774031,  0.00850467],
[-0.13960248, -0.33496141, -0.30598233,  0.19653612,
-0.45867976,  0.02920314, -0.04698928,  0.06615042],
[-0.37117365, -0.38871677, -0.18001052,  0.53088689,
-0.41593037, -0.02962597, -0.70785112,  0.91475109],
[-0.73802352, -0.06820429, -0.68634046,  0.80893136,
0.16580033, -0.12438121, -0.84640055,  0.60742579],
[-0.37548207, -0.3377383 , -0.69816618,  0.36565716,
-0.38940572, -0.46533877, -0.41760914,  0.64549864],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.61585491, -0.28794885, -0.33913435,  0.10712782,
-0.14510774,  0.17661945, -0.31642103,  0.38504862],
[ 0.06003456,  0.20415232,  0.03047849,  0.81225372,
-0.37452808, -0.33205704, -0.82880659,  0.22375594],
[ 0.00573898, -0.17257816, -0.55500094,  0.04741408,
-0.36952173,  0.00539979, -0.06501107,  0.20874154],
[ 0.0026022 , -0.29664961, -0.3162655 ,  0.036598  ,
-0.33007324,  0.08550533, -0.75074093,  0.62964429]]])Variances (σ²):array([[[0.17884761, 0.12573234, 0.17913716, 0.17070713, 0.28186597,
0.1594127 , 0.19442033, 0.16453706],
[0.17284391, 0.19397445, 0.15146423, 0.1641014 , 0.22712513,
0.08920029, 0.26237389, 0.13438126],
[0.13921722, 0.16069123, 0.13300282, 0.22282797, 0.24049932,
0.13479205, 0.27207721, 0.17247076],
[0.10730811, 0.14125331, 0.1807053 , 0.16691935, 0.25518741,
0.15514516, 0.27537899, 0.21984114],
[0.20122608, 0.13193124, 0.13276732, 0.18548017, 0.20258474,
0.10430239, 0.22604815, 0.21583671],
[0.12990468, 0.1995521 , 0.20627691, 0.22779598, 0.21046121,
0.12890477, 0.27382726, 0.15771876],
[0.1736438 , 0.17029014, 0.19113011, 0.21382514, 0.24420934,
0.09369657, 0.25228346, 0.12502745],
[0.12391639, 0.12150334, 0.12795996, 0.16734082, 0.2435642 ,
0.06983056, 0.1851998 , 0.18023695],
[0.15361073, 0.15863243, 0.18857042, 0.20882661, 0.1988386 ,
0.08824939, 0.20314742, 0.13271085],
[0.13458091, 0.11668651, 0.12770188, 0.16769516, 0.26032853,
0.13433007, 0.27193681, 0.19571328]],

[[0.07248686, 0.18391385, 0.25162831, 0.30855779, 0.14399148,
0.14077501, 0.16328642, 0.24450434],
[0.13367761, 0.18525899, 0.18938349, 0.31255782, 0.1778645 ,
0.17160009, 0.12430451, 0.22745199],
[0.12700648, 0.22529504, 0.2456807 , 0.28730235, 0.13546507,
0.15749519, 0.14927584, 0.19435779],
[0.11205127, 0.17956812, 0.1844576 , 0.2718735 , 0.12797645,
0.13829056, 0.12165465, 0.20989124],
[0.04679188, 0.23454583, 0.16244073, 0.27023932, 0.16434496,
0.1750688 , 0.17059354, 0.21368732],
[0.04095093, 0.20693083, 0.22164107, 0.32434534, 0.08735286,
0.11421255, 0.1340704 , 0.2377216 ],
[0.06520471, 0.18446256, 0.16493431, 0.29515755, 0.14599531,
0.18122844, 0.19035614, 0.25112342],
[0.11894848, 0.23584693, 0.17441653, 0.33166025, 0.08679917,
0.1119879 , 0.16233772, 0.20089358],
[0.04990214, 0.23046364, 0.24988876, 0.2805551 , 0.11707703,
0.13116875, 0.17889973, 0.1975919 ],
[0.04089869, 0.22983137, 0.2362203 , 0.28631328, 0.14639573,
0.19024835, 0.11432115, 0.25540698]],

[[0.15131831, 0.19970405, 0.13167118, 0.22747141, 0.35563678,
0.10426051, 0.15044804, 0.09957659],
[0.23900592, 0.2147283 , 0.1313077 , 0.24829281, 0.27733239,
0.17741504, 0.17494575, 0.14828851],
[0.23346545, 0.2470799 , 0.15024434, 0.23653071, 0.34891064,
0.14848583, 0.19893704, 0.15169305],
[0.22397307, 0.22262375, 0.11200794, 0.2538252 , 0.34689912,
0.12563854, 0.12826532, 0.13201907],
[0.23497141, 0.27982636, 0.13044367, 0.20718661, 0.2890126 ,
0.11910807, 0.15301015, 0.0994753 ],
[0.21854052, 0.21642717, 0.12984366, 0.18239315, 0.34828781,
0.10280177, 0.18286148, 0.09636012],
[0.24154198, 0.24581142, 0.16520146, 0.25719916, 0.35298217,
0.14288006, 0.17315944, 0.1230206 ],
[0.20058821, 0.260358  , 0.14999172, 0.19858008, 0.34034477,
0.08837681, 0.19299451, 0.14252041],
[0.17639194, 0.25389718, 0.11681985, 0.25923561, 0.28045057,
0.17058742, 0.21173355, 0.14657147],
[0.23686382, 0.28543079, 0.10889933, 0.27842937, 0.33406484,
0.15742451, 0.16502129, 0.14569832]],

[[0.21628555, 0.27239992, 0.26592627, 0.22122739, 0.14637641,
0.16438667, 0.12875183, 0.29243565],
[0.25082261, 0.28937223, 0.25240899, 0.22809853, 0.1227786 ,
0.19801177, 0.10660374, 0.21025442],
[0.25252514, 0.25653099, 0.29120917, 0.23803792, 0.06151791,
0.16781712, 0.14104776, 0.28559676],
[0.15890163, 0.33829037, 0.32634992, 0.24876172, 0.11482886,
0.12407177, 0.13155938, 0.29130056],
[0.2290712 , 0.32614563, 0.34162825, 0.25967203, 0.11986028,
0.1960496 , 0.18272417, 0.26841813],
[0.16290386, 0.30936847, 0.34084438, 0.2896999 , 0.09064394,
0.14481727, 0.14295817, 0.20967874],
[0.24011413, 0.31617759, 0.32286124, 0.26945248, 0.09984206,
0.13285347, 0.17470511, 0.21528098],
[0.25362759, 0.30783726, 0.30924183, 0.28203181, 0.06323303,
0.16889334, 0.1386569 , 0.19402052],
[0.2541549 , 0.26610173, 0.30439462, 0.20785224, 0.0650871 ,
0.20492891, 0.1738932 , 0.24828352],
[0.22663592, 0.28850707, 0.29260511, 0.21365279, 0.13401101,
0.17260017, 0.13350187, 0.24894298]],

[[0.13687948, 0.10972155, 0.16422998, 0.14340926, 0.20546723,
0.13584556, 0.23436624, 0.27114156],
[0.16917182, 0.15299805, 0.1734875 , 0.17968905, 0.16518357,
0.15824004, 0.21636586, 0.30160508],
[0.13312286, 0.09193803, 0.17997207, 0.11769744, 0.16248022,
0.13902028, 0.22127932, 0.27465034],
[0.13889334, 0.08563193, 0.15910968, 0.12561805, 0.19982403,
0.16641815, 0.27131261, 0.28977417],
[0.214506  , 0.15252775, 0.14815671, 0.13276109, 0.20565262,
0.10101969, 0.22796944, 0.28965701],
[0.12492298, 0.10011853, 0.16616492, 0.13992997, 0.19819064,
0.16563702, 0.25567173, 0.3569993 ],
[0.19700278, 0.12247209, 0.15427922, 0.13795396, 0.17220085,
0.16037418, 0.21321552, 0.33370441],
[0.1691186 , 0.10411574, 0.13084218, 0.151658  , 0.24011456,
0.18242656, 0.18700831, 0.33861095],
[0.13452427, 0.08928373, 0.17710745, 0.15412179, 0.20436064,
0.15125662, 0.20119082, 0.27012967],
[0.16348246, 0.11256284, 0.18752404, 0.1127118 , 0.20483932,
0.17200437, 0.20835911, 0.30618168]],

[[0.22403281, 0.29922756, 0.23531332, 0.26134021, 0.26765484,
0.18465223, 0.16391383, 0.29805853],
[0.20084536, 0.32899054, 0.16009749, 0.22941495, 0.25107122,
0.10767332, 0.1457447 , 0.3141014 ],
[0.23205602, 0.33060088, 0.22958321, 0.23231288, 0.29819823,
0.1406459 , 0.22937244, 0.28558138],
[0.15489887, 0.31534417, 0.21773323, 0.28858036, 0.24457851,
0.15968555, 0.2234457 , 0.35596276],
[0.1788508 , 0.26784717, 0.16798333, 0.21385311, 0.23997703,
0.13653901, 0.17184522, 0.2883073 ],
[0.16242659, 0.34431221, 0.2057621 , 0.26503346, 0.27109762,
0.13139385, 0.22185103, 0.3562631 ],
[0.18789886, 0.30923529, 0.24732426, 0.23547633, 0.28154684,
0.13904478, 0.14649267, 0.27405708],
[0.19445427, 0.35960677, 0.23230759, 0.23780483, 0.24723406,
0.13670041, 0.13559524, 0.27022561],
[0.22067575, 0.35885748, 0.20409264, 0.27048428, 0.24214264,
0.12860025, 0.16842825, 0.26540385],
[0.21458252, 0.32682838, 0.2355557 , 0.23785778, 0.2921849 ,
0.1997607 , 0.19441425, 0.25868689]],

[[0.2703918 , 0.24970905, 0.16564421, 0.24572172, 0.33184692,
0.11759588, 0.25959314, 0.22655594],
[0.27412811, 0.23132896, 0.16569091, 0.2546302 , 0.30877664,
0.15647862, 0.25237486, 0.22596614],
[0.2735493 , 0.22007242, 0.16706278, 0.23226695, 0.30859791,
0.13650183, 0.20525557, 0.16492053],
[0.21791388, 0.27102692, 0.09959346, 0.18905718, 0.28512371,
0.15704253, 0.24023335, 0.23036512],
[0.20958997, 0.26284355, 0.15530461, 0.24598947, 0.33672899,
0.16131921, 0.19434804, 0.14615496],
[0.294969  , 0.22296834, 0.10198747, 0.24576505, 0.34418335,
0.17137221, 0.21933539, 0.14037182],
[0.24168455, 0.24932063, 0.12195035, 0.23565692, 0.27346061,
0.20199575, 0.22455562, 0.22977262],
[0.28636651, 0.22591873, 0.10228688, 0.27140408, 0.2653293 ,
0.17779868, 0.23154388, 0.17203736],
[0.23998659, 0.22758137, 0.16883079, 0.21203534, 0.3439006 ,
0.13397425, 0.18956984, 0.19292559],
[0.21934046, 0.28712487, 0.09691334, 0.25934077, 0.36195452,
0.19781053, 0.23611459, 0.15269663]],

[[0.16718024, 0.11465146, 0.30790879, 0.14401484, 0.31163333,
0.25966147, 0.16302408, 0.19527303],
[0.18883177, 0.17614183, 0.27795626, 0.1780272 , 0.33936994,
0.20748329, 0.1816076 , 0.18730035],
[0.18459267, 0.11670658, 0.22415879, 0.13973006, 0.32868155,
0.29729828, 0.24607555, 0.2183979 ],
[0.16663914, 0.17982612, 0.27612943, 0.1489624 , 0.34838748,
0.28544771, 0.1937745 , 0.17177166],
[0.22431769, 0.12687853, 0.30254947, 0.21440596, 0.30252173,
0.20258652, 0.19194168, 0.16453307],
[0.16531073, 0.17228551, 0.30098276, 0.17162956, 0.33431308,
0.23558932, 0.17058639, 0.18091455],
[0.23815965, 0.10538779, 0.27462834, 0.22554902, 0.33674219,
0.25220985, 0.21352195, 0.19598094],
[0.20135607, 0.15145859, 0.29038163, 0.21879233, 0.35208329,
0.24993937, 0.22140333, 0.15436163],
[0.16163352, 0.18651491, 0.27269982, 0.20438241, 0.30157154,
0.2223723 , 0.16829041, 0.21853945],
[0.18161262, 0.11345819, 0.22631827, 0.179414  , 0.34815067,
0.24143979, 0.24356954, 0.14168558]]])
• bob
(x, z)
float64
𝟙
1.1, 1.200, ..., 8.700, 8.8
σ = 0.194, 0.120, ..., 0.249, 0.191
Values:array([[1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8],
[2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8],
[3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8],
[4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8],
[5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8],
[6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8],
[7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8],
[8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8]])Variances (σ²):array([[0.03749174, 0.01438478, 0.03231173, 0.07605514, 0.06201856,
0.05207678, 0.05535868, 0.06400324],
[0.01671446, 0.03778454, 0.08780816, 0.09801152, 0.01717516,
0.09556081, 0.09517192, 0.015428  ],
[0.00572146, 0.04607225, 0.04012155, 0.07212165, 0.0202306 ,
0.0566836 , 0.03580939, 0.06772616],
[0.01739261, 0.09021325, 0.08978755, 0.05570573, 0.01655166,
0.0767639 , 0.05976336, 0.04403937],
[0.09013935, 0.04039127, 0.08541436, 0.00369746, 0.04855942,
0.06641958, 0.09125777, 0.09108691],
[0.00362106, 0.039537  , 0.03359937, 0.04770215, 0.00492679,
0.03661642, 0.02638803, 0.07960807],
[0.03952582, 0.0332016 , 0.0260433 , 0.01135412, 0.05763856,
0.02449758, 0.06898107, 0.06802092],
[0.04263125, 0.04617574, 0.01613657, 0.08838462, 0.08377034,
0.07985889, 0.06200791, 0.03636528]])

Note the important call to copy(). If we omit it, d will just be a multi-dimensional slice of the larger volume (which is kept alive), wasting memory and preventing further modification, such as insertion of other variables.

Note also that if we had also sliced 'y' the result would not contain the data for 'bob' since this item does not depend on Y.

## More advanced operations with multi-dimensional datasets#

Operations like concat and merge work just like with one-dimensional datasets.

### Exercise 2#

• Try to concatenate the dataset with itself along the X dimensions. Why does this fail?

• Make a copy of the dataset, add an offset to the X coordinate to fix the issue, and try to concatenate again.

### Solution 2#

[10]:

try:
d = sc.concat([d, d], 'x')
except RuntimeError:
print("Failed as expected!")

Failed as expected!


With a data extent of, e.g. 8 in this case, bin edges have extent 9. Naive concatenation would thus lead a new data extent of 16 and a coordinate extent of 18, which is meaningless and thus prevented. In this concat merges the last edge of the first input with the first edge of the second input, if compatible.

[11]:

offset = d.copy()
offset.coords['x'] += sc.scalar(8.0, unit=sc.units.m)
combined = sc.concat([d, offset], 'x')
sc.plot(combined['alice'])


Another available operation is rebin. This is only for count-data or count-density-data, so we have to set an appropriate unit first:

[12]:

d['alice'].unit = sc.units.counts
d['bob'].unit = sc.units.counts


Before rebin we have the following:

[13]:

sc.to_html(d)
sc.plot(d['z', 0])

scipp.Dataset (11.23 KB)
• z: 8
• y: 10
• x: 8
• x
(x [bin-edge])
float64
m
1.0, 2.0, ..., 8.0, 9.0
Values:array([1., 2., 3., 4., 5., 6., 7., 8., 9.])
• y
(y [bin-edge])
float64
m
0.0, 1.0, ..., 9.0, 10.0
Values:array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])
• z
(z [bin-edge])
float64
m
1.0, 2.0, ..., 8.0, 9.0
Values:array([1., 2., 3., 4., 5., 6., 7., 8., 9.])
• alice
(z, y, x)
float64
counts
0.035, 0.405, ..., -0.751, 0.630
σ = 0.423, 0.355, ..., 0.494, 0.376
Values:array([[[ 0.03516177,  0.40531828,  0.03796971,  0.06548864,
-0.17550633, -0.29110151, -0.33908526, -0.7375867 ],
[ 0.50991588,  0.32892119,  0.84935261, -0.67312044,
0.00224105, -0.05947797,  0.26406597, -0.45508797],
[ 0.7947594 ,  0.34366508,  0.35437109, -0.6132332 ,
-0.41684546, -0.67059713, -0.18177707,  0.09223831],
[ 0.11109204,  0.5202998 ,  0.40933706, -0.47551362,
0.37926047, -0.63194777,  0.25643449, -0.8491663 ],
[ 0.1924566 ,  0.19664427,  0.83501317, -0.78116853,
0.09577305, -0.20518426, -0.42991363, -0.32559657],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[ 0.36544247,  0.39727714,  0.55510302,  0.02003751,
0.5148323 , -0.0804319 ,  0.35701032, -0.58755333],
[ 0.22153202,  0.22949791,  0.06844155, -0.25166616,
0.29875681, -0.64428885, -0.38833405, -0.18194546],
[ 0.63381851, -0.06723509,  0.4623749 , -0.62699153,
-0.14057081, -0.62525335,  0.38802529,  0.05816594],
[ 0.41781532,  0.00772283,  0.20479931, -0.1823125 ,
-0.22660628, -0.93502907,  0.51996294, -0.49569077]],

[[ 0.59641123,  0.05740611,  0.43115536,  0.81262478,
-0.24805306, -0.36072678, -0.25364316, -0.18027772],
[ 0.66419652,  0.01956121, -0.18170019, -0.0245645 ,
-0.43234648, -0.525615  ,  0.23545172, -0.36167414],
[ 0.4537229 , -0.28406792, -0.24829313,  0.42038571,
-0.28888415, -0.37515018, -0.12578088, -0.43907069],
[ 0.61279792,  0.05781891,  0.15821064,  0.20563508,
-0.06313315,  0.30240351,  0.6125971 , -0.84572405],
[ 0.52714247, -0.43008103,  0.22523319,  0.09038148,
0.17321006, -0.48374436, -0.22385049, -0.40092713],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.03544583, -0.52214114,  0.28436816,  0.07296061,
-0.35719761,  0.28330258,  0.12879708, -0.0019854 ],
[ 0.50674405, -0.52221554,  0.2673915 ,  0.75866291,
-0.4477721 , -0.47011309,  0.62612751, -0.71224297],
[ 0.3751997 ,  0.07573423,  0.39855376,  0.95410147,
-0.30197791,  0.01219623,  0.61148399, -0.07307661],
[ 0.04850368, -0.24520342, -0.25116666,  0.46828231,
0.26265214,  0.25418654, -0.10567762, -0.81482074]],

[[ 0.78892564, -0.44415943, -0.11820153, -0.41674404,
0.16824674, -0.05862958, -0.28073451,  0.23505262],
[ 0.17044831, -0.81332894, -0.11396748, -0.29614946,
0.60285786, -0.4689634 , -0.29490692, -0.40315284],
[ 0.31791494, -0.2515981 , -0.47237986, -0.09198709,
0.77449659, -0.2370811 ,  0.01883105, -0.68540351],
[-0.00575275, -0.81960025, -0.01520634, -0.46364495,
0.76571622, -0.4782483 , -0.6531438 , -0.40144833],
[ 0.46602266,  0.14551029, -0.31844362, -0.30800521,
0.60171752, -0.27944421, -0.69986912,  0.21368588],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[ 0.74625268, -0.03717841, -0.07520177, -0.16246033,
0.41746484, -0.00761581, -0.20948505, -0.31675093],
[ 0.00351899, -0.75007309, -0.48743665,  0.12094507,
0.29807443,  0.05329796, -0.09360734, -0.17456961],
[ 0.28817351, -0.32323983, -0.05681601, -0.39208034,
-0.05855617,  0.08798052,  0.11922381, -0.40729905],
[ 0.19771857, -0.66308061,  0.11752207, -0.14842433,
0.71394809,  0.10594429,  0.14741709, -0.10689021]],

[[-0.80776324, -0.2718214 ,  0.27428951, -0.06202169,
0.32889038, -0.0756262 ,  0.08402247,  0.36882723],
[-0.39093372,  0.09548826,  0.37747084, -0.04075856,
-0.02761754, -0.72826986,  0.62388809,  0.1508002 ],
[-0.20651379, -0.12272592,  0.48441162,  0.16535708,
0.55240763, -0.60928908, -0.27630892, -0.10971887],
[-0.55258662,  0.36320734,  0.40043231,  0.23934996,
-0.2910028 , -0.8363233 , -0.24978905,  0.67161167],
[-0.20443885,  0.56579237, -0.03912932, -0.50919894,
0.5367173 , -0.54153725, -0.23882196,  0.21139668],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.61793472,  0.52637718, -0.00151487, -0.35162478,
0.64894167, -0.76735206, -0.03445478,  0.70245139],
[-0.86931768,  0.26087318,  0.53346878, -0.43270175,
0.08892621, -0.01757802, -0.24498831,  0.16747796],
[-0.6465148 ,  0.40864387,  0.16040704, -0.25511702,
0.07226993, -0.36749101,  0.52791588,  0.02608918],
[-0.03839635,  0.51559352,  0.46505835, -0.56191062,
0.06265047, -0.55344558, -0.04439473, -0.16371132]],

[[ 0.17008539, -0.25213228,  0.23174572, -0.65343064,
0.0106525 ,  0.02605536, -0.21275881,  0.18609736],
[ 0.20295539,  0.16997892,  0.42230327, -0.59595703,
0.06843284,  0.09727434, -0.04755473, -0.22965679],
[-0.39337997, -0.20428425, -0.09332131, -0.11930536,
0.48673268,  0.09522806,  0.19808485,  0.55741945],
[ 0.29982157, -0.02999257,  0.17612586, -0.39587021,
0.36796614,  0.21414665, -0.23145543,  0.13405056],
[ 0.19663771,  0.26182973, -0.5308872 , -0.24408799,
0.28759514,  0.1142615 ,  0.22562264, -0.15014715],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.19387725,  0.59398285, -0.10830572, -0.58721327,
0.06224355, -0.50322411,  0.04512517,  0.35411825],
[-0.24334382,  0.54857278, -0.50718822, -0.87004111,
0.74160622, -0.35608941,  0.24215666,  0.26742258],
[ 0.19100578,  0.03718902, -0.54144245, -0.09846949,
0.57344566, -0.40165565, -0.07047791, -0.02027069],
[-0.45359495, -0.06590011, -0.13715523, -0.06477846,
0.07993225, -0.36934472, -0.1103909 ,  0.51993876]],

[[-0.78330499, -0.10831982,  0.64860701,  0.17150554,
0.09407522, -0.19609089,  0.15226383, -0.87331979],
[-0.87233471,  0.19013198,  0.04838661, -0.14937053,
-0.47541549, -0.57258689,  0.02961764, -0.92268155],
[ 0.01313132, -0.4636765 ,  0.23793829, -0.58534783,
-0.25871904, -0.19679016, -0.49008845, -0.32219455],
[-0.64022218, -0.32486017,  0.0478459 , -0.50918265,
0.1227833 , -0.6140761 , -0.03220167, -0.01836216],
[-0.52341064, -0.24490115,  0.50691808,  0.09119949,
-0.61081009, -0.74673888,  0.07109632, -0.21668512],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.11060433, -0.04487669,  0.0091793 , -0.13706323,
-0.22064856, -0.56199599, -0.1197078 , -0.1487526 ],
[-0.52650767, -0.47660248,  0.2812371 , -0.2222423 ,
-0.11955357, -0.79944459,  0.27226585, -0.3822962 ],
[-0.26290874, -0.49769271, -0.14967295, -0.16915789,
-0.22200906, -0.49356905, -0.38344191, -0.91766378],
[-0.16921433, -0.58396698,  0.13037692,  0.07210075,
-0.47058327, -0.07183389, -0.41532889, -0.56521165]],

[[-0.17677119, -0.11618479,  0.26342069,  0.33940013,
0.74448571,  0.00921263, -0.69718426, -0.49990949],
[ 0.05592944, -0.24759469,  0.80002752, -0.39562737,
0.5963839 ,  0.60214495, -0.61551959,  0.31545868],
[-0.54082586, -0.57454239,  0.75870669, -0.47055211,
0.67387748,  0.04537592, -0.35095165, -0.24876636],
[-0.61385834,  0.03912991,  0.04959515, -0.39567972,
0.68457818,  0.07841004,  0.03133427,  0.29134147],
[-0.67923376, -0.27903995,  0.06169014,  0.05951399,
0.85915501,  0.81612725, -0.43253899, -0.57895208],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.82623661,  0.12522918,  0.32887921, -0.37625554,
0.04535449,  0.36004442,  0.20753983,  0.00225914],
[-0.40512534, -0.16591639,  0.73013676,  0.42504739,
0.40672686,  0.12381229, -0.5891206 , -0.00931475],
[-0.81011551, -0.55815729,  0.09648348,  0.14134442,
0.36454903,  0.54351327, -0.37180433, -0.57039707],
[-0.46205356, -0.30549967,  0.6504674 , -0.47839861,
0.2005202 ,  0.67345566, -0.41609401,  0.36734048]],

[[ 0.1656288 , -0.24164998, -0.84290885,  0.1853892 ,
-0.33271589,  0.23445669,  0.03774031,  0.00850467],
[-0.13960248, -0.33496141, -0.30598233,  0.19653612,
-0.45867976,  0.02920314, -0.04698928,  0.06615042],
[-0.37117365, -0.38871677, -0.18001052,  0.53088689,
-0.41593037, -0.02962597, -0.70785112,  0.91475109],
[-0.73802352, -0.06820429, -0.68634046,  0.80893136,
0.16580033, -0.12438121, -0.84640055,  0.60742579],
[-0.37548207, -0.3377383 , -0.69816618,  0.36565716,
-0.38940572, -0.46533877, -0.41760914,  0.64549864],
[ 0.        ,  0.        ,  0.        ,  0.        ,
0.        ,  0.        ,  0.        ,  0.        ],
[-0.61585491, -0.28794885, -0.33913435,  0.10712782,
-0.14510774,  0.17661945, -0.31642103,  0.38504862],
[ 0.06003456,  0.20415232,  0.03047849,  0.81225372,
-0.37452808, -0.33205704, -0.82880659,  0.22375594],
[ 0.00573898, -0.17257816, -0.55500094,  0.04741408,
-0.36952173,  0.00539979, -0.06501107,  0.20874154],
[ 0.0026022 , -0.29664961, -0.3162655 ,  0.036598  ,
-0.33007324,  0.08550533, -0.75074093,  0.62964429]]])Variances (σ²):array([[[0.17884761, 0.12573234, 0.17913716, 0.17070713, 0.28186597,
0.1594127 , 0.19442033, 0.16453706],
[0.17284391, 0.19397445, 0.15146423, 0.1641014 , 0.22712513,
0.08920029, 0.26237389, 0.13438126],
[0.13921722, 0.16069123, 0.13300282, 0.22282797, 0.24049932,
0.13479205, 0.27207721, 0.17247076],
[0.10730811, 0.14125331, 0.1807053 , 0.16691935, 0.25518741,
0.15514516, 0.27537899, 0.21984114],
[0.20122608, 0.13193124, 0.13276732, 0.18548017, 0.20258474,
0.10430239, 0.22604815, 0.21583671],
[0.12990468, 0.1995521 , 0.20627691, 0.22779598, 0.21046121,
0.12890477, 0.27382726, 0.15771876],
[0.1736438 , 0.17029014, 0.19113011, 0.21382514, 0.24420934,
0.09369657, 0.25228346, 0.12502745],
[0.12391639, 0.12150334, 0.12795996, 0.16734082, 0.2435642 ,
0.06983056, 0.1851998 , 0.18023695],
[0.15361073, 0.15863243, 0.18857042, 0.20882661, 0.1988386 ,
0.08824939, 0.20314742, 0.13271085],
[0.13458091, 0.11668651, 0.12770188, 0.16769516, 0.26032853,
0.13433007, 0.27193681, 0.19571328]],

[[0.07248686, 0.18391385, 0.25162831, 0.30855779, 0.14399148,
0.14077501, 0.16328642, 0.24450434],
[0.13367761, 0.18525899, 0.18938349, 0.31255782, 0.1778645 ,
0.17160009, 0.12430451, 0.22745199],
[0.12700648, 0.22529504, 0.2456807 , 0.28730235, 0.13546507,
0.15749519, 0.14927584, 0.19435779],
[0.11205127, 0.17956812, 0.1844576 , 0.2718735 , 0.12797645,
0.13829056, 0.12165465, 0.20989124],
[0.04679188, 0.23454583, 0.16244073, 0.27023932, 0.16434496,
0.1750688 , 0.17059354, 0.21368732],
[0.04095093, 0.20693083, 0.22164107, 0.32434534, 0.08735286,
0.11421255, 0.1340704 , 0.2377216 ],
[0.06520471, 0.18446256, 0.16493431, 0.29515755, 0.14599531,
0.18122844, 0.19035614, 0.25112342],
[0.11894848, 0.23584693, 0.17441653, 0.33166025, 0.08679917,
0.1119879 , 0.16233772, 0.20089358],
[0.04990214, 0.23046364, 0.24988876, 0.2805551 , 0.11707703,
0.13116875, 0.17889973, 0.1975919 ],
[0.04089869, 0.22983137, 0.2362203 , 0.28631328, 0.14639573,
0.19024835, 0.11432115, 0.25540698]],

[[0.15131831, 0.19970405, 0.13167118, 0.22747141, 0.35563678,
0.10426051, 0.15044804, 0.09957659],
[0.23900592, 0.2147283 , 0.1313077 , 0.24829281, 0.27733239,
0.17741504, 0.17494575, 0.14828851],
[0.23346545, 0.2470799 , 0.15024434, 0.23653071, 0.34891064,
0.14848583, 0.19893704, 0.15169305],
[0.22397307, 0.22262375, 0.11200794, 0.2538252 , 0.34689912,
0.12563854, 0.12826532, 0.13201907],
[0.23497141, 0.27982636, 0.13044367, 0.20718661, 0.2890126 ,
0.11910807, 0.15301015, 0.0994753 ],
[0.21854052, 0.21642717, 0.12984366, 0.18239315, 0.34828781,
0.10280177, 0.18286148, 0.09636012],
[0.24154198, 0.24581142, 0.16520146, 0.25719916, 0.35298217,
0.14288006, 0.17315944, 0.1230206 ],
[0.20058821, 0.260358  , 0.14999172, 0.19858008, 0.34034477,
0.08837681, 0.19299451, 0.14252041],
[0.17639194, 0.25389718, 0.11681985, 0.25923561, 0.28045057,
0.17058742, 0.21173355, 0.14657147],
[0.23686382, 0.28543079, 0.10889933, 0.27842937, 0.33406484,
0.15742451, 0.16502129, 0.14569832]],

[[0.21628555, 0.27239992, 0.26592627, 0.22122739, 0.14637641,
0.16438667, 0.12875183, 0.29243565],
[0.25082261, 0.28937223, 0.25240899, 0.22809853, 0.1227786 ,
0.19801177, 0.10660374, 0.21025442],
[0.25252514, 0.25653099, 0.29120917, 0.23803792, 0.06151791,
0.16781712, 0.14104776, 0.28559676],
[0.15890163, 0.33829037, 0.32634992, 0.24876172, 0.11482886,
0.12407177, 0.13155938, 0.29130056],
[0.2290712 , 0.32614563, 0.34162825, 0.25967203, 0.11986028,
0.1960496 , 0.18272417, 0.26841813],
[0.16290386, 0.30936847, 0.34084438, 0.2896999 , 0.09064394,
0.14481727, 0.14295817, 0.20967874],
[0.24011413, 0.31617759, 0.32286124, 0.26945248, 0.09984206,
0.13285347, 0.17470511, 0.21528098],
[0.25362759, 0.30783726, 0.30924183, 0.28203181, 0.06323303,
0.16889334, 0.1386569 , 0.19402052],
[0.2541549 , 0.26610173, 0.30439462, 0.20785224, 0.0650871 ,
0.20492891, 0.1738932 , 0.24828352],
[0.22663592, 0.28850707, 0.29260511, 0.21365279, 0.13401101,
0.17260017, 0.13350187, 0.24894298]],

[[0.13687948, 0.10972155, 0.16422998, 0.14340926, 0.20546723,
0.13584556, 0.23436624, 0.27114156],
[0.16917182, 0.15299805, 0.1734875 , 0.17968905, 0.16518357,
0.15824004, 0.21636586, 0.30160508],
[0.13312286, 0.09193803, 0.17997207, 0.11769744, 0.16248022,
0.13902028, 0.22127932, 0.27465034],
[0.13889334, 0.08563193, 0.15910968, 0.12561805, 0.19982403,
0.16641815, 0.27131261, 0.28977417],
[0.214506  , 0.15252775, 0.14815671, 0.13276109, 0.20565262,
0.10101969, 0.22796944, 0.28965701],
[0.12492298, 0.10011853, 0.16616492, 0.13992997, 0.19819064,
0.16563702, 0.25567173, 0.3569993 ],
[0.19700278, 0.12247209, 0.15427922, 0.13795396, 0.17220085,
0.16037418, 0.21321552, 0.33370441],
[0.1691186 , 0.10411574, 0.13084218, 0.151658  , 0.24011456,
0.18242656, 0.18700831, 0.33861095],
[0.13452427, 0.08928373, 0.17710745, 0.15412179, 0.20436064,
0.15125662, 0.20119082, 0.27012967],
[0.16348246, 0.11256284, 0.18752404, 0.1127118 , 0.20483932,
0.17200437, 0.20835911, 0.30618168]],

[[0.22403281, 0.29922756, 0.23531332, 0.26134021, 0.26765484,
0.18465223, 0.16391383, 0.29805853],
[0.20084536, 0.32899054, 0.16009749, 0.22941495, 0.25107122,
0.10767332, 0.1457447 , 0.3141014 ],
[0.23205602, 0.33060088, 0.22958321, 0.23231288, 0.29819823,
0.1406459 , 0.22937244, 0.28558138],
[0.15489887, 0.31534417, 0.21773323, 0.28858036, 0.24457851,
0.15968555, 0.2234457 , 0.35596276],
[0.1788508 , 0.26784717, 0.16798333, 0.21385311, 0.23997703,
0.13653901, 0.17184522, 0.2883073 ],
[0.16242659, 0.34431221, 0.2057621 , 0.26503346, 0.27109762,
0.13139385, 0.22185103, 0.3562631 ],
[0.18789886, 0.30923529, 0.24732426, 0.23547633, 0.28154684,
0.13904478, 0.14649267, 0.27405708],
[0.19445427, 0.35960677, 0.23230759, 0.23780483, 0.24723406,
0.13670041, 0.13559524, 0.27022561],
[0.22067575, 0.35885748, 0.20409264, 0.27048428, 0.24214264,
0.12860025, 0.16842825, 0.26540385],
[0.21458252, 0.32682838, 0.2355557 , 0.23785778, 0.2921849 ,
0.1997607 , 0.19441425, 0.25868689]],

[[0.2703918 , 0.24970905, 0.16564421, 0.24572172, 0.33184692,
0.11759588, 0.25959314, 0.22655594],
[0.27412811, 0.23132896, 0.16569091, 0.2546302 , 0.30877664,
0.15647862, 0.25237486, 0.22596614],
[0.2735493 , 0.22007242, 0.16706278, 0.23226695, 0.30859791,
0.13650183, 0.20525557, 0.16492053],
[0.21791388, 0.27102692, 0.09959346, 0.18905718, 0.28512371,
0.15704253, 0.24023335, 0.23036512],
[0.20958997, 0.26284355, 0.15530461, 0.24598947, 0.33672899,
0.16131921, 0.19434804, 0.14615496],
[0.294969  , 0.22296834, 0.10198747, 0.24576505, 0.34418335,
0.17137221, 0.21933539, 0.14037182],
[0.24168455, 0.24932063, 0.12195035, 0.23565692, 0.27346061,
0.20199575, 0.22455562, 0.22977262],
[0.28636651, 0.22591873, 0.10228688, 0.27140408, 0.2653293 ,
0.17779868, 0.23154388, 0.17203736],
[0.23998659, 0.22758137, 0.16883079, 0.21203534, 0.3439006 ,
0.13397425, 0.18956984, 0.19292559],
[0.21934046, 0.28712487, 0.09691334, 0.25934077, 0.36195452,
0.19781053, 0.23611459, 0.15269663]],

[[0.16718024, 0.11465146, 0.30790879, 0.14401484, 0.31163333,
0.25966147, 0.16302408, 0.19527303],
[0.18883177, 0.17614183, 0.27795626, 0.1780272 , 0.33936994,
0.20748329, 0.1816076 , 0.18730035],
[0.18459267, 0.11670658, 0.22415879, 0.13973006, 0.32868155,
0.29729828, 0.24607555, 0.2183979 ],
[0.16663914, 0.17982612, 0.27612943, 0.1489624 , 0.34838748,
0.28544771, 0.1937745 , 0.17177166],
[0.22431769, 0.12687853, 0.30254947, 0.21440596, 0.30252173,
0.20258652, 0.19194168, 0.16453307],
[0.16531073, 0.17228551, 0.30098276, 0.17162956, 0.33431308,
0.23558932, 0.17058639, 0.18091455],
[0.23815965, 0.10538779, 0.27462834, 0.22554902, 0.33674219,
0.25220985, 0.21352195, 0.19598094],
[0.20135607, 0.15145859, 0.29038163, 0.21879233, 0.35208329,
0.24993937, 0.22140333, 0.15436163],
[0.16163352, 0.18651491, 0.27269982, 0.20438241, 0.30157154,
0.2223723 , 0.16829041, 0.21853945],
[0.18161262, 0.11345819, 0.22631827, 0.179414  , 0.34815067,
0.24143979, 0.24356954, 0.14168558]]])
• bob
(x, z)
float64
counts
1.1, 1.200, ..., 8.700, 8.8
σ = 0.194, 0.120, ..., 0.249, 0.191
Values:array([[1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8],
[2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8],
[3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8],
[4.1, 4.2, 4.3, 4.4, 4.5, 4.6, 4.7, 4.8],
[5.1, 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8],
[6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8],
[7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8],
[8.1, 8.2, 8.3, 8.4, 8.5, 8.6, 8.7, 8.8]])Variances (σ²):array([[0.03749174, 0.01438478, 0.03231173, 0.07605514, 0.06201856,
0.05207678, 0.05535868, 0.06400324],
[0.01671446, 0.03778454, 0.08780816, 0.09801152, 0.01717516,
0.09556081, 0.09517192, 0.015428  ],
[0.00572146, 0.04607225, 0.04012155, 0.07212165, 0.0202306 ,
0.0566836 , 0.03580939, 0.06772616],
[0.01739261, 0.09021325, 0.08978755, 0.05570573, 0.01655166,
0.0767639 , 0.05976336, 0.04403937],
[0.09013935, 0.04039127, 0.08541436, 0.00369746, 0.04855942,
0.06641958, 0.09125777, 0.09108691],
[0.00362106, 0.039537  , 0.03359937, 0.04770215, 0.00492679,
0.03661642, 0.02638803, 0.07960807],
[0.03952582, 0.0332016 , 0.0260433 , 0.01135412, 0.05763856,
0.02449758, 0.06898107, 0.06802092],
[0.04263125, 0.04617574, 0.01613657, 0.08838462, 0.08377034,
0.07985889, 0.06200791, 0.03636528]])

We rebin onto a coarser grid, in this case combining two neightboring bins:

[14]:

new_x = sc.array(dims=['x'], unit=sc.units.m, values=d.coords['x'].values[::2])
d = sc.rebin(d, 'x', new_x)


The result looks as follows:

[15]:

sc.to_html(d)
sc.plot(d['z', 0])

scipp.Dataset (5.70 KB)
• z: 8
• y: 10
• x: 4
• x
(x [bin-edge])
float64
m
1.0, 3.0, 5.0, 7.0, 9.0
Values:array([1., 3., 5., 7., 9.])
• y
(y [bin-edge])
float64
m
0.0, 1.0, ..., 9.0, 10.0
Values:array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10.])
• z
(z [bin-edge])
float64
m
1.0, 2.0, ..., 8.0, 9.0
Values:array([1., 2., 3., 4., 5., 6., 7., 8., 9.])
• alice
(z, y, x)
float64
counts
0.440, 0.103, ..., -0.245, -0.121
σ = 0.552, 0.591, ..., 0.768, 0.621
Values:array([[[ 0.44048005,  0.10345835, -0.46660784, -1.07667196],
[ 0.83883707,  0.17623217, -0.05723692, -0.191022  ],
[ 1.13842448, -0.25886211, -1.08744258, -0.08953876],
[ 0.63139184, -0.06617655, -0.2526873 , -0.5927318 ],
[ 0.38910087,  0.05384464, -0.10941121, -0.75551021],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[ 0.76271962,  0.57514054,  0.4344004 , -0.23054301],
[ 0.45102993, -0.18322461, -0.34553205, -0.57027951],
[ 0.56658342, -0.16461663, -0.76582415,  0.44619122],
[ 0.42553815,  0.02248681, -1.16163535,  0.02427216]],

[[ 0.65381734,  1.24378015, -0.60877984, -0.43392088],
[ 0.68375773, -0.20626468, -0.95796148, -0.12622242],
[ 0.16965498,  0.17209258, -0.66403432, -0.56485158],
[ 0.67061683,  0.36384572,  0.23927036, -0.23312695],
[ 0.09706144,  0.31561466, -0.31053429, -0.62477762],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.55758696,  0.35732877, -0.07389503,  0.12681168],
[-0.01547149,  1.02605441, -0.91788519, -0.08611547],
[ 0.45093392,  1.35265523, -0.28978168,  0.53840738],
[-0.19669974,  0.21711565,  0.51683868, -0.92049837]],

[[ 0.34476621, -0.53494557,  0.10961717, -0.04568189],
[-0.64288063, -0.41011694,  0.13389447, -0.69805976],
[ 0.06631684, -0.56436695,  0.53741549, -0.66657246],
[-0.82535299, -0.47885129,  0.28746792, -1.05459213],
[ 0.61153295, -0.62644883,  0.32227331, -0.48618324],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[ 0.70907427, -0.2376621 ,  0.40984903, -0.52623599],
[-0.74655409, -0.36649157,  0.35137239, -0.26817696],
[-0.03506632, -0.44889635,  0.02942436, -0.28807524],
[-0.46536205, -0.03090226,  0.81989238,  0.04052688]],

[[-1.07958464,  0.21226783,  0.25326418,  0.4528497 ],
[-0.29544545,  0.33671228, -0.7558874 ,  0.77468828],
[-0.32923971,  0.6497687 , -0.05688145, -0.38602779],
[-0.18937928,  0.63978226, -1.1273261 ,  0.42182262],
[ 0.36135352, -0.54832826, -0.00481995, -0.02742528],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.09155755, -0.35313966, -0.11841039,  0.66799661],
[-0.6084445 ,  0.10076703,  0.07134819, -0.07751035],
[-0.23787093, -0.09470998, -0.29522108,  0.55400505],
[ 0.47719717, -0.09685227, -0.49079511, -0.20810605]],

[[-0.0820469 , -0.42168492,  0.03670786, -0.02666145],
[ 0.37293431, -0.17365376,  0.16570717, -0.27721152],
[-0.59766422, -0.21262667,  0.58196074,  0.7555043 ],
[ 0.269829  , -0.21974434,  0.58211279, -0.09740486],
[ 0.45846744, -0.77497519,  0.40185664,  0.07547549],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[ 0.40010561, -0.69551899, -0.44098057,  0.39924342],
[ 0.30522897, -1.37722933,  0.38551681,  0.50957924],
[ 0.2281948 , -0.63991194,  0.17179002, -0.0907486 ],
[-0.51949506, -0.2019337 , -0.28941247,  0.40954787]],

[[-0.89162481,  0.82011255, -0.10201567, -0.72105596],
[-0.68220273, -0.10098392, -1.04800238, -0.89306391],
[-0.45054517, -0.34740954, -0.45550919, -0.81228299],
[-0.96508235, -0.46133675, -0.49129281, -0.05056383],
[-0.76831178,  0.59811757, -1.35754896, -0.14558881],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.15548102, -0.12788393, -0.78264455, -0.26846039],
[-1.00311014,  0.05899479, -0.91899817, -0.11003035],
[-0.76060145, -0.31883084, -0.71557811, -1.30110569],
[-0.75318131,  0.20247766, -0.54241715, -0.98054053]],

[[-0.29295598,  0.60282082,  0.75369834, -1.19709375],
[-0.19166525,  0.40440016,  1.19852885, -0.3000609 ],
[-1.11536825,  0.28815457,  0.7192534 , -0.59971802],
[-0.57472842, -0.34608457,  0.76298823,  0.32267574],
[-0.95827371,  0.12120414,  1.67528226, -1.01149107],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.70100743, -0.04737633,  0.40539891,  0.20979897],
[-0.57104173,  1.15518414,  0.53053915, -0.59843535],
[-1.3682728 ,  0.2378279 ,  0.9080623 , -0.94220141],
[-0.76755323,  0.17206878,  0.87397585, -0.04875353]],

[[-0.07602118, -0.65751964, -0.0982592 ,  0.04624498],
[-0.47456389, -0.1094462 , -0.42947661,  0.01916114],
[-0.75989042,  0.35087637, -0.44555634,  0.20689997],
[-0.80622781,  0.1225909 ,  0.04141912, -0.23897475],
[-0.71322036, -0.33250902, -0.85474449,  0.2278895 ],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.90380377, -0.23200653,  0.03151171,  0.06862759],
[ 0.26418687,  0.84273221, -0.70658512, -0.60505065],
[-0.16683918, -0.50758687, -0.36412194,  0.14373046],
[-0.29404741, -0.2796675 , -0.24456791, -0.12109663]]])Variances (σ²):array([[[0.30457995, 0.3498443 , 0.44127868, 0.35895739],
[0.36681836, 0.31556564, 0.31632542, 0.39675515],
[0.29990845, 0.3558308 , 0.37529136, 0.44454798],
[0.24856142, 0.34762465, 0.41033257, 0.49522013],
[0.33315731, 0.3182475 , 0.30688713, 0.44188487],
[0.32945679, 0.43407289, 0.33936598, 0.43154602],
[0.34393395, 0.40495525, 0.33790591, 0.37731091],
[0.24541973, 0.29530078, 0.31339476, 0.36543674],
[0.31224315, 0.39739703, 0.28708799, 0.33585826],
[0.25126742, 0.29539704, 0.3946586 , 0.46765009]],

[[0.2564007 , 0.56018611, 0.28476649, 0.40779077],
[0.3189366 , 0.50194131, 0.34946458, 0.35175649],
[0.35230152, 0.53298305, 0.29296026, 0.34363363],
[0.29161939, 0.4563311 , 0.26626702, 0.33154589],
[0.28133771, 0.43268005, 0.33941376, 0.38428085],
[0.24788176, 0.54598641, 0.20156541, 0.37179199],
[0.24966727, 0.46009186, 0.32722375, 0.44147955],
[0.35479541, 0.50607678, 0.19878707, 0.36323131],
[0.28036578, 0.53044385, 0.24824578, 0.37649163],
[0.27073006, 0.52253358, 0.33664407, 0.36972813]],

[[0.35102237, 0.35914259, 0.45989729, 0.25002463],
[0.45373422, 0.37960051, 0.45474743, 0.32323427],
[0.48054535, 0.38677505, 0.49739647, 0.3506301 ],
[0.44659682, 0.36583313, 0.47253766, 0.26028438],
[0.51479777, 0.33763028, 0.40812067, 0.25248546],
[0.43496769, 0.31223682, 0.45108957, 0.2792216 ],
[0.4873534 , 0.42240062, 0.49586223, 0.29618004],
[0.46094621, 0.34857179, 0.42872158, 0.33551492],
[0.43028912, 0.37605546, 0.451038  , 0.35830501],
[0.52229461, 0.38732871, 0.49148935, 0.31071961]],

[[0.48868546, 0.48715366, 0.31076308, 0.42118748],
[0.54019484, 0.48050752, 0.32079037, 0.31685815],
[0.50905612, 0.52924709, 0.22933503, 0.42664452],
[0.497192  , 0.57511164, 0.23890063, 0.42285994],
[0.55521683, 0.60130028, 0.31590988, 0.4511423 ],
[0.47227233, 0.63054428, 0.23546121, 0.35263691],
[0.55629173, 0.59231372, 0.23269553, 0.38998609],
[0.56146485, 0.59127363, 0.23212636, 0.33267742],
[0.52025663, 0.51224686, 0.27001602, 0.42217671],
[0.51514299, 0.5062579 , 0.30661117, 0.38244486]],

[[0.24660102, 0.30763925, 0.34131279, 0.50550781],
[0.32216988, 0.35317655, 0.3234236 , 0.51797094],
[0.22506089, 0.29766952, 0.3015005 , 0.49592966],
[0.22452527, 0.28472773, 0.36624218, 0.56108677],
[0.36703375, 0.2809178 , 0.30667232, 0.51762645],
[0.22504151, 0.30609489, 0.36382766, 0.61267103],
[0.31947487, 0.29223318, 0.33257503, 0.54691993],
[0.27323434, 0.28250018, 0.42254113, 0.52561926],
[0.223808  , 0.33122924, 0.35561725, 0.47132049],
[0.2760453 , 0.30023584, 0.37684369, 0.51454079]],

[[0.52326037, 0.49665353, 0.45230707, 0.46197236],
[0.52983591, 0.38951244, 0.35874454, 0.4598461 ],
[0.56265689, 0.46189609, 0.43884413, 0.51495383],
[0.47024304, 0.50631359, 0.40426407, 0.57940845],
[0.44669796, 0.38183644, 0.37651604, 0.46015252],
[0.50673881, 0.47079555, 0.40249147, 0.57811413],
[0.49713415, 0.48280059, 0.42059162, 0.42054974],
[0.55406104, 0.47011242, 0.38393447, 0.40582085],
[0.57953323, 0.47457692, 0.37074288, 0.4338321 ],
[0.5414109 , 0.47341349, 0.4919456 , 0.45310114]],

[[0.52010085, 0.41136593, 0.4494428 , 0.48614908],
[0.50545707, 0.42032112, 0.46525526, 0.478341  ],
[0.49362172, 0.39932973, 0.44509974, 0.3701761 ],
[0.4889408 , 0.28865064, 0.44216624, 0.47059847],
[0.47243352, 0.40129408, 0.4980482 , 0.340503  ],
[0.51793733, 0.34775252, 0.51555556, 0.35970721],
[0.49100519, 0.35760727, 0.47545636, 0.45432823],
[0.51228524, 0.37369096, 0.44312798, 0.40358123],
[0.46756796, 0.38086612, 0.47787484, 0.38249543],
[0.50646533, 0.35625411, 0.55976505, 0.38881122]],

[[0.2818317 , 0.45192364, 0.5712948 , 0.3582971 ],
[0.3649736 , 0.45598346, 0.54685323, 0.36890795],
[0.30129925, 0.36388886, 0.62597983, 0.46447345],
[0.34646526, 0.42509183, 0.63383519, 0.36554616],
[0.35119621, 0.51695543, 0.50510825, 0.35647476],
[0.33759624, 0.47261232, 0.5699024 , 0.35150094],
[0.34354744, 0.50017736, 0.58895204, 0.40950289],
[0.35281466, 0.50917397, 0.60202266, 0.37576496],
[0.34814843, 0.47708224, 0.52394384, 0.38682986],
[0.29507081, 0.40573227, 0.58959046, 0.38525512]]])
• bob
(x, z)
float64
counts
3.2, 3.400, ..., 16.400, 16.6
σ = 0.233, 0.228, ..., 0.362, 0.323
Values:array([[ 3.2,  3.4,  3.6,  3.8,  4. ,  4.2,  4.4,  4.6],
[ 7.2,  7.4,  7.6,  7.8,  8. ,  8.2,  8.4,  8.6],
[11.2, 11.4, 11.6, 11.8, 12. , 12.2, 12.4, 12.6],
[15.2, 15.4, 15.6, 15.8, 16. , 16.2, 16.4, 16.6]])Variances (σ²):array([[0.0542062 , 0.05216932, 0.12011989, 0.17406666, 0.07919372,
0.14763758, 0.1505306 , 0.07943124],
[0.02311406, 0.1362855 , 0.1299091 , 0.12782738, 0.03678226,
0.1334475 , 0.09557276, 0.11176554],
[0.09376042, 0.07992826, 0.11901373, 0.05139961, 0.05348621,
0.103036  , 0.1176458 , 0.17069498],
[0.08215707, 0.07937734, 0.04217987, 0.09973874, 0.1414089 ,
0.10435647, 0.13098897, 0.10438619]])

## Interaction with numpy#

Variable in a dataset are exposed in a numpy-compatible buffer format, so we can directly hand them to numpy functions:

[16]:

d['alice'].values = np.sin(d['alice'].values)


In contrast to the 1-D case considered earlier, the values are now a multi-dimensional array:

[17]:

d['alice'].values

[17]:

array([[[ 0.42637374,  0.10327389, -0.44985934, -0.88038432],
[ 0.7438664 ,  0.17532136, -0.05720567, -0.18986241],
[ 0.90797444, -0.25598074, -0.88544125, -0.08941917],
[ 0.59026883, -0.06612826, -0.25000682, -0.55862891],
[ 0.37935665,  0.05381862, -0.10919305, -0.68566015],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[ 0.69089017,  0.54395272,  0.42086657, -0.2285062 ],
[ 0.4358927 , -0.18220115, -0.33869733, -0.53986735],
[ 0.53675249, -0.16387416, -0.69313129,  0.43153279],
[ 0.412811  ,  0.02248492, -0.91745494,  0.02426978]],

[[ 0.60822091,  0.94700502, -0.57186694, -0.42043153],
[ 0.63171049, -0.2048052 , -0.81802073, -0.12588752],
[ 0.16884229,  0.17124439, -0.61629894, -0.53529045],
[ 0.62146936,  0.35587082,  0.23699384, -0.23102101],
[ 0.09690911,  0.31040083, -0.30556742, -0.58491692],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.5291402 ,  0.34977298, -0.0738278 ,  0.12647207],
[-0.01547088,  0.85526105, -0.79431865, -0.08600907],
[ 0.43580629,  0.97630143, -0.28574301,  0.51276934],
[-0.19543378,  0.21541389,  0.4941342 , -0.79590344]],

[[ 0.33797665, -0.50979422,  0.10939777, -0.045666  ],
[-0.5995035 , -0.39871657,  0.13349475, -0.6427325 ],
[ 0.06626824, -0.53488104,  0.51191752, -0.61829577],
[-0.73478726, -0.46075997,  0.28352496, -0.86969898],
[ 0.57412327, -0.58627161,  0.31672365, -0.46725482],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[ 0.65113145, -0.23543109,  0.39847087, -0.50228215],
[-0.67911339, -0.35834221,  0.34418667, -0.264974  ],
[-0.03505913, -0.43397149,  0.02942011, -0.2841073 ],
[-0.44874638, -0.03089734,  0.7310724 ,  0.04051578]],

[[-0.88176196,  0.21067737,  0.25056534,  0.43752977],
[-0.29116603,  0.33038578, -0.68593467,  0.69949335],
[-0.32332367,  0.60500225, -0.05685078, -0.37651149],
[-0.18824931,  0.59702078, -0.90326811,  0.40942399],
[ 0.35354066, -0.5212613 , -0.00481993, -0.02742185],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.09142968, -0.34584542, -0.11813388,  0.61941444],
[-0.57159181,  0.10059659,  0.07128768, -0.07743276],
[-0.23563404, -0.09456845, -0.29095137,  0.52609743],
[ 0.45929126, -0.09670093, -0.47132729, -0.20660719]],

[[-0.08195487, -0.40929836,  0.03669962, -0.02665829],
[ 0.36434961, -0.1727823 ,  0.16494986, -0.2736747 ],
[-0.56271313, -0.21102814,  0.54966297,  0.68565585],
[ 0.26656663, -0.21798012,  0.54978998, -0.09725091],
[ 0.44257433, -0.69969835,  0.39112775,  0.07540385],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[ 0.38951561, -0.64078397, -0.42682643,  0.38872138],
[ 0.30051157, -0.98132433,  0.37603807,  0.48780999],
[ 0.22621949, -0.59712481,  0.17094629, -0.09062409],
[-0.49644188, -0.20056411, -0.28538918,  0.39819463]],

[[-0.7780934 ,  0.73122261, -0.10183881, -0.66017818],
[-0.63050428, -0.10081237, -0.86642754, -0.77899656],
[-0.43545637, -0.34046326, -0.43991965, -0.72585941],
[-0.82209581, -0.4451455 , -0.47176618, -0.05054229],
[-0.69492226,  0.56308784, -0.97734881, -0.14507503],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.15485534, -0.12753564, -0.70515701, -0.26524729],
[-0.84314733,  0.05896058, -0.79499429, -0.10980846],
[-0.68935727, -0.31345654, -0.65605383, -0.96385337],
[-0.68396304,  0.20109699, -0.5162077 , -0.83079834]],

[[-0.28878352,  0.56696835,  0.68434013, -0.93098205],
[-0.19049392,  0.39346737,  0.93150499, -0.29557839],
[-0.89807282,  0.28418337,  0.65882319, -0.56440972],
[-0.54360687, -0.33921714,  0.69108434,  0.31710534],
[-0.81820029,  0.1209076 ,  0.99454631, -0.84762395],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.64498789, -0.04735861,  0.39438537,  0.20826328],
[-0.54050879,  0.91486932,  0.50599845, -0.56335042],
[-0.97956211,  0.23559222,  0.788313  , -0.80885451],
[-0.69437659,  0.17122095,  0.76688662, -0.04873422]],

[[-0.07594797, -0.61115551, -0.09810116,  0.0462285 ],
[-0.45695057, -0.10922783, -0.41639501,  0.01915997],
[-0.68884201,  0.34372091, -0.43095998,  0.20542698],
[-0.72168111,  0.12228407,  0.04140728, -0.23670664],
[-0.65427259, -0.32641565, -0.75440322,  0.2259221 ],
[ 0.        ,  0.        ,  0.        ,  0.        ],
[-0.7856857 , -0.22993075,  0.03150649,  0.06857374],
[ 0.26112444,  0.74646398, -0.64924026, -0.56880373],
[-0.16606625, -0.48606978, -0.35612894,  0.1432361 ],
[-0.28982828, -0.27603608, -0.24213712, -0.12080088]]])


### Exercise 3#

1. Use sc.mean to compute the mean of the data for Alice along the Z dimension.

2. Do the same with numpy, what are the complications you encounter, that are not present when using the dataset?

### Solution 3#

[18]:

help(sc.mean)

Help on function mean in module scipp.core.reduction:

mean(x: 'VariableLikeType', dim: 'Optional[str]' = None) -> 'VariableLikeType'
Arithmetic mean of elements in the input.

If the input has variances, the variances stored in the output are based on
the "standard deviation of the mean", i.e.,
:math:\sigma_{mean} = \sigma / \sqrt{N}.
:math:N is the length of the input dimension.
:math:\sigma is estimated as the average of the standard deviations of
the input elements along that dimension.

See :py:func:scipp.sum on how rounding errors for float32 inputs are handled.

Parameters
----------
x: scipp.typing.VariableLike
Input data.
dim:
Dimension along which to calculate the mean. If not
given, the mean over all dimensions is calculated.

Returns
-------
: Same type as x
The mean of the input values.

--------
scipp.nanmean:
Ignore NaN's when calculating the mean.


[19]:

mean = sc.mean(d['alice'], 'z')


When using numpy to compute the mean: - We must remember (or lookup) which dimension corresponds to the Z dimensions. - We need a separate call for values and variances. - We need to manually scale the variance with the inverse of the number of data points to get the variance of the mean (standard deviation of the mean scales with 1/sqrt(N)).

[20]:

np_values = np.mean(d['alice'].values, axis=0)
np_variances = np.mean(d['alice'].variances, axis=0)
np_variances /= d['alice'].shape[0]

[21]:

print(mean.values)
print(mean.variances)
print(np_values)
print(np_variances)

[[-0.0917463   0.12861239 -0.01758292 -0.31006776]
[-0.05358648 -0.01089622 -0.20175425 -0.19850984]
[-0.22066538  0.00772472 -0.08863336 -0.2523379 ]
[-0.19151444 -0.05675692  0.02221991 -0.16466493]
[-0.04011139 -0.135679   -0.05611684 -0.30707835]
[ 0.          0.          0.          0.        ]
[-0.0593202  -0.09164497 -0.00983948  0.05192616]
[-0.20653794  0.14428548 -0.15996746 -0.21530448]
[-0.11336257 -0.10964645 -0.16166613 -0.06672545]
[-0.24208596  0.00075229 -0.05505287 -0.19248298]]
[[0.04644504 0.05349858 0.05173536 0.05077948]
[0.05315813 0.05150951 0.04899382 0.05021359]
[0.05038203 0.05199407 0.05010011 0.05329671]
[0.047096   0.05077632 0.05053977 0.05447735]
[0.05190424 0.05110722 0.04776057 0.0500711 ]
[0.04799832 0.0550015  0.04811343 0.05214359]
[0.05138138 0.05488406 0.05017598 0.05212902]
[0.05179721 0.05276095 0.04726025 0.04855698]
[0.04940957 0.0543734  0.04663385 0.04948921]
[0.04966293 0.05073676 0.05543044 0.05112892]]
[[-0.0917463   0.12861239 -0.01758292 -0.31006776]
[-0.05358648 -0.01089622 -0.20175425 -0.19850984]
[-0.22066538  0.00772472 -0.08863336 -0.2523379 ]
[-0.19151444 -0.05675692  0.02221991 -0.16466493]
[-0.04011139 -0.135679   -0.05611684 -0.30707835]
[ 0.          0.          0.          0.        ]
[-0.0593202  -0.09164497 -0.00983948  0.05192616]
[-0.20653794  0.14428548 -0.15996746 -0.21530448]
[-0.11336257 -0.10964645 -0.16166613 -0.06672545]
[-0.24208596  0.00075229 -0.05505287 -0.19248298]]
[[0.04644504 0.05349858 0.05173536 0.05077948]
[0.05315813 0.05150951 0.04899382 0.05021359]
[0.05038203 0.05199407 0.05010011 0.05329671]
[0.047096   0.05077632 0.05053977 0.05447735]
[0.05190424 0.05110722 0.04776057 0.0500711 ]
[0.04799832 0.0550015  0.04811343 0.05214359]
[0.05138138 0.05488406 0.05017598 0.05212902]
[0.05179721 0.05276095 0.04726025 0.04855698]
[0.04940957 0.0543734  0.04663385 0.04948921]
[0.04966293 0.05073676 0.05543044 0.05112892]]