📌  相关文章
📜  python - 按行数对数据帧进行行切片 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:36.770000             🧑  作者: Mango

代码示例1
df.iloc[[1, 5]]                                               # Get rows 1 and 5
df.iloc[1:6]                                                  # Get rows 1 to 5 inclusive
df.iloc[[1, 5], df.columns.get_loc('Shop')]                   # Get only specific column
df.iloc[[1, 5], df.columns.get_indexer(['Shop', 'Category'])] # Get multiple columns