If i have column of data frame, then how to define column value is unique or not
CodePudding user response:
IIUC use numpy.where
with Series.duplicated
and for counts Series.map
with Series.value_counts
:
df['Count WFID'] = np.where(df['WFID'].duplicated(kee=False), 'not unique', 1)
df['Count WF in PD'] = df['WFID'].map(df['WFID'].value_counts())