rootloader 1.2.6__tar.gz → 1.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rootloader-1.2.6 → rootloader-1.3.0}/PKG-INFO +1 -1
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/ttree.py +20 -2
- rootloader-1.3.0/rootloader/version.py +1 -0
- rootloader-1.2.6/rootloader/version.py +0 -1
- {rootloader-1.2.6 → rootloader-1.3.0}/.gitignore +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/LICENSE +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/README.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/README.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/attrdict.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/index.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/tdirectory.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/tfile.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/th1.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/th2.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/tleaf.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/ttree.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/docs/rootloader/version.md +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/gen_documentation.bash +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/pyproject.toml +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/__init__.py +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/attrdict.py +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/tdirectory.py +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/tfile.py +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/th1.py +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/th2.py +0 -0
- {rootloader-1.2.6 → rootloader-1.3.0}/rootloader/tleaf.py +0 -0
|
@@ -361,6 +361,17 @@ class ttree(object):
|
|
|
361
361
|
new.set_filter(expression, inplace=True)
|
|
362
362
|
return new
|
|
363
363
|
|
|
364
|
+
def to_array(self):
|
|
365
|
+
"""Return numpy array of the data"""
|
|
366
|
+
df = self.to_dict()
|
|
367
|
+
output = np.stack([df[k] for k in df.keys()])
|
|
368
|
+
|
|
369
|
+
# single array output for one column
|
|
370
|
+
if output.shape[0] == 1:
|
|
371
|
+
return output[0]
|
|
372
|
+
else:
|
|
373
|
+
return output
|
|
374
|
+
|
|
364
375
|
def to_dataframe(self):
|
|
365
376
|
"""Return pandas dataframe of the data"""
|
|
366
377
|
|
|
@@ -382,12 +393,16 @@ class ttree(object):
|
|
|
382
393
|
df = pd.DataFrame(df)
|
|
383
394
|
|
|
384
395
|
# set index
|
|
385
|
-
if self._index is not None
|
|
396
|
+
if self._index is not None:
|
|
386
397
|
df.set_index(self._index, inplace=True)
|
|
387
398
|
|
|
388
399
|
# convert to series?
|
|
389
400
|
if len(df.columns) == 1:
|
|
390
401
|
return df[df.columns[0]]
|
|
402
|
+
|
|
403
|
+
# index only dataframe
|
|
404
|
+
if len(df.columns) == 0:
|
|
405
|
+
df[self._index] = df.index
|
|
391
406
|
|
|
392
407
|
return df
|
|
393
408
|
|
|
@@ -420,7 +435,10 @@ class ttree(object):
|
|
|
420
435
|
@property
|
|
421
436
|
def size(self):
|
|
422
437
|
return self._rdf.Count().GetValue()
|
|
423
|
-
|
|
438
|
+
@property
|
|
439
|
+
def values(self):
|
|
440
|
+
return self.to_array()
|
|
441
|
+
|
|
424
442
|
# STATS ================================
|
|
425
443
|
def _getstat(self, fnname):
|
|
426
444
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '1.3.0'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '1.2.6'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|