如何选择带有切片的列? [英] How can I choose the column with slice?
本文介绍了如何选择带有切片的列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
import pandas as pd
# a b c d e
# 1 2 5 3 999
# 2 4 2 4 2
# 999 2 8 7 999
df = pd.read_clipboard()
df
我想使用df.iloc[:,[0:2,4]]
来选择上述df
中的列.如何在df.iloc
中设置参数?我已经看到了这个问题,但现在找不到了!
I want to pick the columns in the above df
by using df.iloc[:,[0:2,4]]
. How to set the parameters in df.iloc
? I have been seen this question, but I can't find it out now!
我期望的是:
a b e
列.
推荐答案
使用 查看全文