Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

uproot.pandas.iterate not working in python 2 (since #332) #348

Closed
stderr-enst opened this issue Sep 27, 2019 · 2 comments · Fixed by #351
Closed

uproot.pandas.iterate not working in python 2 (since #332) #348

stderr-enst opened this issue Sep 27, 2019 · 2 comments · Fixed by #351

Comments

@stderr-enst
Copy link

stderr-enst commented Sep 27, 2019

Looks like the public attributes start & stop of RangeIndex were only added in pandas 0.25 which is not available for python 2.
The corresponding change in uproot was introduced in #332 .
I have a setup with pandas 0.24.2 where uproot.pandas.iterate throws:

AttributeError: 'RangeIndex' object has no attribute 'start'

because of this. Using _start and _stop is probably an easy fix?

Out of curiosity: whats the general consensus, is uproot expected to support python 2 after the its phase out in 3 months? (I should probably just migrate :))

@jpivarski
Copy link
Member

Darn—I thought that solution would work for both the old and new Pandas. I'll put in a hasattr check to cover both.

In principle, we'll still support Python 2, but we won't be testing it if the tools stop making that easy. If, for instance, conda doesn't let up install Python 2 anyone, we'll have to take it out of continuous integration. (This is the same situation we're in for Python 2.6. I still write 2.6-compliant idioms, though we don't have an easy way to test the code against 2.6.)

@jpivarski
Copy link
Member

Let me know if PR #351 works for you. I plan to include it in uproot version 3.10.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants