Python Forum
List showing running total of instances
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List showing running total of instances
#1
Hi Folks,

to try and explain what I'm trying to do
Say I have a list of numbers
48,52,55,48,52,55,60,62,48
what I want is a corresponding list with the number of instances that a number has appeared to that point in the list.
so it would be
1,1,1,2,2,2,1,1,3

Thanks for any feedback
Reply


Messages In This Thread
List showing running total of instances - by Pie_Fun - Jan-17-2017, 04:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python List with Total and Average mcnhscc39 3 4,120 Nov-28-2018, 09:02 AM
Last Post: DeaD_EyE
  TypeError: '<=' not supported between instances of 'list' and 'int' Leonzxd 4 67,953 May-18-2018, 09:49 AM
Last Post: Leonzxd
  applying total in a loop to a list JustinxFFx 1 2,979 Feb-11-2018, 03:14 AM
Last Post: nilamo

Forum Jump:

User Panel Messages

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