It is possible to specify the number of rows per DataFrame by specifying the value of k below.
k = 10000 #Number of rows per DataFrame
dfs = [df.loc[i:i+k-1, :] for i in range(0, len(df), k)]
for i, df_i in enumerate(dfs):
fname = str(i) + ".csv"
df_i.to_csv(fname)
Recommended Posts