Python Forum
Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values
#2
Just access the Dataframe and not the Series object:

names = df.sort_values(["Sex", "Height"], ascending =[False, False])["Name"]
df["Name"] will return a Series object of the column "Name".
The columns you need ("Sex", "Height"), are not in the resulting series object.
KMV likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values - by DeaD_EyE - Mar-09-2021, 11:02 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create a new subclass in a Python extension based on an existing class voidtrance 6 1,282 Mar-25-2025, 06:37 PM
Last Post: voidtrance
  Create dual folder on different path/drive based on the date agmoraojr 2 1,327 Jan-21-2024, 10:02 AM
Last Post: snippsat
  __init__() got multiple values for argument 'schema' dawid294 4 9,461 Jan-03-2024, 09:42 AM
Last Post: buran
  Transposing a dataframe without creating NaN values doug2019 2 1,873 Mar-18-2023, 03:14 PM
Last Post: jefsummers
  Create new dataframe from old dataframe arvin 3 1,929 Jan-31-2023, 01:23 PM
Last Post: jefsummers
Lightbulb Help using Google Sheets matheuspimenta 0 1,211 Dec-15-2022, 05:36 PM
Last Post: matheuspimenta
  create new column based on condition arvin 12 4,263 Dec-13-2022, 04:53 PM
Last Post: jefsummers
  How do you create a scatterplot of dataframe using matplotlib? asdad 2 1,598 Dec-07-2022, 04:53 PM
Last Post: Larz60+
  How to loop through all excel files and sheets in folder jadelola 1 9,092 Dec-01-2022, 06:12 PM
Last Post: deanhystad
  Failing to print sorted files tester_V 4 2,524 Nov-12-2022, 06:49 PM
Last Post: tester_V

Forum Jump:

User Panel Messages

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