I am working with some data that is "water falled" initially (in Excel) but becomes normal after a certain number of lines in Excel.
Essentially what I need the script to do is to remove empty data rows and only keep the full rows, but the location of the rows where data is full is variable, and I am not too experienced with Python so I am not quite sure how to get it to filter out the "waterfall" rows.
I attached a simple example of what I mean, row 10 would be where the script would need to start keeping the rows: Excel Example
What I have written, assuming the .py script is in the same folder as the data that needs to be filtered, along with a folder 'Archive' and 'Downsampled'.
folders = os.listdir('./')
for folder in folders:
filename = folder
f = open(filename,'r')
lines = f.readlines()
f.close()
shutil.move(folder, './Archive')
f_out = open('./DownSampled/' + folder + '.csv', 'w')
#filter the data.
f_out.close()