Python Forum
Pandas - Write to Exisitng Excel File - Sorted List
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pandas - Write to Exisitng Excel File - Sorted List
#2
Well without seeing the error its hard to say what the problem is. I would start debugging by checking the type of what your trying to write to make sure its what to_excel() function is expecting. I am not sure what exactly it is you are trying to do. It seems as thought you are attempting to take the Column names from python.xlsx, sort them and write them to a different excel file; is that correct?

I have never used Pandas or messed with excel files before but I can tell you this much; to_excel() is expecting type ExcelWriter ie:

# Specify a writer
writer = pd.ExcelWriter('example.xlsx', engine='xlsxwriter')

# Write your DataFrame to a file     
yourData.to_excel(writer, 'Sheet1')

# Save the result 
writer.save()
Reply


Messages In This Thread
RE: Pandas - Write to Exisitng Excel File - Sorted List - by Vysero - Jul-26-2018, 08:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas keep existing format of Excel AlphaInc 2 11,648 Jan-11-2024, 03:44 AM
Last Post: plonkarchivist
  SORTED.group by and count average of two columns [ sum of col 1 / sum of col 2 ] BSDevo 1 1,666 Oct-23-2023, 09:47 PM
Last Post: BSDevo
  Write from dictionary to excel divon 3 13,565 Jun-11-2023, 10:37 AM
Last Post: Larz60+
  Data Sorting and filtering(From an Excel File) PY_ALM 0 1,723 Jan-09-2023, 08:14 PM
Last Post: PY_ALM
Smile How to further boost the data read write speed using pandas tjk9501 1 2,130 Nov-14-2022, 01:46 PM
Last Post: jefsummers
  Split excel file and write output at specific row and set sheet position DSCA 0 2,862 May-12-2022, 07:29 PM
Last Post: DSCA
  How to import an xml file to Pandas sjhazard 0 2,986 Jun-08-2021, 08:19 PM
Last Post: sjhazard
  [Pandas] Write data to Excel with dot decimals manonB 1 8,242 May-05-2021, 05:28 PM
Last Post: ibreeden
  Comparing results within a list and appending to pandas dataframe Aryagm 1 3,044 Dec-17-2020, 01:08 PM
Last Post: palladium
  Creating more than one excel File at once malvarez1976 0 2,364 Dec-15-2020, 02:04 AM
Last Post: malvarez1976

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020