CategoricalAccessor class
Categorical accessor for Series, similar to pandas .cat accessor.
This provides access to categorical-specific operations when a Series has been converted to categorical dtype.
Example:
var series = Series(['A', 'B', 'A', 'C'], name: 'categories');
series.astype('category');
print(series.cat.categories); // [A, B, C]
print(series.cat.codes); // [0, 1, 0, 2]
Constructors
- CategoricalAccessor(Series _series)
Properties
- categories → List
-
The category labels
no setter
-
codes
→ List<
int> -
The integer codes
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- nCategories → int
-
The number of categories
no setter
- ordered → bool
-
Whether the categories are ordered
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addCategories(
List newCategories, {bool inplace = true}) → Series - Adds new categories to the categorical series.
-
asOrdered(
{bool inplace = true}) → Series - Converts the categorical to ordered.
-
asUnordered(
{bool inplace = true}) → Series - Converts the categorical to unordered.
-
contains(
dynamic value) → bool - Checks if the categorical series contains the specified value.
-
max(
) → dynamic - Returns the maximum category value.
-
memoryUsage(
) → Map< String, dynamic> - Returns memory usage information for the categorical series.
-
min(
) → dynamic - Returns the minimum category value.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeCategories(
List removals, {bool inplace = true}) → Series - Removes categories from the categorical series.
-
renameCategories(
Map renameMap, {bool inplace = true}) → Series - Renames categories in the categorical series.
-
reorderCategories(
List newCategories, {bool? ordered, bool inplace = true}) → Series - Reorders the categories.
-
setCategories(
List newCategories, {bool? ordered, bool rename = false, bool inplace = true}) → Series - Sets the categories to the specified list.
-
toString(
) → String -
A string representation of this object.
inherited
-
unique(
{bool sort = false}) → List - Returns unique categories that appear in the data.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited