【发布时间】:2015-02-24 09:26:19
【问题描述】:
我正在学习 Python pandas 库。来自 R 背景,索引和选择功能似乎比它们需要的更复杂。我的理解是 .loc() 仅基于标签,而 .iloc() 仅基于整数。
如果 .ix() 更快并且支持整数和标签访问,我为什么还要使用 .loc() 和 .iloc()?
【问题讨论】:
-
这个答案here 应该很有帮助!
-
永远不要使用
.ix! Here is an even more helpful answer.loc、.iloc和[]之间的区别