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

inconsistent name handling in value_counts · Issue #10150 · pandas-dev/pandas · GitHub

Both Series.value_counts and Index.value_counts should preserve its name in resulted Series.name? Current behaviors are below:

s = pd.Series([1, 2, 1], name='a')
idx = pd.Index([1, 2, 1], name='a')

result = s.value_counts()
result.name, result.index.name
# (None, None)      # should be ('a', None)?

result = idx.value_counts()
result.name, result.index.name
# (None, None)      # should be ('a', None)?

didx = pd.date_range('2011-01-01', freq='D', periods=3, name='a')
result = didx.value_counts()
# (None, 'a')       # should be ('a', None)?

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