I have CSV, which is in a list. Example:
[[R2C1,R01,API_1,801,API_TEST01],
[R2C1,R01,API_1,802,API_TEST02],
[R2C1,R01,API_1,801,API_TEST03]]
Like to find out the all the unique in i[3] and count them.
results:
[{num: 801, count: 2}, {num: 802, count: 1}]
so that I can call dict key for another test.
Code:
for row in data[1:]:
vnum = row[3]
ipcount.append({"num":vnum,"count": count})
if row[3] not in ipcount:
ipcount.append({"num":vlan})