SHARE
TWEET

Untitled

a guest Jan 21st, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from collections import defaultdict
  2.  
  3. teams_by_name = defaultdict(list)
  4.  
  5. units_and_local_workbook = load_workbook(filename='teams.xlsx')
  6. for sheets in units_and_local_workbook:
  7.     unit_sheet = units_and_local_workbook.get_sheet_by_name(sheets.title)
  8.     for value in unit_sheet.iter_rows(min_row=3, min_col=1, max_col=1, values_only=True):
  9.         string_out = str(value)
  10.         unit_number = re.findall(r'\d+', string_out)
  11.         teams_by_name[unit_sheet.title].append(int(unit_number[0]))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top