Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to change a particular text inside a list of dictionary

#how to remove special character inside a list containing dictionary values.
list_of_dictionary=[{"text":"$%&yahoo","zoombie":"you"},{"text":"i am zain%%%","greeting":"hello"}]
for i,j in enumerate(list_of_dictionary):
   text=j['text']
   text_1 =re.sub('W+', ' ',text)
   list_of_dictionary[i]['text']=text_1
print(list_of_text)
 
PREVIOUS NEXT
Tagged: #change #text #list #dictionary
ADD COMMENT
Topic
Name
6+3 =