CategoricalIndex.map()

pandas.CategoricalIndex.map

CategoricalIndex.map(mapper) [source]

Apply mapper function to its categories (not codes).

Parameters:

mapper : callable

Function to be applied. When all categories are mapped to different categories, the result will be Categorical which has the same order property as the original. Otherwise, the result will be np.ndarray.

Returns:

applied : Categorical or np.ndarray.

© 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.map.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部