Question: I have a Python dictionary 

```
original_dict={'body': '{"infra":["dev4","elk"],{"type":"file_integrity"}'}

```

I want to be able to parse original\_dict keys and values as a normal dictionary which I am not able to do now because 'body' key has a a dictionary casted as string and therefore I am not refer to any of it's keys. So I should be able to say:

```
infra=original_dict['body]['infra']

```

Can anyone help me out with this.

Answer: 
> 
> This is what I've tried:
> 
> 
> 
> ```
> cities.map(city=>JSON.parse(city.coordinates))
> 
> ```
> 
> 

`map()` created you a brand new, separate array with the coordinates only, which you have thrown away afterwards.

> 
> However, if I manually print a position like `console.log(JSON.parse(cities[0].coordinates))` [...] How can I make it automatically via loop?
> 
> 
> 

Well, put it in a loop:

```
for(let city of cities)
  city.coordinates = JSON.parse(city.coordinates);

```

---

However your example data is syntactically incorrect, there are `,}`-s at the end of the objects (after the `true`/`false`), and the supposed JSON data is not JSON, like

```
{type':'Point','coordinates':[151.2158203,-33.8704156]}
     ^it has no pair, and it should be double quote anyway, all of them
{"type":"Point","coordinates":[151.2158203,-33.8704156]} <-- this is JSON

```
```js
 const cities = [
    {
      city: 'Genova',
      coordinates: '{\'type\':\'Point\',\'coordinates\':[8.9473343,44.4023918]}',
      countryIsoCode: 'it',
      description: 'test',
      isInitialCity: true,
    }, {

      city: 'Barcelona',
      coordinates: '{\'type\':\'Point\',\'coordinates\':[2.0951271,41.3397004]}',
      countryIsoCode: 'es',
      description: 'description',
      isInitialCity: false,
    }, {
      city: 'Sydney',
      coordinates: '{type\':\'Point\',\'coordinates\':[151.2158203,-33.8704156]}',
      countryIsoCode: 'au',
      description: 'Sydney description',
      isInitialCity: false,
    }];

    //for(let city of cities)
 // city.coordinates = JSON.parse(city.coordinates);

    var x=cities.map(city=>JSON.parse(JSON.stringify(city.coordinates)))

   console.log("result :"+(JSON.stringify(x)))
```

```
  //   result :["{'type':'Point','coordinates':[8.9473343,44.4023918]}","{'type':'Point','coordinates':[2.0951271,41.3397004]}","{type':'Point','coordinates':[151.2158203,-33.8704156]}"]

```