Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def cnt_uniq_type_in_column(file_obj, column):
  2. data_base = csv.reader(file_obj)
  3. req_types = set()
  4. cnt = 0
  5. for row in data_base:
  6. if not (row[column] in req_types):
  7. cnt += 1
  8. req_types.add(row[column])
  9. return cnt - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement