Python Count Duplicate Rows In Dataframe To String Function In C