A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/4071 below:

AssertionError using mask on a dataframe with shape (1, n) · Issue #4071 · pandas-dev/pandas · GitHub

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)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4