Repeat code n-times (loop through a list)

Job ID: 35964519

Budget: $10 – $30 USD

Hi experts,

I need you to convert my jupyter notebook to a function (or new code) that runs n-times (or loops through a list) and concatenate all outputs as one dataframe.

The attached code works well for Italian Serie A (league_code = 'I1'). I want to run through several league codes, eg: loop through the values in league_code = ['I1', E0', 'D1', 'P1', 'SP1', 'T1', 'F1',...] and concatenate results/output of each member of the league_code list.

Final_output = pd.concat(output_1,output_2,output_3,output_4,...,output_n
Related categories: Python Data Science Data Analytics Data Analysis Pandas