当前位置:网站首页>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()])
边栏推荐
- [opengl] advanced chapter of texture - principle of flowmap
- socket.io搭建分布式Web推送服务器
- Puppet自动化运维排错案例
- Tensor ellipsis (three points) slice
- 2022/02/14
- The picture quality has been improved! LR enhancement details_ Lightroom turns on AI photo detail enhancement: picture clarity increases by 30%
- SQL server安装位置改不了
- 使用JMeter对WebService进行压力测试
- 【云原生训练营】模块八 Kubernetes 生命周期管理和服务发现
- 4-24--4-28
猜你喜欢
Byte practice plane longitude 2
什么是embedding(把物体编码为一个低维稠密向量),pytorch中nn.Embedding原理及使用
The picture quality has been improved! LR enhancement details_ Lightroom turns on AI photo detail enhancement: picture clarity increases by 30%
什么是one-hot encoding?Pytorch中,将label变成one hot编码的两种方式
[graphics] adaptive shadow map
Yolov5系列(一)——網絡可視化工具netron
[ue4] HISM large scale vegetation rendering solution
ASTC texture compression (adaptive scalable texture compression)
Construction of operation and maintenance system
[set theory] inclusion exclusion principle (complex example)
随机推荐
Yolov5 series (I) -- network visualization tool netron
What is one hot encoding? In pytoch, there are two ways to turn label into one hot coding
Global and Chinese market of trimethylamine 2022-2028: Research Report on technology, participants, trends, market size and share
Yolov5 advanced nine target tracking example 1
Byte practice plane longitude 2
C # realizes the login interface, and the password asterisk is displayed (hide the input password)
Incluxdb2 buckets create database
[pytorch learning notes] transforms
PS tips - draw green earth with a brush
What is label encoding? How to distinguish and use one hot encoding and label encoding?
Apache ant extension tutorial
What are the composite types of Blackhorse Clickhouse, an OLAP database recognized in the industry
[graphics] adaptive shadow map
.NET六大设计原则个人白话理解,有误请大神指正
Devaxpress: range selection control rangecontrol uses
How to color ordinary landscape photos, PS tutorial
Several sentences extracted from the book "leather bag"
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
Composite type (custom type)
零拷贝底层剖析