前言
问题:按照指定行数切分excel到多个表格中
解决:pandas.DataFrame.iloc
DataFrame.iloc
Purely integer-location based indexing for selection by position.
.iloc[] is primarily integer position based (from 0 to length-1 of the axis), but may also be used with a boolean array.
“基于整数位置的索引,用于按位置进行选择。”
一、df.iloc
示例:
scores = np.random.randint(50, 101, (5, 3))
names = ('张三', '李四', '王五', '黄韬', '彦霖')
courses = ('语文', '数学', '英语')
df = pd.DataFrame(data=scores, columns