I have this code and I can't delete a specific row from the DataFrame. How can I improve this code? I want to delete the values from that column that are not numeric. This way does not work because there are some missing columns that were deleted previously so I get
KeyError: '[1093] not found in axis'
Code:
i = 0
for row in new_dataset_2.GbCity:
if isinstance(row,str):
if not(row.isdigit()):
new_dataset_2.drop(i)
i+=1