I need to run the code lines something like this.
tweet24042018 = tweets.loc[tweets['date2'] == '24042018'].copy()
tweet23042018 = tweets.loc[tweets['date2'] == '23042018'].copy()
tweet22042018 = tweets.loc[tweets['date2'] == '22042018'].copy()
The function created and tried is like this,
for key in collect:
['tweet'+f'{key}'] = tweets.loc[tweets['date2'] == f'{key}'].copy()
But, it gives error like,
File "<ipython-input-18-3c946d8cc61a>", line 2
['tweet'+f'{key}'] = tweets.loc[tweets['date2'] == f'{key}'].copy()
^
SyntaxError: can't assign to operator
help please
collect = ['22042018', '23042018', '24042018']