File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
82
82
-i " pandas.RangeIndex.start SA01" \
83
83
-i " pandas.RangeIndex.step SA01" \
84
84
-i " pandas.RangeIndex.stop SA01" \
85
- -i " pandas.Series.cat.add_categories PR01,PR02" \
86
85
-i " pandas.Series.cat.as_ordered PR01" \
87
86
-i " pandas.Series.cat.as_unordered PR01" \
88
87
-i " pandas.Series.cat.remove_categories PR01,PR02" \
Original file line number Diff line number Diff line change @@ -1302,11 +1302,25 @@ def add_categories(self, new_categories) -> Self:
1302
1302
"""
1303
1303
Add new categories.
1304
1304
1305
- `new_categories` will be included at the last/highest place in the
1306
- categories and will be unused directly after this call.
1305
+ `new_categories` will be included at the last/highest place in the categories
1306
+ and will be unused directly after this call. This method is useful when
1307
+ working with categorical data that needs to be updated or extended with new
1308
+ categories over time. Adding categories in this way avoids the need to
1309
+ redefine the entire set of categories, which can be especially helpful in
1310
+ scenarios where the categorical data is large or frequently updated. New
1311
+ categories are added to the end of the list of categories, and their presence
1312
+ will not affect the current categorical values directly until they are
1313
+ explicitly used.
1307
1314
1308
1315
Parameters
1309
1316
----------
1317
+ *args : iterable, optional
1318
+ Positional arguments passed into `func`.
1319
+ **kwargs : dict, optional
1320
+ A dictionary of keyword arguments passed into `func`.
1321
+
1322
+ Attributes
1323
+ ----------
1310
1324
new_categories : category or list-like of category
1311
1325
The new categories to be included.
1312
1326
You can’t perform that action at this time.
0 commit comments