Hello,
Any comments on the below mentioned problem are most appreciated.
I have a function and it is throwing this error:
This is the function:
Not sure why.
G.
Any comments on the below mentioned problem are most appreciated.
I have a function and it is throwing this error:
Code:
FEXpython_v2.py", line 32, in UnitHolderDistributionqty
count[item]+=1
KeyError: 3
Code:
def Distributionqty(dictionary):
holder=list()
held=list()
distqtydic={}
count={}
for key in sorted(dictionary.keys()):
holder.append(key)
held.append(len(dictionary[key]))
for (key, value) in map(None, holder, held):
distqtydic[key]=value
for item in distqtydic.values():
count[item]+=1
for k,v in sorted(count.items()):
fdist=k
qty=v
print fdist,qty
G.
Comment