摘要: loc函数:通过行索引 "Index" 中的具体值来取行数据(如取"Index"为"A"的行) iloc函数:通过行号来取行数据(如取第二行的数据) 本文给出loc、iloc常见的五种用法,并附上详细代码。 1. 利用loc、iloc提取行数据 import numpy as np import p 阅读全文
posted @ 2020-09-21 18:28 PythonGirl 阅读(1804) 评论(0) 推荐(0) 编辑
摘要: at 函数:通过行名和列名来取值(取行名为a, 列名为A的值) iat 函数:通过行号和列号来取值(取第1行,第1列的值) 本文给出at、iat常见的用法,并附上详细代码。 1. 首先创建一个DataFrame(data) Out[1]: pd.DataFrame(np.arange(15).res 阅读全文
posted @ 2020-09-21 18:20 PythonGirl 阅读(4635) 评论(0) 推荐(0) 编辑