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