Skip to content

Commit

Permalink
Update countdata.py
Browse files Browse the repository at this point in the history
  • Loading branch information
indhradhanush authored Apr 19, 2023
1 parent 550163d commit 142683a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/countdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@
disconnectedcount = 0

def getapcategories(r2):
c = Counter(player['deviceStatus'] for player in r2)
c = dict(c)
return(c)
#c = Counter(player['deviceStatus'] for player in r2)
#c = dict(c)
dev_status_list = []
for x in range(0, len(r2)):
if "deviceStatus" in r2[x]:
#print("Exists")
dev_status_list.append(r2[x]['deviceStatus'])
else:
#print("Does not exist")
dev_status_list.append("Unknown")
print(dev_status_list)
count_dev = dict(Counter(dev_status_list))
print(count_dev)
return(count_dev)

def getcustomers(r2):
c = Counter(player['customerName'] for player in r2)
Expand All @@ -27,4 +38,4 @@ def getmodels(r2):
def getvenues(r2):
c = Counter(player['venueName'] for player in r2)
c = dict(c)
return(c)
return(c)

0 comments on commit 142683a

Please sign in to comment.