A quick taste of a solution to a problem we expect to see more and more often in synchrotron science: irregularly shaped data
import awkward as ak
array = ak.Array(
[
[
{"x": 1.1, "y": [1]},
{"x": 2.2, "y": [2, 2]}
],
[],
[
{"x": 3.3, "y": [3, 3, 3]}
]
]
)
array.show()
array[0, 0, "x"]
array[0, 1, "y"].show()
array[:, "y"].show()
Variable-length ("ragged") arrays
ak.Array([
[1, 2, 3],
[4]
]).show()
Missing values
ak.Array([1, None]).show()
Labeled records
ak.Array([{'x': 1, 'y': 2}]).show()
And mixtures of these
ak.Array([1, "hi", None]).show()
import numpy as np
a = ak.Array([
[1, 2, 3],
[4, None],
[],
])
np.sqrt(a).show()
More information: https://github.com/jpivarski-talks/2022-07-11-scipy-loopy-tutorial