You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Uproot is a library for reading and writing ROOT files in pure Python and NumPy.
Unlike the standard C++ ROOT implementation, Uproot is only an I/O library, primarily intended to stream data into machine learning libraries in Python. Unlike PyROOT and root_numpy, Uproot does not depend on C++ ROOT. Instead, it uses Numpy to cast blocks of data from the ROOT file as Numpy arrays.
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 (see conda-forge docs):
Report bugs, request features, and ask for additional documentation on GitHub Issues.
If you have a "How do I...?" question, start a GitHub Discussion with category "Q&A".
Alternatively, ask about it on StackOverflow with the [uproot] tag. Be sure to include tags for any other libraries that you use, such as Pandas or PyTorch.
To ask questions in real time, try the Gitter Scikit-HEP/uproot chat room.
Installation for developers
Uproot is an ordinary Python library; you can get a copy of the code with
Uproot's only strict dependencies are NumPy and packaging. Strict dependencies are automatically installed by pip (or conda).
Awkward Array is highly recommended and is automatically installed by pip (or conda), though it is possible to use Uproot without it. If you need a minimal installation, pass --no-deps to pip and pass library="np" to every array-fetching function, or globally set uproot.default_library to get NumPy arrays instead of Awkward Arrays.
awkward: Uproot 5.x requires Awkward 2.x.
The following libraries are also useful in conjunction with Uproot, but are not necessary. If you call a function that needs one, you'll be prompted to install it. (Conda installs most of these automatically.)
For ROOT files, compressed different ways:
lz4 and xxhash: if reading ROOT files that have been LZ4-compressed.
zstandard: if reading ROOT files that have been ZSTD-compressed.
ZLIB and LZMA are built in (Python standard library).
For accessing remote files:
minio: if reading files with s3:// URIs.
xrootd: if reading files with root:// URIs.
HTTP/S access is built in (Python standard library).