小编ram*_*uez的帖子

在 DataFrame Pandas 中选择多个列。切片+选择

我有大约 100 列的 de DataFrame

我需要选择 col2 到 col4 和 col54。我该怎么做?我试过:

df = df.loc[:,'col2':col4'] 
Run Code Online (Sandbox Code Playgroud)

但我无法添加 col54

python dataframe pandas

3
推荐指数
1
解决办法
5143
查看次数

标签 统计

dataframe ×1

pandas ×1

python ×1