Created
September 29, 2022 10:35
-
-
Save mrtushartiwari/ff475e350d58fd3f21e9842050fd3051 to your computer and use it in GitHub Desktop.
splits large csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
FILE_PATH = 'WDISeries-Time.csv' | |
chunk_size = 50 | |
parts_name = 'WDISeries-Time' | |
df = pd.read_csv(FILE_PATH,chunksize= chunk_size) | |
print(df, type(df)) | |
for i,d in enumerate(df): | |
d.to_csv(f"{parts_name}_part_{i}.csv",index= False) | |
print(d.columns) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment