gpt4 book ai didi

python - 如何选择带切片的列?

转载 作者:太空宇宙 更新时间:2023-11-04 00:27:36 25 4
gpt4 key购买 nike

<分区>

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中的参数?我已经看到这个问题,但我现在找不到它!

我期望的是:a be 列。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com