Python Forum
Iterate over data and sum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Iterate over data and sum
#1
Music 
Hi guys.

Hope you can helped. I have been thinking about how to solve this problem, but I cant. Basically, I have a dataset of around 800 rows, with a name that contains a value. The dataset have multiple of the same values. What I am trying to solve, is how to iterate over all the rows and add together the Number_Count, each time they have the same NameOfProduct, and then in the end, give me all the unique values with overall sum. There around 750 NameOfProducts and maybe 400 unique NameOfProduct.

Here is a part of the data.

NameOfProduct	         Number_Count	Number_of_times
0	Minilæssere	              1	               1
1	Pallegafler	              1	               1
2	Rendegravere	          1	               1
3	Saltspreder	              1            	   1
4	Sneplov	                  2	               1
5	Vogne	                  2	               1
6	Gps	                      1	               1
7	Skovle	                  1	               1
8	Brakslåmaskiner	          2	               1
9	River Og Vendere	      16           	   1
10	Selvkørende Finsnittere	  7	               1
Hope it makes sense :/
Hope you can help! :)

Thank you!
Reply


Messages In This Thread
Iterate over data and sum - by Madame32 - Oct-13-2019, 07:37 PM
RE: Iterate over data and sum - by ClimbAddict - Oct-13-2019, 10:11 PM
RE: Iterate over data and sum - by Malt - Oct-14-2019, 10:36 AM
RE: Iterate over data and sum - by scidam - Oct-14-2019, 11:04 AM
RE: Iterate over data and sum - by perfringo - Oct-14-2019, 11:37 AM
RE: Iterate over data and sum - by Madame32 - Oct-14-2019, 03:58 PM
RE: Iterate over data and sum - by perfringo - Oct-14-2019, 04:36 PM
RE: Iterate over data and sum - by Madame32 - Oct-14-2019, 04:54 PM
RE: Iterate over data and sum - by Madame32 - Oct-14-2019, 05:54 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Alternative approach to iterate numerous linear regressions with xlsx data? john_538 0 2,516 Apr-07-2018, 10:15 PM
Last Post: john_538

Forum Jump:

User Panel Messages

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