I have a number of csv files that I would like to read, remove the empty columns and rewrite each to a separate file.
So far in Jupyter Notebook I can do this for a single file without any problems:
from pandas.io.parsers import read_csv
data = read_csv('C:\\Users\\tom\\Desktop\\plugs\\20_80-1_plugs.csv')
filtered_data = data.dropna(axis='columns', how='all')
filtered_data.to_csv('C:\\Users\\tom\\Desktop\\plugs\\20_80-1_plugs_modify.csv'), index=False)
Can anyone help with extending this to read in the next csv file in the folder, and write with the same name as the input (say with _modify in the file name). The folder will comprise of files such as:
20_80-1_plugs.csv
11_91-9_plugs.csv
55_21-2_plugs.csv
etc