root_numpy is a Python extension for converting ROOT TTrees into NumPy recarrays or structured arrays as well as converting NumPy arrays back into ROOT TTrees. With the core internals written in C++, root_numpy can efficiently handle large amounts of data (limited only by the available memory). Now that your ROOT data is in NumPy form, you can make use of the many powerful scientific Python packages or perform quick exploratory data analysis in interactive environments like IPython (especially IPython’s popular notebook feature).
root_numpy currently supports basic types such as bool, int, float, double, etc. and arrays of basic types (both variable and fixed-length). Vectors of basic types are also supported.
See the root2hdf5 script in the rootpy package that uses root_numpy and PyTables to convert all TTrees in a ROOT file into the HDF5 format.
import ROOT
from root_numpy import root2array, root2rec, tree2rec
# convert into a numpy structured array
# treename is always optional if there is only one tree in the file
arr = root2array('a.root', 'treename')
# convert into a numpy record array
rec = root2rec('a.root', 'treename')
# or directly convert a tree
rfile = ROOT.TFile('a.root')
tree = rfile.Get('treename')
rec = tree2rec(tree)
Metadata
Release files for root-numpy 3.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| root_numpy-3.0.1.tar.gz | 269.7 kB | Without provenance | Details for root_numpy-3.0.1.tar.gz |
Release files / root_numpy-3.0.1.tar.gz
| Download URL | root_numpy-3.0.1.tar.gz |
|---|---|
| Size | 269.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55ef4f1e2fe085070b3d5e8cf4b3714b360e058f9e69907026d6c1632444584b
|
|
BLAKE2b-256 checksum How to use checksums |
ffc7dc08ec9400e46c5758698c8a5905567e074613e31f518f27a40dccb4a7c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for root-numpy 3.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.