Open
Description
I want to construct a new histogram using a sliced view of another. However, when I try to construct the new histogram from the sliced one, for example with the code from the slicing documentation
>> from rootpy.plotting import Hist3D
>> a = Hist3D(10, 0, 1, 10, 0, 1, 10, 0, 1)
>> b = Hist3D(a[3:5,::2,:])
I get the following error when using python3:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jodamp/.local/lib/python3.6/site-packages/rootpy/plotting/hist.py", line 2362, in __new__
obj = Hist3D(other.xedges, other.yedges, other.zedges, **kwargs)
File "/home/jodamp/.local/lib/python3.6/site-packages/rootpy/decorators.py", line 225, in __get__
result = self.method(inst)
File "/home/jodamp/.local/lib/python3.6/site-packages/rootpy/plotting/hist.py", line 178, in xedges
bin_to_edge_slice(self.x, self.hist.nbins(axis=0, overflow=True))]
File "/home/jodamp/.local/lib/python3.6/site-packages/rootpy/plotting/hist.py", line 55, in bin_to_edge_slice
s = canonify_slice(s, n)
File "/home/jodamp/.local/lib/python3.6/site-packages/rootpy/plotting/hist.py", line 43, in canonify_slice
if isinstance(s, (int, long)):
NameError: name 'long' is not defined
This could be fixed for example using six as done here to modify the method canonify_slice
.
Metadata
Metadata
Assignees
Labels
No labels