scikit-hep / uproot3-methods

Pythonic behaviors for non-I/O related ROOT classes.
BSD 3-Clause "New" or "Revised" License
21 stars 28 forks source link

TH2 variances returned as a list not a 2 by 2 array #30

Closed alasfar-lina closed 5 years ago

alasfar-lina commented 5 years ago

It is not possible to use the variances method effectivly for TH2 histograms ... as it does not return an array with the correct dimensions

jpivarski commented 5 years ago

Sorry for the wait. This fix went into PR #29, which will become version 0.3.2.

Many of the TH1 methods were recently updated to a Numpy interface. I've just done the same for the equivalent TH2 methods.

th2f.numpy() should now give you the same thing you'd have gotten from numpy.histogram2d (a 3-tuple of values, xedges, yedges).