WNBA dataset : which players share birthdays

In case it saves you time… a perfectly valid question. Right? :slight_smile: There are 143 players, and 139 unique Birthdates… so?

wnba[wnba.select_dtypes(include='object').columns].nunique()
Name           143
Team            12
Pos              5
Birth_Place     15
Birthdate      139
College         65

Which Birthdates have a count greater than 1?

wnba['Birthdate'].value_counts()[wnba['Birthdate'].value_counts() > 1].index

And…

wnba.loc[ wnba['Birthdate'].isin(wnba['Birthdate'].value_counts()[wnba['Birthdate'].value_counts() > 1].index ) ,
         ['Name','Birthdate']  ].sort_values('Birthdate')
	Name	Birthdate
3	Alex Montgomery	December 11, 1988
60	Jantel Lavender	December 11, 1988
51	Erica Wheeler	February 5, 1991
85	Layshia Clarendon	February 5, 1991
105	Odyssey Sims	July 13, 1992
130	Sydney Wiese	July 13, 1992
8	Allisha Gray	October 20, 1992
77	Kayla Thornton	October 20, 1992

If you see a more elegant way, please…

Maybe this (with warning message):

birthday=wnba.set_index('Birthdate')
birthday[birthday.index.value_counts()>1]['Name']

Cleanest way:

birthday=wnba.set_index('Birthdate')
mask=(birthday.index.value_counts()>1).index
birthday.loc[mask]['Name']