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

BUG: DataFrame constructor doesn't validate index/data lengths with EA data #33437

Closed
jbrockmendel opened this issue Apr 9, 2020 · 0 comments · Fixed by #35590
Closed

BUG: DataFrame constructor doesn't validate index/data lengths with EA data #33437

jbrockmendel opened this issue Apr 9, 2020 · 0 comments · Fixed by #35590
Labels
Bug Constructors Series/DataFrame/Index/pd.array Constructors
Milestone

Comments

@jbrockmendel
Copy link
Member

dti = pd.date_range("2016-01-01", periods=3, tz="US/Pacific")

>>> pd.DataFrame(dti, index=range(4))
                          0
0 2016-01-01 00:00:00-08:00
1 2016-01-02 00:00:00-08:00
2 2016-01-03 00:00:00-08:00
3                          

>>> pd.DataFrame(dti.tz_localize(None), index=range(4))
ValueError: Shape of passed values is (3, 1), indices imply (4, 1)
@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member Constructors Series/DataFrame/Index/pd.array Constructors and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Apr 9, 2020
@jreback jreback modified the milestones: 1.2, 1.1.1 Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Constructors Series/DataFrame/Index/pd.array Constructors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants