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
#5
from collections import Counter           
aList = [1,2,1,2,3,2,1]
bList = []
cList = []
c = collections.Counter()
myDict = {}
count = 1
for x in aList:  
   bList.append(x)
   for y in bList:
       cList.append(y)
   c.update(finalList)
   bList = []
   myDict[count] = {'notecount':dict(c)}
   count = count + 1
   c = collections.Counter()
Reply


Messages In This Thread
RE: List showing running total of instances - by Pie_Fun - Jan-18-2017, 03:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python List with Total and Average mcnhscc39 3 3,146 Nov-28-2018, 09:02 AM
Last Post: DeaD_EyE
  TypeError: '<=' not supported between instances of 'list' and 'int' Leonzxd 4 63,293 May-18-2018, 09:49 AM
Last Post: Leonzxd
  applying total in a loop to a list JustinxFFx 1 2,264 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