Update 003b.extract_only_enough_data_with_groundtruth.py

This commit is contained in:
HappyZ 2019-06-10 12:59:54 -05:00
parent bac10eb855
commit e4a919d022
1 changed files with 2 additions and 2 deletions

View File

@ -19,8 +19,6 @@ data = pickle.load(open(pickle_fp_with_gt, 'rb'))
threshold = int(input("please enter minimal number of measurements:"))
outputfolder = '{}_extracted_thresh_{}'.format(folderpath.rstrip('/'), threshold)
if not os.path.isdir(outputfolder):
os.makedirs(outputfolder)
headline = '#lon,lat,sig,measure_at,upload_at,rating,speed,direction'
headlines = {
@ -55,3 +53,5 @@ for filepath in data:
for dataline in data[filepath][1]:
of.write(dataline + "\n")
print("done: {} out of {} files extracted ({:.2f}%)".format(counter_valid, len(data), 100.0 * counter_valid / len(data)))
os.rename('{}_extracted'.format(folderpath.rstrip('/')), outputfolder)