Skip to content

Commit b0e5da5

Browse files
committed
Update visual.py
simplify my code according to author's sugg
1 parent ff9d48d commit b0e5da5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

visual.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ def show_tfidf(tfidf, vocab, filename):
1414
plt.tight_layout()
1515
# creating the output folder
1616
output_folder = './visual/results/'
17-
if not os.path.exists(output_folder):
18-
os.makedirs(output_folder)
17+
os.makedirs(output_folder, exist_ok=True)
1918
plt.savefig(os.path.join(output_folder, '%s.png') % filename, format="png", dpi=500)
2019
plt.show()
2120

0 commit comments

Comments
 (0)