Read simple root files into memory
Project description
ROOTLOADER
Parse simple root files into memory as dictionaries or purpose-built objects. Convert objects into pandas DataFrames for ease of processing.
Installation
Requires ROOT with pyroot installed.
Clone this repository and install
git clone git@github.com:ucn-triumf/rootloader.git
cd rootloader
pip install .
You will need to re-run the last line of the above upon every pull, unless you add the -e flag like this: pip install -e .
Note that this may not work on all systems, particularly windows systems.
Documentation
Example
from rootloader import tfile
# read file
fid = tfile('myfile.root')
# key values can be accessed as attributes or as keys
# say there's a tree named "tree1". We can access it as
tr = fid.tree1
# or
tr = fid['tree1']
# get a pandas dataframe from the tree (the tree is left unaltered)
df = tr.to_dataframe()
# try to convert all file contents to pandas dataframes, and replace keys with these dataframes
fid.to_dataframe()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rootloader-1.3.0.tar.gz
(36.6 kB
view details)
File details
Details for the file rootloader-1.3.0.tar.gz.
File metadata
- Download URL: rootloader-1.3.0.tar.gz
- Upload date:
- Size: 36.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
648e26bc07d780becf942c9f2b172707fe195350fb2d778dfb2b0b768680571e
|
|
| MD5 |
5cd60057c0a5e7c99adfd1f0a33113db
|
|
| BLAKE2b-256 |
288839c57a3994a7d26460fba289f140703b8842cc0f0a7e971e7d857daf5eb2
|