awkward 1.10.2


pip install awkward==1.10.2


Meta
Author: Jim Pivarski
Maintainer: Scikit-HEP
Requires Python: >=3.7

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers
  • Information Technology
  • Science/Research

License
  • OSI Approved :: BSD License

Operating System
  • MacOS :: MacOS X
  • Microsoft :: Windows
  • POSIX :: Linux
  • Unix

Programming Language
  • Python
  • Python :: 3
  • Python :: 3 :: Only
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11

Topic
  • Scientific/Engineering
  • Scientific/Engineering :: Information Analysis
  • Scientific/Engineering :: Mathematics
  • Scientific/Engineering :: Physics
  • Software Development
  • Utilities

PyPI version Conda-Forge Python 3.7โ€’3.11 BSD-3 Clause License Continuous integration tests

Scikit-HEP NSF-1836650 DOI Documentation Gitter

Awkward Array is a library for nested, variable-sized data, including arbitrary-length lists, records, mixed types, and missing data, using NumPy-like idioms.

Arrays are dynamically typed, but operations on them are compiled and fast. Their behavior coincides with NumPy when array dimensions are regular and generalizes when they're not.

Motivating example

Given an array of objects with x, y fields and variable-length nested lists like

array = ak.Array([
    [{"x": 1.1, "y": [1]}, {"x": 2.2, "y": [1, 2]}, {"x": 3.3, "y": [1, 2, 3]}],
    [],
    [{"x": 4.4, "y": {1, 2, 3, 4]}, {"x": 5.5, "y": [1, 2, 3, 4, 5]}]
])

the following slices out the y values, drops the first element from each inner list, and runs NumPy's np.square function on everything that is left:

output = np.square(array["y", ..., 1:])

The result is

[
    [[], [4], [4, 9]],
    [],
    [[4, 9, 16], [4, 9, 16, 25]]
]

The equivalent using only Python is

output = []
for sublist in array:
    tmp1 = []
    for record in sublist:
        tmp2 = []
        for number in record["y"][1:]:
            tmp2.append(np.square(number))
        tmp1.append(tmp2)
    output.append(tmp1)

Not only is the expression using Awkward Arrays more concise, using idioms familiar from NumPy, but it's much faster and uses less memory.

For a similar problem 10 million times larger than the one above (on a single-threaded 2.2 GHz processor),

  • the Awkward Array one-liner takes 4.6 seconds to run and uses 2.1 GB of memory,
  • the equivalent using Python lists and dicts takes 138 seconds to run and uses 22 GB of memory.

Speed and memory factors in the double digits are common because we're replacing Python's dynamically typed, pointer-chasing virtual machine with type-specialized, precompiled routines on contiguous data. (In other words, for the same reasons as NumPy.) Even higher speedups are possible when Awkward Array is paired with Numba.

Our presentation at SciPy 2020 provides a good introduction, showing how to use these arrays in a real analysis.

Installation

Awkward Array can be installed from PyPI using pip:

pip install awkward

You will likely get a precompiled binary (wheel), depending on your operating system and Python version. If not, pip attempts to compile from source (which requires a C++ compiler, make, and CMake).

Awkward Array is also available using conda, which always installs a binary:

conda install -c conda-forge awkward

If you have already added conda-forge as a channel, the -c conda-forge is unnecessary. Adding the channel is recommended because it ensures that all of your packages use compatible versions:

conda config --add channels conda-forge
conda update --all

Getting help

How-to tutorials

Python API reference

C++ API reference

2.8.3 May 15, 2025
2.8.2 May 03, 2025
2.8.1 Mar 24, 2025
2.8.0 Mar 19, 2025
2.7.4 Jan 31, 2025
2.7.3 Jan 25, 2025
2.7.2 Dec 05, 2024
2.7.1 Nov 19, 2024
2.7.0 Nov 08, 2024
2.6.10 Nov 07, 2024
2.6.9 Oct 07, 2024
2.6.8 Sep 12, 2024
2.6.7 Aug 02, 2024
2.6.6 Jun 26, 2024
2.6.5 May 28, 2024
2.6.4 May 03, 2024
2.6.3 Apr 01, 2024
2.6.3rc2 Mar 22, 2024
2.6.2 Mar 05, 2024
2.6.1 Feb 05, 2024
2.6.0 Feb 02, 2024
2.5.2 Jan 12, 2024
2.5.1 Dec 12, 2023
2.5.1rc1 Dec 06, 2023
2.5.0 Nov 16, 2023
2.5.0rc0 Oct 27, 2023
2.4.10 Nov 09, 2023
2.4.9 Nov 06, 2023
2.4.8 Nov 05, 2023
2.4.7 Oct 27, 2023
2.4.6 Oct 12, 2023
2.4.5 Oct 06, 2023
2.4.4 Sep 29, 2023
2.4.3 Sep 19, 2023
2.4.2 Sep 06, 2023
2.4.1 Sep 04, 2023
2.4.0 Sep 04, 2023
2.3.3 Aug 17, 2023
2.3.2 Aug 11, 2023
2.3.1 Jul 05, 2023
2.3.0 Jul 04, 2023
2.2.4 Jun 22, 2023
2.2.3 Jun 15, 2023
2.2.2 Jun 09, 2023
2.2.1 May 19, 2023
2.2.0 May 10, 2023
2.1.4 Apr 25, 2023
2.1.3 Apr 13, 2023
2.1.2 Apr 08, 2023
2.1.1 Mar 18, 2023
2.1.0 Mar 07, 2023
2.0.10 Mar 07, 2023
2.0.9 Mar 03, 2023
2.0.8 Feb 16, 2023
2.0.7 Feb 04, 2023
2.0.6 Jan 13, 2023
2.0.5 Jan 01, 2023
2.0.4 Dec 23, 2022
2.0.3 Dec 23, 2022
2.0.2 Dec 16, 2022
2.0.1 Dec 15, 2022
2.0.0 Dec 10, 2022
2.0.0rc8 Dec 09, 2022
2.0.0rc7 Dec 08, 2022
2.0.0rc6 Dec 06, 2022
2.0.0rc5 Dec 06, 2022
2.0.0rc4 Nov 19, 2022
1.10.5 Oct 05, 2023
1.10.4 Jul 19, 2023
1.10.3 Mar 14, 2023
1.10.2 Nov 08, 2022
1.10.1 Sep 22, 2022
1.10.0 Sep 19, 2022
1.9.0 Sep 02, 2022
1.8.0 Mar 02, 2022
1.7.0 Dec 02, 2021
1.5.1 Oct 14, 2021
1.5.0 Sep 12, 2021
1.4.0 Jul 02, 2021
1.3.0 Jun 01, 2021
1.2.3 May 10, 2021
1.2.2 Apr 12, 2021
1.2.1 Apr 07, 2021
1.2.0 Apr 01, 2021
1.1.2 Feb 11, 2021
1.1.1 Feb 09, 2021
1.1.0 Feb 09, 2021
1.0.2 Jan 06, 2021
1.0.1 Dec 14, 2020
1.0.0 Dec 05, 2020
0.14.0 Nov 03, 2020
0.13.0 Jul 20, 2020
0.12.22 Jul 06, 2020
0.12.21 May 08, 2020
0.12.20 Jan 30, 2020
0.12.19 Jan 04, 2020
0.12.18 Dec 16, 2019
0.12.17 Nov 22, 2019
0.12.16 Nov 15, 2019
0.12.15 Nov 12, 2019
0.12.14 Oct 18, 2019
0.12.13 Oct 08, 2019
0.12.12 Sep 30, 2019
0.12.11 Sep 27, 2019
0.12.10 Sep 16, 2019
0.12.9 Sep 10, 2019
0.12.8 Aug 31, 2019
0.12.7 Aug 27, 2019
0.12.6 Aug 06, 2019
0.12.5 Aug 01, 2019
0.12.4 Jul 29, 2019
0.12.3 Jul 17, 2019
0.12.2 Jul 14, 2019
0.12.1 Jul 10, 2019
0.12.0 Jul 10, 2019
0.12.0rc2 Jul 09, 2019
0.12.0rc1 Jul 09, 2019
0.11.1 Jun 17, 2019
0.11.0 Jun 17, 2019
0.11.0rc8 Jun 14, 2019
0.11.0rc7 Jun 14, 2019
0.11.0rc4 Jun 14, 2019
0.11.0rc3 Jun 14, 2019
0.10.3 May 27, 2019
0.10.2 May 23, 2019
0.10.1 May 20, 2019
0.10.0 May 20, 2019
0.9.0 Apr 12, 2019
0.9.0rc3 Apr 12, 2019
0.9.0rc2 Apr 12, 2019
0.9.0rc1 Apr 11, 2019
0.8.16 Jul 29, 2019
0.8.15 Apr 11, 2019
0.8.14 Mar 29, 2019
0.8.13 Mar 29, 2019
0.8.12 Mar 25, 2019
0.8.11 Mar 11, 2019
0.8.10 Mar 10, 2019
0.8.9 Mar 09, 2019
0.8.8 Mar 09, 2019
0.8.7 Mar 08, 2019
0.8.6 Feb 27, 2019
0.8.5 Feb 27, 2019
0.8.4 Feb 07, 2019
0.8.3 Feb 05, 2019
0.8.2 Feb 01, 2019
0.8.1 Jan 30, 2019
0.8.0 Jan 29, 2019
0.8.0rc13 Jan 29, 2019
0.8.0rc12 Jan 27, 2019
0.8.0rc11 Jan 25, 2019
0.8.0rc10 Jan 25, 2019
0.8.0rc9 Jan 25, 2019
0.8.0rc8 Jan 25, 2019
0.8.0rc7 Jan 25, 2019
0.8.0rc6 Jan 25, 2019
0.8.0rc5 Jan 25, 2019
0.8.0rc4 Jan 25, 2019
0.8.0rc3 Jan 25, 2019
0.8.0rc2 Jan 25, 2019
0.7.3 Jan 27, 2019
0.7.2 Jan 17, 2019
0.7.1 Jan 04, 2019
0.7.0 Dec 13, 2018
0.6.2 Dec 13, 2018
0.6.1 Dec 12, 2018
0.6.0 Dec 08, 2018
0.5.6 Dec 07, 2018
0.5.5 Dec 06, 2018
0.5.4 Dec 03, 2018
0.5.3 Dec 03, 2018
0.5.2 Nov 30, 2018
0.5.1 Nov 29, 2018
0.5.0 Nov 28, 2018
0.4.5 Nov 28, 2018
0.4.4 Nov 19, 2018
0.4.3 Nov 01, 2018
0.4.2 Oct 29, 2018
0.4.1 Oct 26, 2018
0.4.0 Oct 26, 2018
0.3.0 Oct 24, 2018
0.2.1 Oct 16, 2018
0.2.0 Oct 12, 2018
0.1.0 Oct 04, 2018
0.0.10 Sep 28, 2018
0.0.9 Aug 31, 2018
0.0.8 Aug 30, 2018
0.0.7 Aug 25, 2018
0.0.6 Aug 24, 2018
0.0.5 Aug 10, 2018
0.0.4 Aug 08, 2018
0.0.3 Jun 22, 2018
0.0.2 Jun 17, 2018
0.0.1 Jun 17, 2018
0.0rc0 Jan 25, 2019

Wheel compatibility matrix

Platform CPython 3.7 CPython 3.8 CPython 3.9 CPython 3.10 CPython 3.11 PyPy 3.7 (pp73) PyPy 3.8 (pp73) PyPy 3.9 (pp73)
macosx_10_9_universal2
macosx_10_9_x86_64
manylinux2014_aarch64
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_x86_64
musllinux_1_1_aarch64
musllinux_1_1_x86_64
win32
win_amd64

Files in release

awkward-1.10.2-cp310-cp310-macosx_10_9_universal2.whl (20.6MiB)
awkward-1.10.2-cp310-cp310-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.6MiB)
awkward-1.10.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2-cp310-cp310-musllinux_1_1_aarch64.whl (10.5MiB)
awkward-1.10.2-cp310-cp310-musllinux_1_1_x86_64.whl (11.4MiB)
awkward-1.10.2-cp310-cp310-win_amd64.whl (15.1MiB)
awkward-1.10.2-cp311-cp311-macosx_10_9_universal2.whl (20.6MiB)
awkward-1.10.2-cp311-cp311-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.6MiB)
awkward-1.10.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2-cp311-cp311-musllinux_1_1_aarch64.whl (10.5MiB)
awkward-1.10.2-cp311-cp311-musllinux_1_1_x86_64.whl (11.4MiB)
awkward-1.10.2-cp311-cp311-win_amd64.whl (15.1MiB)
awkward-1.10.2-cp37-cp37m-macosx_10_9_x86_64.whl (11.1MiB)
awkward-1.10.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.8MiB)
awkward-1.10.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.8MiB)
awkward-1.10.2-cp37-cp37m-musllinux_1_1_aarch64.whl (10.7MiB)
awkward-1.10.2-cp37-cp37m-musllinux_1_1_x86_64.whl (11.6MiB)
awkward-1.10.2-cp37-cp37m-win32.whl (11.9MiB)
awkward-1.10.2-cp37-cp37m-win_amd64.whl (15.1MiB)
awkward-1.10.2-cp38-cp38-macosx_10_9_universal2.whl (20.6MiB)
awkward-1.10.2-cp38-cp38-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.6MiB)
awkward-1.10.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2-cp38-cp38-musllinux_1_1_aarch64.whl (10.5MiB)
awkward-1.10.2-cp38-cp38-musllinux_1_1_x86_64.whl (11.4MiB)
awkward-1.10.2-cp38-cp38-win32.whl (11.9MiB)
awkward-1.10.2-cp38-cp38-win_amd64.whl (15.1MiB)
awkward-1.10.2-cp39-cp39-macosx_10_9_universal2.whl (20.6MiB)
awkward-1.10.2-cp39-cp39-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (10.6MiB)
awkward-1.10.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2-cp39-cp39-musllinux_1_1_aarch64.whl (10.5MiB)
awkward-1.10.2-cp39-cp39-musllinux_1_1_x86_64.whl (11.4MiB)
awkward-1.10.2-cp39-cp39-win32.whl (11.9MiB)
awkward-1.10.2-cp39-cp39-win_amd64.whl (15.1MiB)
awkward-1.10.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (11.3MiB)
awkward-1.10.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6MiB)
awkward-1.10.2.tar.gz (1.6MiB)
Extras:
Dependencies:
numpy (>=1.13.1)
packaging
importlib-resources