I'm trying to generate a slope in a dynamic way where I change the df name and the variable I use in linregress
list = ['a','b', 'c']
for i in list:
'{}_slope'.format(i) = mydata.groupby(['group_a','group_b']).apply(lambda v: linregress(v.ym,'v.{}'.format(i))[0]).to_frame('a').reset_index()
I'm getting the following error: SyntaxError: can't assign to function call
how can I solve this topic?