isudatateam / datateam

Implicit enumerate calls found PTC-W0060
Anti-pattern
Major
3 months ago3 months old
Consider replacing range(len(columns3)) with enumerate(columns3)
117            )
118            cell.cell.input_value = columns2[colnum]
119            spr_client.update(cell)
120        for colnum in range(len(columns3)):121            cell = spr_client.get_cell(
122                spreadkey, sheet.get_worksheet_id(), 3, colnum + 1
123            )
Consider replacing range(len(columns2)) with enumerate(columns2)
111            )
112            cell.cell.input_value = columns[colnum]
113            spr_client.update(cell)
114        for colnum in range(len(columns2)):115            cell = spr_client.get_cell(
116                spreadkey, sheet.get_worksheet_id(), 2, colnum + 1
117            )
Consider replacing range(len(columns)) with enumerate(columns)
105    for yr in ["2011", "2013", "2015"]:
106        print("Adding worksheet for year: %s" % (yr,))
107        sheet = spr_client.add_worksheet(spreadkey, yr, 10, len(columns))
108        for colnum in range(len(columns)):109            cell = spr_client.get_cell(
110                spreadkey, sheet.get_worksheet_id(), 1, colnum + 1
111            )
Consider replacing range(len(columns)) with enumerate(columns)
85    for yr in ["2011", "2012", "2013", "2014", "2015"]:
86        print("Adding worksheet for year: %s" % (yr,))
87        sheet = spr_client.add_worksheet(spreadkey, yr, 10, len(columns))
88        for colnum in range(len(columns)):89            cell = spr_client.get_cell(
90                spreadkey, sheet.get_worksheet_id(), 1, colnum + 1
91            )
Consider replacing range(len(columns)) with enumerate(columns)
60    rows = []
61    # Units row
62    entry = gdata.spreadsheets.data.ListEntry()
63    for i in range(len(columns)):64        entry.set_value(columns[i].replace(" ", ""), units[i])
65    rows.append(entry)
66    for plot in plots: