当前位置:网站首页>Dataframe returns the whole row according to the value
Dataframe returns the whole row according to the value
2022-07-03 15:08:00 【2pi】
import pandas as pd
df = pd.DataFrame(
{
" full name ":[" Xiao Zhang "," Xiao Wang "," petty thief "," Xiao zhao "],
" Gender ":[" male "," Woman "," male "," Woman "],
" Age ":[18,19,20,21]
}
)
print(df)
lookup ” Minimum age ” Place of action
Method 1
utilize argmin Return row index , recycling loc Function lookup
import pandas as pd
df = pd.DataFrame(
{
" full name ":[" Xiao Zhang "," Xiao Wang "," petty thief "," Xiao zhao "],
" Gender ":[" male "," Woman "," male "," Woman "],
" Age ":[18,19,20,21]
}
)
print(df.loc[df[" Age "].argmin()])give the result as follows

Method 2
print(df.loc[df[" Age "] == df[" Age "].min()])边栏推荐
- 4-20-4-23 concurrent server, TCP state transition;
- . Net six design principles personal vernacular understanding, please correct if there is any error
- Yolov5进阶之九 目标追踪实例1
- 【pytorch学习笔记】Datasets and Dataloaders
- Remote server background hangs nohup
- Use of Tex editor
- 406. 根据身高重建队列
- 开启 Chrome 和 Edge 浏览器多线程下载
- What is machine reading comprehension? What are the applications? Finally someone made it clear
- [graphics] efficient target deformation animation based on OpenGL es 3.0
猜你喜欢

Remote server background hangs nohup

mysql innodb 存储引擎的特性—行锁剖析

创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03

【微信小程序】WXSS 模板样式

什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式

How to color ordinary landscape photos, PS tutorial

The picture quality has been improved! LR enhancement details_ Lightroom turns on AI photo detail enhancement: picture clarity increases by 30%

第04章_逻辑架构

Unity hierarchical bounding box AABB tree
![[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018](/img/2b/b23aeab584f89be6678c0fe059d4b6.png)
[transformer] Introduction - the original author of Harvard NLP presented the annotated transformer in the form of line by line implementation in early 2018
随机推荐
How does vs+qt set the software version copyright, obtain the software version and display the version number?
Kubernetes带你从头到尾捋一遍
mysql innodb 存储引擎的特性—行锁剖析
【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
Leetcode sword offer find the number I (nine) in the sorted array
Yolov5进阶之八 高低版本格式转换问题
创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
Qt—绘制其他东西
The latest M1 dedicated Au update Adobe audit CC 2021 Chinese direct installation version has solved the problems of M1 installation without flash back!
Kubernetes - YAML文件解读
Using TCL (tool command language) to manage Tornado (for VxWorks) can start the project
App global exception capture
Class part2
Global and Chinese market of transfer case 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese market of lighting control components 2022-2028: Research Report on technology, participants, trends, market size and share
C # realizes the login interface, and the password asterisk is displayed (hide the input password)
Byte practice plane longitude 2
redis缓存穿透,缓存击穿,缓存雪崩解决方案
【pytorch学习笔记】Datasets and Dataloaders
[ue4] geometry drawing pipeline