Closed artifexor closed 3 years ago
Depend on which python version you are using you can use f-strings.
https://realpython.com/python-f-strings/#f-strings-a-new-and-improved-way-to-format-strings-in-python
You can use save_dir = f"{out_dir}/{stock_name}_results_plot.png" instead of this save_dir = out_dir + '/' + str(stock_name) + 'results_plot' + '.png'
save_dir = f"{out_dir}/{stock_name}_results_plot.png"
save_dir = out_dir + '/' + str(stock_name) + 'results_plot' + '.png'
or out_name = f"{out_dir}/{company_name}_HMM_Prediction_{round(mse, 6)}.csv" instead of out_name = out_dir + '/' + str(company_name) + '_HMM_Prediction_' + str(round(mse, 6)) + '.csv'
out_name = f"{out_dir}/{company_name}_HMM_Prediction_{round(mse, 6)}.csv"
out_name = out_dir + '/' + str(company_name) + '_HMM_Prediction_' + str(round(mse, 6)) + '.csv'
Simply looks cleaner.
Depend on which python version you are using you can use f-strings.
https://realpython.com/python-f-strings/#f-strings-a-new-and-improved-way-to-format-strings-in-python
You can use
save_dir = f"{out_dir}/{stock_name}_results_plot.png"
instead of thissave_dir = out_dir + '/' + str(stock_name) + 'results_plot' + '.png'
or
out_name = f"{out_dir}/{company_name}_HMM_Prediction_{round(mse, 6)}.csv"
instead ofout_name = out_dir + '/' + str(company_name) + '_HMM_Prediction_' + str(round(mse, 6)) + '.csv'
Simply looks cleaner.