当前位置:网站首页>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()])边栏推荐
- 406. Reconstruct the queue according to height
- Use of Tex editor
- socket.io搭建分布式Web推送服务器
- [pytorch learning notes] transforms
- Solve the problem that pushgateway data will be overwritten by multiple push
- Global and Chinese market of Bus HVAC systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Open under vs2019 UI file QT designer flash back problem
- The method of parameter estimation of user-defined function in MATLAB
- What is embedding (encoding an object into a low dimensional dense vector), NN in pytorch Principle and application of embedding
- Using notepad++ to build an arbitrary language development environment
猜你喜欢

4-29——4.32
![[ue4] HISM large scale vegetation rendering solution](/img/a2/2ff2462207e3c3e8364a092765040c.jpg)
[ue4] HISM large scale vegetation rendering solution

Basic SQL tutorial
![[opengl] advanced chapter of texture - principle of flowmap](/img/dd/6208122fcc578caaf098301b185e03.jpg)
[opengl] advanced chapter of texture - principle of flowmap

高并发下之redis锁优化实战

Série yolov5 (i) - - netron, un outil de visualisation de réseau
![[graphics] adaptive shadow map](/img/93/a6a3c7716331368c90c2c86da11f55.jpg)
[graphics] adaptive shadow map

5.2-5.3
![[transform] [practice] use pytoch's torch nn. Multiheadattention to realize self attention](/img/94/a9c7010fe9f14454469609ac4dd871.png)
[transform] [practice] use pytoch's torch nn. Multiheadattention to realize self attention

Kubernetes带你从头到尾捋一遍
随机推荐
Basic SQL tutorial
Global and Chinese market of trimethylamine 2022-2028: Research Report on technology, participants, trends, market size and share
基于SVN分支开发模式流程浅析
406. 根据身高重建队列
Several sentences extracted from the book "leather bag"
Global and Chinese market of optical fiber connectors 2022-2028: Research Report on technology, participants, trends, market size and share
.NET六大设计原则个人白话理解,有误请大神指正
Detailed comments on MapReduce instance code on the official website
Kubernetes - YAML文件解读
What is label encoding? How to distinguish and use one hot encoding and label encoding?
Tensor ellipsis (three points) slice
【注意力机制】【首篇ViT】DETR,End-to-End Object Detection with Transformers网络的主要组成是CNN和Transformer
Adobe Premiere Pro 15.4 has been released. It natively supports Apple M1 and adds the function of speech to text
Série yolov5 (i) - - netron, un outil de visualisation de réseau
什么是Label encoding?one-hot encoding ,label encoding两种编码该如何区分和使用?
北京共有产权房出租新规实施的租赁案例
Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
从书本《皮囊》摘录的几个句子
5.2-5.3
Use of Tex editor