# split Use , Do not keep delimiters , Split a string into a single string list.
# If the separator is reserved, you can use re.split, but re.split The delimiter will be used as list A value of , It will destroy the original data structure .
# The suggested method is to replace the original separator , Then split it . For example, the separator is "}, ", Replace with "},=", use “,=” Segmentation .
mail["title"] = mail["title"].apply(lambda x: (x.replace("}, ", "}, =")).split(",="))
Parse the string into dictionary format
# Parse the string into dictionary format
# In a string , Single quotation marks ' To change to double quotation marks "
# In a string , Cannot appear \, To be converted into \\
mail["title"] = mail["title"].apply(lambda x: x.replace("\'", "\"").replace("\\","\\\\"))
mail["title"] = mail["title"].apply(lambda x: json.loads(str(x)))