python - Deleting rows in CSV files using Pandas -
relatively new pandas apologize in advance if redundant. have sorted data in csv file, delete rows no longer need. example here, keep rows trade date , settle date same delete rows different.
trade date settle date security 8/15/2017 8/15/2017 9/7/2017 9/11/2017 b 8/31/2017 9/6/2017 c
i guessing need add true false booleans code used try did not seem work me. appreciated.
booleans=[] length in df_new: if 'trade date'=='settle date': booleans.append(true) else: booleans.append(false)
df = df[df['trade date'] == df['settle date']] df trade date settle date security 0 8/15/2017 8/15/2017
Comments
Post a Comment