Articles → Pandas → Nunique Function In Dataframe In Pandas
Nunique Function In Dataframe In Pandas
Purpose
Example
import pandas as pd
import numpy as np
list = [[1,2,3], [1,np.nan,6], [7, np.nan,9]]
df = pd.DataFrame(list)
print(df.nunique())
Output
Click to Enlarge