Registry / data / awkward0

awkward0

JSON →
library0.15.5pypypiunverified

Awkward0 is a Python library for manipulating arrays of complex, nested, and variable-length data structures with the ease and performance of NumPy. It extends NumPy's vectorized operations to handle "jagged" or "ragged" arrays, records, mixed types, and missing data. This version (0.x) is pure Python and NumPy-based, offering columnar data access and efficient calculations on non-rectangular data. It is currently in a deprecated state, with development focused on the `awkward` (formerly `awkward1`) package.

pip install awkward0
INSTALL
IMPORT
SIG · AWKWARD0
A
awkward0
datapythonv0.15.5
Install
3.7s avg
Import
1073ms
Disk
91MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.15.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.690s · 91.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 3.7s · import 0.598s · 87MB
91MB installed
● package 91MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

awkward0
import awkward0
import awkward0

This quickstart demonstrates creating an `awkward0` array from nested Python lists, performing a vectorized NumPy operation on it, accessing elements using array slicing, and converting it back to a standard Python list of lists. `awkward0.fromiter` is a common way to initialize arrays from arbitrary Python structures, though it can be slow for large datasets.

import awkward0 import numpy as np # Create a jagged array from a Python list of lists array = awkward0.fromiter([[1.1, 2.2, None], [3.3], [4.4, 5.5, 6.6, None]]) print('Original array:') print(array) # Perform a vectorized operation (e.g., square root) sqrt_array = np.sqrt(array) print('\nSquare root of array:') print(sqrt_array) # Access elements using NumPy-like indexing first_elements = array[:, 0] print('\nFirst element of each sublist:') print(first_elements) # Convert back to a Python list of lists list_representation = array.tolist() print('\nList representation:') print(list_representation)
Debug
Known issues
breakingThe `awkward` package was renamed to `awkward0` starting with version 0.15.0 to avoid conflicts with the new, incompatible Awkward 1.x series (now simply `awkward`). Code using `import awkward` will now import the 1.x series and fail if expecting 0.x behavior.
fix
Always use `import awkward0` when intending to use this 0.x branch of the library. If migrating to the newer library, refer to `awkward` (1.x) documentation for new import paths and API changes.
affects: >=0.15.0
deprecatedThe entire `awkward0` library is deprecated and is no longer actively developed. Users are strongly encouraged to migrate to the `awkward` library (formerly `awkward1`) for ongoing development, new features, and improved performance.
fix
Plan a migration to the `awkward` package (`pip install awkward`). The newer library offers tools like `ak.from_awkward0` and `ak.to_awkward0` for gradual adoption.
affects: All 0.x versions
gotchaDirect saving/loading with `awkward0.save()` or `awkward0.load()` produces a custom format (essentially pickled ZIP archives) that is *not* compatible with the `awkward` (1.x) library. It also might not offer lazy loading for subfields as efficiently as other formats.
fix
If interoperability with `awkward` (1.x) or standard formats is needed, consider converting to/from `pyarrow` or `HDF5` using optional dependencies, or use `ak.to_awkward0`/`ak.from_awkward0` to convert to the newer library's format before saving/loading.
affects: All 0.x versions
gotchaNumPy 1.20+ introduced deprecation warnings for `np.str` and `np.bool`. While `awkward0` version 0.15.5 fixed the `np.str` warning, older `awkward0` versions might still show warnings when used with newer NumPy versions.
fix
Update `awkward0` to 0.15.5 or later. If updating is not possible, these are usually just warnings and do not break functionality, but indicate areas that might break in future NumPy versions.
affects: <0.15.5
gotchaAwkward 0 arrays (like Awkward 1) are largely immutable in their structure. While some properties were mutable as a user convenience in Awkward 0, direct in-place modification of array layouts is generally not supported, which can be a shift for users accustomed to fully mutable Python lists or NumPy arrays.
fix
Operations typically return a *new* Awkward Array. If mutable behavior is critical, consider using `awkward0.fromiter` to rebuild or convert to Python lists for modification, then back to Awkward. Understand that this might incur performance costs.
affects: All 0.x versions
Upgrade
Version history
0.15.5latest on PyPI · released Feb 8, 2021
Audit
Dependencies
numpyrequiredCore dependency for array manipulation and numerical operations.
pyarrowoptionalRecommended for reading/writing Arrow and Parquet data.
h5pyoptionalRecommended for reading/writing Awkward Arrays in HDF5 files.
pandasoptionalProvides an alternative view and interoperability.
Agent activity
30 hits · last 30 days
node
24
OpenAI (training)
1
Resources
awkward0 — pip install awkward0 · libregistry