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

Closed
LionelR opened this Issue Jun 28, 2013 · 6 comments

Comments

Projects
None yet
2 participants

LionelR 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)
Member

cpcloud commented Jun 28, 2013

what version are you using?

LionelR commented Jun 28, 2013

0.11.0

Member

cpcloud commented Jun 28, 2013

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

Member

cpcloud commented Jun 28, 2013

@LionelR thanks for the report

cpcloud was assigned Jun 28, 2013

cpcloud closed this in #4073 Jun 28, 2013

LionelR commented Jun 28, 2013

Thanks for this fast fix

Member

cpcloud commented Jun 28, 2013

no problemo

cpcloud was unassigned by wesm Oct 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment