7e0bf1c8ca62c402f937d7b31472d22d2854aac3,pandas/core/dtypes/concat.py,,union_categoricals,#Any#Any#Any#,174
Before Change
categories = first.categories
ordered = first.ordered
if all(first.categories.equals(other.categories) for other in to_union[1:]):
new_codes = np.concatenate([c.codes for c in to_union])
else:
codes = [first.codes] + [
recode_for_categories(other.codes, other.categories, first.categories)
for other in to_union[1:]
]
new_codes = np.concatenate(codes)
if sort_categories and not ignore_order and ordered:
raise TypeError("Cannot use sort_categories=True with ordered Categoricals")
if sort_categories and not categories.is_monotonic_increasing:
After Change
categories = first.categories
ordered = first.ordered
all_codes = [first._validate_listlike(x) for x in to_union]
new_codes = np.concatenate(all_codes)
if sort_categories and not ignore_order and ordered:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: pandas-dev/pandas
Commit Name: 7e0bf1c8ca62c402f937d7b31472d22d2854aac3
Time: 2020-09-12
Author: jbrockmendel@gmail.com
File Name: pandas/core/dtypes/concat.py
Class Name:
Method Name: union_categoricals
Project Name: pandas-dev/pandas
Commit Name: 7e0bf1c8ca62c402f937d7b31472d22d2854aac3
Time: 2020-09-12
Author: jbrockmendel@gmail.com
File Name: pandas/core/indexes/category.py
Class Name: CategoricalIndex
Method Name: get_indexer_non_unique
Project Name: pandas-dev/pandas
Commit Name: 7e0bf1c8ca62c402f937d7b31472d22d2854aac3
Time: 2020-09-12
Author: jbrockmendel@gmail.com
File Name: pandas/core/reshape/merge.py
Class Name:
Method Name: _factorize_keys