def remove_rows(df):
    merged = pd.merge(df.reset_index(), df, on='sseqid')
mask = (merged['qstart_x'] > merged['qstart_y']) & (merged['qend_x'] <
    merged['qend_y'])
df_mask = ~df.index.isin(merged.loc[mask, 'index'].values)
result = df.loc[df_mask]
return result
result = remove_rows(df)
print(result)
Панды: удалить строки на основе других строк