Skip to content

Commit bce5ab1

Browse files
authored
Update algorithms.py
1 parent b89ffb3 commit bce5ab1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/core/algorithms.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,11 @@ def value_counts_internal(
918918
result = result / counts.sum()
919919
elif normalize == "keep":
920920
# Add normlized values to counts.
921-
result = result.astype(str)+'('+(result/counts.sum()).apply(lambda x: round(x, 6)).astype(str)+')'
921+
result = result.astype(str) + "(" + (
922+
(result / counts.sum()).apply(lambda x: round(x, 6))
923+
.astype(str)
924+
) + ")"
925+
922926
return result
923927

924928
# Called once from SparseArray, otherwise could be private

0 commit comments

Comments
 (0)