I have this dict:
dict1={'Period': '100.02\xa0minutes[2]', 'Repeat interval': '23\xa0days', 'Epoch': '25 January 2015, 00:45:13\xa0UTC[2]', 'Band': 'S Band(TT&C support)X Band(science data acquisition)', 'Bandwidth': 'up\xa0to\xa0722kbit/s\xa0download\xa0(S Band)up\xa0to\xa018.4Mbit/s\xa0download\xa0(X Band)up\xa0to\xa04kbit\xa0/s\xa0upload\xa0(S Band)'}
I want to replace all \xa0 by " "
I try this:
clean_dict = {key.strip(): item.strip() for key, item in dict1.items()}
But the output is the same. I try this, too:
new_keys = list(dict1.keys())
new_values = list(dict1.values())
new_keys2 = list()
new_values2 = list()
for element in new_keys:
print (element)
new_keys2.append(element.replace("\xa0", " "))
for element in new_values:
print(element)
new_values2.append(element.replace("\xa0", " "))
new_dict = dict(zip(new_keys2,new_values2))
But this also gives me the same output. How do I fix the problem?