File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,28 @@ def __get_award_numbers(df):
262
262
263
263
264
264
def __get_affiliations (df ):
265
- return df ["affiliation" ].value_counts ().to_dict ()
265
+ """
266
+ Return a dictionary containing the count of occurrences of each unique value
267
+ in the "affiliation" column of the input DataFrame.
268
+
269
+ Parameters:
270
+ -----------
271
+ df : pandas DataFrame
272
+ The input DataFrame containing a column named "affiliation" from which
273
+ the unique values will be counted.
266
274
275
+ Returns:
276
+ --------
277
+ dict
278
+ A dictionary where the keys represent unique values in the "affiliation"
279
+ column, and the values represent the count of occurrences of each unique value.
280
+
281
+ Note:
282
+ -----
283
+ The input DataFrame `df` should have a column named "affiliation" containing
284
+ categorical data, where the function will count the occurrences of each unique value.
285
+ """
286
+ return df ["affiliation" ].value_counts ().to_dict ()
267
287
268
288
def __get_contributors (df ):
269
289
return df ["contributorname" ].value_counts ().to_dict ()
You can’t perform that action at this time.
0 commit comments