For a column with a data frame (here id column), I had to remove all the rows that contained a particular value. I tried to get the line number and various methods, but I made a note because there was an easy way to handle it.
import pandas as pd
data = pd.read_csv("Original data path")
list = [1,2,3] ###Any value you want to erase
for i in list:
data = data[data['id'] != i]
That's all there is to it.
Recommended Posts