Guest User

Untitled

a guest
Apr 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. 1# Iterate over the column in dataframe
  2. 2 for entry in col:
  3. 3
  4. 4 # If entry is in cols_count, add 1
  5. 5 if entry in cols_count.keys():
  6. 6 cols_count[entry] += 1
  7. 7 # Else add the entry to cols_count, set the value to 1
  8. 8 else:
  9. 9 cols_count[entry] = 1
  10. 10
  11. 11 # Return the cols_count dictionary
  12. 12 return cols_count
Add Comment
Please, Sign In to add comment