Python bindings and utilities for ROOT.
ROOT is a C++ framework used across HEP for data storage, analysis and visualisation. Its full API is available directly in Python through dynamic bindings powered by cppyy. Every ROOT class you see in the C++ documentation is accessible from Python under the ROOT module.
On top of that, a set of pythonizations adapt selected classes to feel more natively Pythonic: operator overloading, iterators, NumPy interoperability, and more.
conda install -c conda-forge root
See root.cern/install for all installation options.
The entry point to ROOT in Python is one import:
Every ROOT class and function is available under the ROOT module.
Now let's create a histogram, fill it from a NumPy array and write it to a file:
Now we create an RDataFrame from scratch, define a new column with a Python lambda and draw a histogram:
Topics | |
| Interoperability | |
| Using ROOT alongside other Python packages. | |
| Pythonizations | |
| Python-specific functionalities offered by ROOT. | |
| RDataLoader | |
| Feed ROOT data directly into models for machine learning training. | |
| Unified Histogram Interface (UHI) | |
| Using ROOT histograms in Python. | |