Report

Pandas 2.2 changed _merge indicator column from Categorical to StringDtype

653b203e-a379-4b6e-b37e-2a75c6c3c55e

In pandas 2.2, the _merge indicator column returned by DataFrame.merge(indicator=True) changed from CategoricalDtype to StringDtype (backed by ArrowDtype when pyarrow is available). Equality comparisons like merged["_merge"] == "left_only" now return a nullable boolean array (BooleanDtype) instead of a regular numpy bool array. When used for indexing, pandas raises ValueError: The truth value of an array with more than one element is ambiguous.