Skip to navigation
Create a short_styles dic
30.09.15
.......... import sortedcontainers ............ self.short_style = sortedcontainers.SortedDict() c = self.con.cursor() c.callproc('zz_get_distinct_shortprices',('dummy',)) self.sp = [i['mh2_style_code'] for i in c] c2 = self.con.cursor() c2.callproc('zz_get_styles_types',('dummy',)) styles = [i['av0_style'] for i in c2] self.styles = set(styles) self.tsp = tuple(self.sp) def main(self): for style in self.styles: for i in range(0,len(style)): skey = style[:len(style)-i] if(skey in self.tsp): short = self.sp[self.sp.index(skey)] if not(short in self.short_style): self.short_style[short] = sortedcontainers.SortedList() self.short_style[short].add(style) break
https://docs.python.org/3/library/stdtypes.html#str.startswith
Reply
Anonymous
Information Epoch 1794876838
Data dominates.
Home
Notebook
Contact us