Python 如何访问/迭代熊猫系列的元素?
以下是系列:Python 如何访问/迭代熊猫系列的元素?,python,pandas,dataframe,series,Python,Pandas,Dataframe,Series,以下是系列: <class 'pandas.core.series.Series'> Series([], Name: ({"company": "Pennington PLC", "catch_phrase": "Future-proofed tertiary frame", "phone": "+1-312-296-2956x137", "timez
<class 'pandas.core.series.Series'>
Series([], Name: ({"company": "Pennington PLC", "catch_phrase": "Future-proofed tertiary frame", "phone": "+1-312-296-2956x137", "timezone": "America/Indiana/Indianapolis", "client_count": 638}, nan, nan, nan), dtype: float64)
系列([],名称:({“公司”:“Pennington PLC”,“流行语”:“经得起未来考验的三级机架”,“电话”:“+1-312-296-2956x137”,“时区”:“美国/印第安纳州/印第安纳波利斯”,“客户计数”:638},南,南),数据类型:float64)
我想访问Name的值,即字典
这不就是
$df[“Name”]
吗?我在运行时出错。@Barmar我刚刚添加了从中获取序列的数据帧。要访问数据帧的第三行,我的代码是df.iloc[2]。这就产生了系列([],名称:({“公司”:“Pennington PLC”,“流行语”:“经得起未来考验的三级框架”,“电话”:“+1-312-296-2956x137”,“时区”:“美国/印第安纳/印第安纳波利斯”,“客户计数”:638},南,南),数据类型:float64)可能df[“公司”
@Barmar nothing。