Sep-15-2022, 12:53 PM
(This post was last modified: Sep-15-2022, 12:53 PM by plantagenet.)
I would like to make a calculated column as shown here ('new'), from the exiting 'data' column (which is a list with a dictionary inside). It works in this code.
https://imgur.com/a/B4qEOWa
data = [10,[{'self': 'https://elia.atlassian.net/rest/api/3/customFieldOption/10200', 'value': 'IT-Sourced Changes 2022', 'id': '10200'}],30] df = pd.DataFrame(data, columns=['Data']) df['new'] = df.Data.explode().str['value'] df.head(3)However, when I try it on an existing dataframe, I get 'ValueError: cannot reindex from a duplicate axis'. Not sure why.
https://imgur.com/a/B4qEOWa