Counting duplicate values in Pandas DataFrame
问题 There must be an easy way to do this, but I was unable to find an elegant solution for on SO or work it out by myself. I'm trying to count the number of duplicate values based on set of columns in a DataFrame. Example: print df Month LSOA code Longitude Latitude Crime type 0 2015-01 E01000916 -0.106453 51.518207 Bicycle theft 1 2015-01 E01000914 -0.111497 51.518226 Burglary 2 2015-01 E01000914 -0.111497 51.518226 Burglary 3 2015-01 E01000914 -0.111497 51.518226 Other theft 4 2015-01 E01000914