I have dictionaries within a list like this:
[{'market': 'singapore', 'abbreviation': 'sg', 'indexId': 'STI', 'indexName': 'STRAITS TIMES INDEX'}, {'market': 'thailand', 'abbreviation': 'th', 'indexId': 'SET100', 'indexName': 'SET100 INDEX'}, {'market': 'turkey', 'abbreviation': 'tr', 'indexId': 'XUTEK', 'indexName': 'BIST TEKNOLOJI'}, {'market': 'thailand', 'abbreviation': 'th', 'indexId': 'SET50', 'indexName': 'SET50 INDEX'}]
The desired results should look like this
[{'market', 'singapore', 'abbreviation', 'sg', 'indexId', 'STI', 'indexName', 'STRAITS TIMES INDEX'}, {'market', 'thailand', 'abbreviation', 'th', 'indexId', 'SET100', 'indexName', 'SET100 INDEX'}, {'market', 'turkey', 'abbreviation', 'tr', 'indexId', 'XUTEK', 'indexName', 'BIST TEKNOLOJI'}, {'market', 'thailand', 'abbreviation': 'th', 'indexId', 'SET50', 'indexName', 'SET50 INDEX'}]
How can I possibly remove the ":" within this list of dictionaries? I know I can use the re.sub()
function, but I don't know how to apply it in this scenario.