A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://pandas.pydata.org/pandas-docs/stable/reference/api/../api/pandas.Categorical.ordered.html below:

pandas.Categorical.ordered — pandas 2.3.1 documentation

pandas.Categorical.ordered#
property Categorical.ordered[source]#

Whether the categories have an ordered relationship.

Examples

For pandas.Series:

>>> ser = pd.Series(['a', 'b', 'c', 'a'], dtype='category')
>>> ser.cat.ordered
False
>>> raw_cat = pd.Categorical(['a', 'b', 'c', 'a'], ordered=True)
>>> ser = pd.Series(raw_cat)
>>> ser.cat.ordered
True

For pandas.Categorical:

>>> cat = pd.Categorical(['a', 'b'], ordered=True)
>>> cat.ordered
True
>>> cat = pd.Categorical(['a', 'b'], ordered=False)
>>> cat.ordered
False

For pandas.CategoricalIndex:

>>> ci = pd.CategoricalIndex(['a', 'b'], ordered=True)
>>> ci.ordered
True
>>> ci = pd.CategoricalIndex(['a', 'b'], ordered=False)
>>> ci.ordered
False

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