Skip to content

Commit b025232

Browse files
committed
Change sum() to ndarray.sum()
1 parent 11c26e2 commit b025232

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/algorithms.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,9 @@ def value_counts(
724724
result = result.sort_values(ascending=ascending)
725725

726726
if normalize:
727-
result = result / float(sum(counts))
727+
if not isinstance(counts, np.ndarray):
728+
counts = counts.to_numpy()
729+
result = result / float(counts.sum())
728730

729731
return result
730732

0 commit comments

Comments
 (0)