我以前用的都是 data['AttributeName']抓取某列的数据,想求个抓取列数第n列数据方法。
2条回答 默认 最新
- threenewbee 2019-11-24 10:14关注
df.shape[1] 可以得到列数
df.iloc[:, [n]] 第n列本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 2无用
我以前用的都是 data['AttributeName']抓取某列的数据,想求个抓取列数第n列数据方法。
df.shape[1] 可以得到列数
df.iloc[:, [n]] 第n列