Considering the following dataframe, I need the df dataframe to have only id's not in df_inf and df_sup:
import pandas as pd
df = pd.DataFrame({'id':[1,2,3,4,5,6,7,8], 'name':['a','b','c','d','e','f','g','h']})
df_inf = pd.DataFrame({'id': [1,2,3]})
df_sup = pd.DataFrame({'id': [6,7,8]})
Is there any proper function of pandas that operates? I'm trying in a fairly trivial way and it's not giving back:
df = df['id'] - (df_inf['id'] + df_sup['id'])
df
df[~(df["id"].isin(df_inf["id"]) | df["id"].isin(df_sup["id"]))]