BUG: Can only compare identically-labeled Series objects (string vs. object) #61099
Open
3 tasks done
Labels
Bug
Needs Discussion
Requires discussion from core team before further action
Strings
String extension data type and string data
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When a series (or dataframe) with otherwise identical indices are compared, but the indexes are technically dtype(object) and dtype(string), element-wise comparison fails. In the debugger, it looks like the ExtensionArray StringArray.equals is False when comparing to a python list of strings, causing Series._indexed_same to return False.
Expected Behavior
Ideally the string and object dtype would be comparable. This in-between state for Pandas dtypes has been quite awkward, with some libraries porting over to numpy-nullable / pyarrow dtype backends, but the Pandas library defaults not using them yet.
Installed Versions
Replace this line with the output of pd.show_versions()
The text was updated successfully, but these errors were encountered: