statistics: Fix geometric_mean() error message for negative inputs (#149246)

This commit is contained in:
htjworld
2026-05-02 12:54:24 +09:00
committed by GitHub
parent 0e2c055892
commit 0f5cd57f80
+1 -1
View File
@@ -248,7 +248,7 @@ def geometric_mean(data):
elif x == 0.0:
found_zero = True
else:
raise StatisticsError('No negative inputs allowed', x)
raise StatisticsError(f'No negative inputs allowed: {x!r}')
total = fsum(map(log, count_positive(data)))