I'm trying to split array values to columns.
I've created a Google Colab notebook and you can find my code here.
Here is a screenshot of the data (Hashtags):
Here is a representation of the data.
codes
1 [71020]
2 [77085]
3 [36415]
4 [99213, 99287]
5 [99233, 99233, 99233]
I want to split this arrays into different columns.
To something like this (screenshot - Hashtags split to columns):
Here is a representation of it.
code_1 code_2 code_3
1 71020
2 77085
3 36415
4 99213 99287
5 99233 99233 99233
I tried the following code which I got form this Stack Overflow post, but it doesn't give the expected results:
df_hashtags_splitted = pd.DataFrame(df['hashtags'].tolist())
What am I doing wrong?