Mar-22-2021, 09:57 AM
(Mar-21-2021, 02:34 PM)stylingpat Wrote: Hey guys I am trying to export a pretty big data frame. I am using this codeYou have hit a documented limitation of the object you are using. So you can't use an Excel sheet to hold all the data. You can't put ten pounds of flour in a five-pound sack. So you have to figure out how to get two five-pound sacks. Or enough cells in a spreadsheet to handle your load. You might try multiple sheets, but you might also just flat run out of memory to hold that much data. You need a different tool.
df = pd.DataFrame(historicalData) df.to_csv(r'dataframe.csv')Now my dataframe has 5 million rows in it.
When I open the CSV file, it says "not loaded completely" and only 1 million rows are loaded.
If I use this code
df = pd.DataFrame(historicalData) df.to_excel(r'dataframe.xlsx', header=True)I get the ValueError : This sheet is too large! Your sheet size is: 5218863, 8 Max sheet size is: 1048576, 16384
Anyone know how to solve this problem?
Welcome to the Wonderful World of Programming.