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

GitHub ยท Where software is built

Thoughts on this?

In [8]: import pandas.util.testing as tm

In [9]: s = pd.Series(tm.makeCategoricalIndex(k=100))

In [10]: s.value_counts()
Out[10]:
vcKH    40
vXR9    31
Zn8J    29
dtype: int64

In [11]: s.value_counts().index
Out[11]: Index(['vcKH', 'vXR9', 'Zn8J'], dtype='object')

Now that we have CategoricalIndex (thanks Jeff), should that type be preserved so that Out[11] is a CategoricalIndex? My use-case (not shown in this example) is when the original categories are ordered, you get your value_counts and then want to sort the index.


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