mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
statistics: Fix geometric_mean() error message for negative inputs (#149246)
This commit is contained in:
+1
-1
@@ -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)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user