diff --git a/ngrams/term_frequencies.py b/ngrams/term_frequencies.py index 1253ded..69ad565 100755 --- a/ngrams/term_frequencies.py +++ b/ngrams/term_frequencies.py @@ -133,11 +133,8 @@ def weekly_tf(partition, nullable_schema = True dataset = ds.dataset(f"{input_parquet}/{partition}", format='parquet') - if not os.path.exists(output_10p_sample_path): - os.mkdir(output_10p_sample_path) - - if not os.path.exists(temp_output_tfidf_path): - os.mkdir(temp_output_tfidf_path) + Path(output_10p_sample_path).mkdir(parents=True, exist_ok=True) + Path(temp_output_tfidf_path).mkdir(parents=True, exist_ok=True) ngram_output = partition.replace("parquet","txt")