📜  iloc 中的切片 - Python 代码示例

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

代码示例1
df.iloc[:3] # slice your object, i.e. first three rows of your dataframe
df.iloc[0:3] # same
df.iloc[0, 1] # index both axis. Select the element from the first row, second column.
df.iloc[:, 0:5] # first five columns of data frame with all rows