0

I'm trying to make a syntax using loc and index

for your convenience, the dataframe has columns 'EVENT_DTL' and 'EVNET_DTL_2' and 100,000 rows

here is my code, I'm making a condition without specific index

df.loc[condition&~(df.EVENT_DTL_2.index==100373)&~(df.EVENT_DTL_2.index==82009)&~(df.EVENT_DTL_2.index==82010)&~(df.EVENT_DTL_2.index==83484)&~(df.EVENT_DTL_2.index==98239)&~(df.EVENT_DTL_2.index==100373)&~(df.EVENT_DTL_2.index==101920),'EVENT_DTL_2']

I want to make it short. I've tried df.EVENT_DTL_2.index==[100373,82009,82010,83484,98239,100373,1011920] but since the dataframe has longer rows it cause the error.

0 Answers0