-1

I am trying to export a dataframe with more than 2 million rows into Excel. But since Excel's maximum limit is ~1mil rows. All of the data doesn't go through. Is there any way of doing it? Thanks in advance.

new1.to_csv( "combined.csv", index=False, encoding='utf-8-sig') enter image description here

Syed
  • 21
  • 1
  • 4
  • 3
    This is a limitation of Microsoft Excel and has nothing to do with Python. Your code has nothing to do with Excel - it's just creating a CSV which is essentially a flat file limited only by disk space – DarkKnight Sep 15 '22 at 06:52
  • Yep, but is there any way of going around it? – Syed Sep 15 '22 at 06:54
  • I have already grouped by and made the data as precise as I can. Reducing it further isn't an option. Thanks – Syed Sep 15 '22 at 06:58

1 Answers1

0

I don't think there's a way to exceed that limit, as Vlad pointed out, that's a limitation of Excel.

What I think you could do, if that's an option, is writing the data to the same file, different sheets. An example is shown in this answer.

el_gio
  • 56
  • 7
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 19 '22 at 11:39