'Converting field under pandas column from str to dict and creating new column

I have a pandas column called geo inside a dataFrame called df. It can be populated or not.

geo has an object, referencing an id of a place.

I'm acessing row 18 using df.iloc[18].geo and it returns:

"{'place_id': '1c37515518593fe3'}"

its a str type.

How i can create a new column inside df called place_id countaining the value (on my example: 1c37515518593fe3) ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source