CategoricalIndex.add_categories()

pandas.CategoricalIndex.add_categories

CategoricalIndex.add_categories(*args, **kwargs) [source]

Add new categories.

new_categories will be included at the last/highest place in the categories and will be unused directly after this call.

Parameters:

new_categories : category or list-like of category

The new categories to be included.

inplace : boolean (default: False)

Whether or not to add the categories inplace or return a copy of this categorical with added categories.

Returns:

cat : Categorical with new categories added or None if inplace.

Raises:

ValueError

If the new categories include old categories or do not validate as categories

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.19.2/generated/pandas.CategoricalIndex.add_categories.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部