-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
API DesignCategoricalCategorical Data TypeCategorical Data TypeDatetimeDatetime data dtypeDatetime data dtype
Milestone
Description
Accessors should be enabled depending on categories. Should care CategoricalIndex also.
import pandas as pd
s = pd.Series(['A', 'B'], dtype='category')
s.str
# AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas
s = pd.Series([pd.Timestamp('2011-01-01'), pd.Timestamp('2011-01-01')], dtype='category')
s.dt
# AttributeError: Can only use .dt accessor with datetimelike values
Metadata
Metadata
Assignees
Labels
API DesignCategoricalCategorical Data TypeCategorical Data TypeDatetimeDatetime data dtypeDatetime data dtype