From b8018ba3188d408b45e0687802f86257b41fff0c Mon Sep 17 00:00:00 2001 From: akalankag Date: Tue, 23 Aug 2022 11:04:20 -0600 Subject: [PATCH] Dissolve for loop that concatanate string to Python str.join API as str.join is efficient --- PyRate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyRate.py b/PyRate.py index aa17d0d..718468c 100755 --- a/PyRate.py +++ b/PyRate.py @@ -890,7 +890,7 @@ def comb_mcmc_files(infile, files,burnin,tag,resample,col_tag,file_type=""): head_temp= np.array(head_temp) head_t= ["%s\t" % (i) for i in head_temp[sp_ind]] tbl_header="it\t" - for i in head_t: tbl_header+=i + tbl_header+=''.join([ht for ht in head_t]) tbl_header+="\n" print("found", len(head_t), "columns") comb = t_file[:,sp_ind] @@ -1062,7 +1062,7 @@ def comb_log_files(path_to_files,burnin=0,tag="",resample=0,col_tag=[]): head_temp= np.array(head_temp) head_t= ["%s\t" % (i) for i in head_temp[sp_ind]] tbl_header="it\t" - for i in head_t: tbl_header+=i + tbl_header += ''.join([ht for ht in head_t]) tbl_header+="\n" print("found", len(head_t), "columns") comb = t_file[:,sp_ind]