First normalize the original data, then set the key value yourself, then use the Counter of collections to count, and then traverse and write it to the db. The approximate code is as follows:
data = ['/a 1.2.1.2', '/b 2.2.2.2', '/c 1.1.1.1', '/d 2.2.2.2', '/d 2.2.2.2']
from collections import Counter
c = Counter(data)
print c
First normalize the original data, then set the key value yourself, then use the Counter of collections to count, and then traverse and write it to the db. The approximate code is as follows:
You can also maintain the dictionary yourself, the key is:
/PATH:IP
or something, you can set it yourself, and then just add it while traversing it