I have a dataframe subdata :
PageId VolumePred ConversionPred OSBrowser
0 1005581 8.0 7.0 (11, 16)
1 1016529 175.0 85.0 (11, 16)
2 1016529 4.0 4.0 (11, 17)
3 1016529 4.0 4.0 (12, 14)
4 1016529 29.0 1 9.0 (12, 16)
and a list OSBrowser_lst of value :
print(OSBrowser_lst)
[(11, 16), (33, 16), (99, 16), (12, 16), (11, 99), (11, 11), (11, 12), (99, 15), (99, 14), (12, 12), (11, 15), (32, 16), (99, 12), (12, 15), (12, 99), (12, 14), (11, 17)]
I would like to create multiple subdataframe based on OSBrowser_lst value : it means : 1 dataframe that contains only (11, 16) in OSBrowser column, ..
For this I did :
for i in OSBrowser_lst :
"df"+str(i) = subdata.loc[subdata['OSBrowser'] == i]
But I got this error :
"df"+str(i) = subdata.loc[subdata['OSBrowser'] == i]
^
SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
Can you help me please to fix this error?
Thanks