Code:
Hashtable items = new Hashtable(); if (!items.Contains(itemfromlist)) items.Add(itemfromlist, 1); else items[itemfromlist] = (int) items[itemfromlist]+1
Hashtable items = new Hashtable(); if (!items.Contains(itemfromlist)) items.Add(itemfromlist, 1); else items[itemfromlist] = (int) items[itemfromlist]+1
data = new Dictionary<string, List<string>>
os.chdir("..\data") uhdatafile = open("%s.txt" % self.datafile, 'r')
WindowsError: [Error 2] The system cannot find the file specified: 'C:\\Documents and Settings\\HHG\\Desktop\\Reportsdata
for key in d: d[key]['v2'].remove('bad')
infile = open('input.txt', 'r') records = infile.read() infile.close() lines = records.split() d={} for line in lines: uh, tf, tp = line.split('%') if uh in d: f=d[uh]['v1'] if tf not in f: f.append(tf) p=d[uh]['v2'] if tp is
d={1:{'v1':(a,b,c), 'v2':(good)}}
for line in lines: uh, tf, tp = line.split('%') if uh in d: f=d[uh]['v1'] if tf not in f: f.append(tf)
d={'1': ['a', 'b', 'c', 'd'], '3': ['a', 'b', 'c', 'd'], '2': ['a', 'b', 'c', 'd'], '4': ['a', 'c']} update={'a': 10, 'c': 4, 'b': 5, 'd': 1}
Combqtyoutfile = open('Combqty.txt', 'w') Combqtyoutfile.write('Qty\tNumber\tCombination\n') from collections
{'1': [10, 5, 4, 1], '3': [10, 5, 4, 1], '2': [10, 5, 4, 1], '4': [10, 4]}
{'1': [20], '3': [20], '2': [20], '4': [14]}
for item in f.values(): for items in item: sum
d={1:[a,b,b], 2:[a,a,b,c], 3:[a,b,c], 4:[a,c]}
def UnitHolderDistributionqty(dictionary): from collections import defaultdict count=defaultdict(int) for item in dictionary.values(): count[len(item)]+=1 for k,v in sorted(count.items()): fdist=k qty=v print fdist,qty
Leave a comment: