[英]How to get value from row for particular entity python
df.loc[df['Name']=='Krish','Age'].values[0]
If you wish to get answer in int/str/float convert it to list
and then show the first value by [0]
如果您希望在 int/str/float 中获得答案,请将其转换为list
,然后通过[0]
显示第一个值
df.loc[df['Name']=='Krish','Age'].tolist()[0]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.