Created
February 23, 2023 07:05
-
-
Save aasthavar/37b72c756498172b8556109b47a1ce64 to your computer and use it in GitHub Desktop.
Data Processing - Unique Values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def unique_values(data): | |
| total = data.count() | |
| tt = pd.DataFrame(total) | |
| tt.columns = ['Total'] | |
| uniques = [] | |
| for col in data.columns: | |
| unique = data[col].nunique() | |
| uniques.append(unique) | |
| tt['Uniques'] = uniques | |
| return(np.transpose(tt)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment