相关疑难解决方法(0)

熊猫:替换为.ix

鉴于对pandas 0.20.0的更新和弃用.ix,我想知道使用剩余的.loc和最好的方法来获得相同的结果是什么.iloc.我刚回答了这个问题,但第二个选项(不使用.ix)似乎效率低下且冗长.

片段:

print df.iloc[df.loc[df['cap'].astype(float) > 35].index, :-1]
Run Code Online (Sandbox Code Playgroud)

这是使用条件和索引位置过滤时的正确方法吗?

python indexing pandas

10
推荐指数
2
解决办法
6656
查看次数

标签 统计

indexing ×1

pandas ×1

python ×1