Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constructing DataFrames using range fails #26342

Closed
topper-123 opened this issue May 11, 2019 · 0 comments

Comments

@topper-123
Copy link
Contributor

commented May 11, 2019

Working on removing compat.lrange, I've discovered that 1-dim lists, iterators and generators work as expected:

>>> pd.DataFrame(list(range(3)))  # ok
   0
0  0
1  1
2  2
>>> pd.DataFrame(iter(range(3)))  # ok
   0
0  0
1  1
2  2
>>> pd.DataFrame((i for i in range(3))  # ok
   0
0  0
1  1
2  2

while constructing with a plain range does not work:

>>> pd.DataFrame(range(3))  # not ok
AttributeError: 'range' object has no attribute 'ndim'

Fix upcoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.