pip install pandas openpyxlimport pandas as pd
df = pd.read_excel("/tmp/file.xlsx")
rows_per_file = 1000
n_chunks = len(df) // rows_per_file
for i in range(n_chunks):
start = i*rows_per_file
stop = (i+1) * rows_per_file
sub_df = df.iloc[start:stop]
sub_df.to_excel(f"/tmp/splited-output-{i}.xlsx", sheet_name="a")
if stop < len(df):
sub_df = df.iloc[stop:]
sub_df.to_excel(f"/tmp/splited-output-{i}.xlsx", sheet_name="a")