Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Aggregating CSV Data
#1
I have a CSV file that I will be working with, and it contains a lot of data, and two of the columns are "Company Name" and "Sales". I would like to add a "Sales Group" column, which divides all of the companies on the sheet in thirds based on their "Sales". The top 1/3 of companies based on sales would have "High Sales" in the "Sales Group" column, while the middle 1/3 and lower 1/3 would have "Medium Sales" and "Low Sales", respectively. I would like to keep the rest of the data the same, and just add this new column.

I have attached a sample CSV file so it is more clear what I am after. Thank you in advance for any assistance.
.csv   Data Python (version 1).csv (Size: 292 bytes / Downloads: 301)
Reply


Messages In This Thread
Aggregating CSV Data - by nb1214 - Jun-10-2021, 05:15 PM
RE: Aggregating CSV Data - by Axel_Erfurt - Jun-10-2021, 06:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Basic one: Aggregating from a dictionary Mustey 1 1,913 Aug-12-2019, 07:33 PM
Last Post: buran

Forum Jump:

User Panel Messages

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