SHARE
TWEET

Untitled

a guest Nov 22nd, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top