Skip to content

BUG: AssertionError using mask on a dataframe with shape (1, n) #4071

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

Closed
lnlrbr opened this issue Jun 28, 2013 · 6 comments · Fixed by #4073
Closed

BUG: AssertionError using mask on a dataframe with shape (1, n) #4071

lnlrbr opened this issue Jun 28, 2013 · 6 comments · Fixed by #4073
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@lnlrbr
Copy link

lnlrbr commented Jun 28, 2013

Using a DataFrame of bools to mask some values in another dataframe works great:

In [84]: pd.DataFrame([[1,2],[3,4]]).mask(pd.DataFrame([[True,False],[False, True]]))
Out[84]: 
    0   1
0 NaN   2
1   3 NaN

but not if we try on a dataframe with a single index:

In [85]: pd.DataFrame([[1,2],]).mask(pd.DataFrame([[True,False],]))
AssertionError: Number of Block dimensions (1) must equal number of axes (2)
@cpcloud
Copy link
Member

cpcloud commented Jun 28, 2013

what version are you using?

@lnlrbr
Copy link
Author

lnlrbr commented Jun 28, 2013

0.11.0

@cpcloud
Copy link
Member

cpcloud commented Jun 28, 2013

different error on latest master ... marked as a bug for 0.13

@cpcloud
Copy link
Member

cpcloud commented Jun 28, 2013

@lionelr thanks for the report

@ghost ghost assigned cpcloud Jun 28, 2013
@lnlrbr
Copy link
Author

lnlrbr commented Jun 28, 2013

Thanks for this fast fix

@cpcloud
Copy link
Member

cpcloud commented Jun 28, 2013

no problemo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants