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
#1
hi friends

how can i write my sorted list to an exisitng excel file ie sheet name and column number

from openpyxl import load_workbook
import pandas as pd
from pandas import ExcelWriter
from pandas import ExcelFile
 
df = pd.read_excel('python.xlsx', sheet_name='Sheet1')

z= list(df.names)                                                    #Column Name is imported into a List  >  ['Sean', 'Joyce', 'Ruby', 'Pamela']

print(sorted(z,key=len))



#sorted_words=(sorted(z,key=len))


#sorted_words.to_excel('test.xlsx')
thank you for your help



:)


Python newbie trying to learn the ropes
Reply


Messages In This Thread
Pandas - Write to Exisitng Excel File - Sorted List - by dj99 - Jul-26-2018, 10:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pandas keep existing format of Excel AlphaInc 2 1,068 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 691 Oct-23-2023, 09:47 PM
Last Post: BSDevo
  Write from dictionary to excel divon 3 3,795 Jun-11-2023, 10:37 AM
Last Post: Larz60+
  Data Sorting and filtering(From an Excel File) PY_ALM 0 1,053 Jan-09-2023, 08:14 PM
Last Post: PY_ALM
Smile How to further boost the data read write speed using pandas tjk9501 1 1,270 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,001 May-12-2022, 07:29 PM
Last Post: DSCA
  How to import an xml file to Pandas sjhazard 0 2,365 Jun-08-2021, 08:19 PM
Last Post: sjhazard
  [Pandas] Write data to Excel with dot decimals manonB 1 5,894 May-05-2021, 05:28 PM
Last Post: ibreeden
  Comparing results within a list and appending to pandas dataframe Aryagm 1 2,353 Dec-17-2020, 01:08 PM
Last Post: palladium
  Creating more than one excel File at once malvarez1976 0 1,819 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