I have a pandas dataframe with a column, which I need to clean, because the data doesn't have the necessary format:
df = pd.DataFrame({'item': ["1","2","3","4","5","6"], 'store': ["a [note 3]","b [note 98]","c ","a
[note 222]","b","c"]})
print(df)
item store
0 1 a [note 3]
1 2 b [note 98]
2 3 c
3 4 a [note 222]
4 5 b
5 6 c
The column, 'store', must be changed like this:
item store
0 1 a
1 2 b
2 3 c
3 4 a
4 5 b
5 6 c