当前位置:网站首页>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()])边栏推荐
- Global and Chinese market of optical fiber connectors 2022-2028: Research Report on technology, participants, trends, market size and share
- 【日常训练】395. 至少有 K 个重复字符的最长子串
- 【Transform】【实践】使用Pytorch的torch.nn.MultiheadAttention来实现self-attention
- 4-20-4-23 concurrent server, TCP state transition;
- Global and Chinese markets for infrared solutions (for industrial, civil, national defense and security applications) 2022-2028: Research Report on technology, participants, trends, market size and sh
- Detailed comments on MapReduce instance code on the official website
- TPS61170QDRVRQ1
- App全局异常捕获
- XWiki安装使用技巧
- The first character of leetcode sword offer that only appears once (12)
猜你喜欢

Yolov5系列(一)——網絡可視化工具netron

Redis主从、哨兵、集群模式介绍
![[ue4] HISM large scale vegetation rendering solution](/img/a2/2ff2462207e3c3e8364a092765040c.jpg)
[ue4] HISM large scale vegetation rendering solution

【pytorch学习笔记】Datasets and Dataloaders

PS tips - draw green earth with a brush

4-20-4-23 concurrent server, TCP state transition;

Zero copy underlying analysis

什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用

解决pushgateway数据多次推送会覆盖的问题

零拷贝底层剖析
随机推荐
Pytorch深度学习和目标检测实战笔记
QT program font becomes larger on computers with different resolutions, overflowing controls
Puppet自动化运维排错案例
官网MapReduce实例代码详细批注
Tencent internship interview sorting
Relationship between truncated random distribution and original distribution
【云原生训练营】模块七 Kubernetes 控制平面组件:调度器与控制器
Use of Tex editor
App全局异常捕获
Global and Chinese markets for indoor HDTV antennas 2022-2028: Research Report on technology, participants, trends, market size and share
redis单线程问题强制梳理门外汉扫盲
How does vs+qt set the software version copyright, obtain the software version and display the version number?
Class part2
创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
【Transform】【NLP】首次提出Transformer,Google Brain团队2017年论文《Attention is all you need》
Explanation of time complexity and space complexity
第04章_逻辑架构
Neon global and Chinese markets 2022-2028: Research Report on technology, participants, trends, market size and share
mmdetection 学习率与batch_size关系
Troubleshooting method of CPU surge