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/12642 below:

crosstab with margins=True and dropna=False · Issue #12642 · pandas-dev/pandas · GitHub

In [1]: df = pd.DataFrame({'a': [1, 2, 2, 2, 2, np.nan],'b': [3, 3, 4, 4, 4, 4]})

In [2]: pd.crosstab(df.a, df.b, margins=True, dropna=True)
Out[2]: 
b    3  4  All
a             
1.0  1  0    1
2.0  1  3    4
All  2  3    5

In [3]: pd.crosstab(df.a, df.b, margins=True, dropna=False)
KeyError: 'Level None not found'

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