提取最后一列:
df.iloc[:,-1]
提取最后一行:
df.iloc[-1:] df1.tail(1)
在Pandas pre-0.14 iloc中,在out-of-bounds访问中将提升IndexError,而.head()和.tail()将不会出现。
iloc
IndexError
.head()
.tail()