When using concat and then isin to drop all rows, I encounter:
ValueError: cannot compute isin with a duplicate axis.
Meanwhile if there are any rows left in the DF, there are no issues. Also, not using concat works in any case, returning an empty DF gracefully. I'm attempting to use concat as it's slightly faster in my use case.
Pandas 0.24.2 (latest).
df = pd.DataFrame()
for r in range(5):
df = df.append({'type':'teine', 'id':r}, ignore_index=True)
# Problem line
df = pd.concat([df.reset_index(drop=True), pd.DataFrame({'type':'teine', 'id':5}, index=[0])], sort=True)
dfCopy = df.copy()
df.query("(type == 'teine')", inplace=True)
df = dfCopy[~dfCopy.isin(df).all(axis=1)]