I'm trying to drop some rows from my dataframe according to a specific element if the elements length is different than 7 then this element should be discarded.
for i in range(len(ups_df['Purchase_Order'])):
if( len(ups_df['Purchase_Order'][i]) != 7):
del ups_df['Purchase_Order'][i]
print(len(ups_df['Purchase_Order']))
The output I get is key error 4