How to create a column out of list nested inside a dataframe column
I have a dataframe having values:
I want to split the data inside a message column into sub columns such as
Till now i have split the data on the basis of comma
As the data is not in json format i can't use json.loads on it. I split it using the code below
key = []
for i in df['text']:
i = i.replace("{", "")
i = i.replace("}", "")
for x in i.split(","):
key.append(x.split(": "))
key[0]
With giving an output [' HashCode', '"650e4390:0"']
After this i am stuck how to creat a dataframe out of this as the pattern befor and after {} is not fixed ans changes.
Error while using ast and json
as string is not json as in some rows the } braces are missing