From bb56f3be91bea597017821045484c3c01d2075ec Mon Sep 17 00:00:00 2001 From: Alex Rubinsteyn <alex.rubinsteyn@gmail.com> Date: Wed, 20 Apr 2016 09:42:40 -0400 Subject: [PATCH] fixed writing of combined CSV --- script/create-combined-class1-dataset.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/script/create-combined-class1-dataset.py b/script/create-combined-class1-dataset.py index 421b4de7..c8880de4 100755 --- a/script/create-combined-class1-dataset.py +++ b/script/create-combined-class1-dataset.py @@ -168,5 +168,8 @@ if __name__ == "__main__": print("Combined DataFrame size: %d (+%d)" % ( len(combined_df), len(combined_df) - len(nielsen_data))) - print("Writing %s..." % args.output_csv_path) - combined_df.to_csv(args.output_csv_path, index=False) + if not exists(args.output_dir): + makedirs(args.output_dir) + output_csv_path = join(args.output_dir, args.output_csv_filename) + print("Writing %s..." % output_csv_path) + combined_df.to_csv(output_csv_path, index=False) -- GitLab