I have this text file:
LEU,LEID,PPP,YYY,LEO '1','2','3','4','5' '2','1','2','3','4' '2','AA','','','' I want to delete the rows where for LEID='1'
import pandas as pd import os originalFile=os.path.abspath("D:\\python\\test\\OriginalFile.csv") df = pd.read_csv(originalFile) df = df[(df['LEID'] !='1')] df.to_csv('D:\\python\\test\\CorrectedFile.csv') print (df) Why the row with LEID='1' is not delted?