My pandas dataframe has a column where each row is a string which corresponds to a filename. I read my data from a JSON file and extract the column like this:
df = pd.read_json("mergedJSON.txt",lines=True,orient='columns') df2 = df.set_index("subject") for key,value in some_dict.iteritems(): df2.loc[value,"file_name"].to_csv(outfile,index=False, header=False) I need to drop certain rows from this dataframe based on whether the file is found on disk. Not sure how to do this. Appreciate help.