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

inconsistent name for returned Series in groupby · Issue #12363 · pandas-dev/pandas · GitHub

I would think [7] and [8] would be identical. Note this is true for all ops I have looked at, so it is a general issue.

In [6]:         df = DataFrame({'A': ['foo', 'bar', 'foo', 'bar',
                              'foo', 'bar', 'foo', 'foo'],
                        'B': ['one', 'one', 'two', 'two',
                              'two', 'two', 'one', 'two'],
                        'C': np.random.randn(8) + 1.0,
                        'D': np.arange(8)})

In [7]: df.groupby(['A']).B.count()
Out[7]: 
A
bar    3
foo    5
Name: B, dtype: int64

In [8]: df.B.groupby(df.A).count()
Out[8]: 
A
bar    3
foo    5
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