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

unexpected result with groupby apply on categorical data · Issue #9603 · pandas-dev/pandas · GitHub

df = pandas.DataFrame({'a': [1, 0, 0, 0]})
df.groupby(pandas.cut(df.a, [0, 1, 2, 3, 4])).apply(lambda x: len(x))

Out[3]:
a
(0, 1]    1
(1, 2]    0
(2, 3]    0
(3, 4]    3
dtype: int64

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