I have two lists in python
targetvariables = ['a','b','c']
featurevariables = ['d','e','f']
I would like to create three lists such as the following:
a_model = ['a','d','e','f']
b_model = ['b','d','e','f']
c_model = ['c','d','e','f']
I have about 15 target variables and 100+ feature variables so is there a way to do this in a loop of some kind? I tried but I couldnt work out how to assign a list name from a changing variable:
for idx,target in enumerate(targetvariables):
target +'_model' = targetvariables[idx] + featurevariables
SyntaxError: can't assign to operator
The end goal is to test machine learning models and to make things easier I would like to simply call:
df[[a_model]]
to then use in the ML process.