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
{{ message }}
This repository was archived by the owner on Jan 9, 2023. It is now read-only.
Working with stored arrays can be a bit inconventient in pandas.
52
63
`root_pandas` makes it easy to flatten your input data, providing you with a DataFrame containing only scalars:
53
64
```python
@@ -84,6 +95,14 @@ By default, `to_root` erases the existing contents of the file. Use `mode='a'` t
84
95
for df in read_root('bigfile.root', chunksize=100000):
85
96
df.to_root('out.root', mode='a')
86
97
```
87
-
When doing this to stream data from one ROOT file into another, you shouldn't forget to `os.remove` the output file first, otherwise you will append more and more data to it on each run of your program.
98
+
**Warning:** When using this feature to stream data from one ROOTfile into
99
+
another, you shouldn't forget to `os.remove` the output file first, otherwise
100
+
you will append more and more data to it on each run of your program.
101
+
102
+
## The DataFrame index
88
103
104
+
When reading a ROOTfile, `root_pandas` will automatically add a pandas index
105
+
to the DataFrame, which starts at 1and counts up for each entry.
106
+
When writing the a DataFrame to a ROOTfile, it stores the DataFrame index in a `__index__` branch.
107
+
Currently, only single-dimensional indices are supported.
0 commit comments