我有以下格式的JSON文件:
'assigned_to': {
'link': 'https://xxxx.xxxxx-xxxxx.com/api/now/table/xxxxxx/b3c9d420dbafcf00ea3',
'value': 'b3c9d420dbafcf00ea3'
}
当尝试使用以下代码访问“值”时
m = [x['value'] for x in df['assigned_to'].tolist()]
df['assigned_code'] = pd.Series(m).values
df = df.drop(columns=['assigned_to'])
我遇到以下错误:
m = [x['value'] for x in df['assigned_to'].tolist()]
TypeError: string indices must be integers