Mar-10-2022, 03:56 PM
(This post was last modified: Mar-10-2022, 04:59 PM by Yoriz.
Edit Reason: Added code tags
)
Hello,
I'm trying to create 3 different tables on this model :
But i'd like to do it with a for loop and a .format function, such as :
The problem is i don't know how to create 3 different names for Table_2016, Table_2017 and Table_2018 with the for loop.
In other words, I'd like this part of the code
Thank you very much by advance for your help.
I'm trying to create 3 different tables on this model :
1 2 3 |
Table_2016 = pd.read_pickle( "./0_DATA/0_raw/Table_PM_2016.pkl" ) Table_2017 = pd.read_pickle( "./0_DATA/0_raw/Table_PM_2017.pkl" ) Table_2018 = pd.read_pickle( "./0_DATA/0_raw/Table_PM_2018.pkl" ) |
1 2 |
for year in [ 2016 , 2017 , 2018 ]: Table_{}. format (year) = pd.read_pickle( "./0_DATA/0_raw/Table_PM_{}.pkl" . format (year)) |
In other words, I'd like this part of the code
Table_{}.format(annee)
to work... Thank you very much by advance for your help.