I'm trying to read Excel/csv file with data more than 1m and split it
For example:
I have Excel file with 2.7M data and now I want to split it in 3 files of 0.9M data using python.
Code:
import pandas as pd
df = pd.read_excel("/path/to/excels/file.xlsx")
n_partitions = 3
for i in range(n_partitions):
sub_df = df.iloc[(i*n_paritions):((i+1)*n_paritions)]
sub_df.to_excel(f"/output/path/to/test-{i}.xlsx", sheet_name="a")
I tried this it's working fine for less data but want something that can help when we have data more than 1m as we all know Excel have limitation upto 1m to show data.