-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Open
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode
Description
import pandas as pd
df = pd.DataFrame({"a": [1, 1, 3], "b": [4, 5, 6]})
df = df.merge(df, on="a", validate="one_to_one")
The error is very non-descriptive and doesn't tell you much about which rows are actually validating the condition
pandas.errors.MergeError: Merge keys are not unique in either left or right dataset; not a one-to-one merge
We should just add a suffix to this message that lists the values that are validating the condition. Probably cut off after a few values but mostly when I run into this it's one offending row that causes the error
samukweku and wkmilanswanthra
Metadata
Metadata
Assignees
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode