We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60b93d9 commit f5d7a8dCopy full SHA for f5d7a8d
Lib/test/test_statistics.py
@@ -2263,6 +2263,22 @@ def test_special_values(self):
2263
with self.assertRaises(ValueError):
2264
geometric_mean([Inf, -Inf])
2265
2266
+ def test_mixed_int_and_float(self):
2267
+ # Regression test for b.p.o. issue #28327
2268
+ geometric_mean = statistics.geometric_mean
2269
+ expected_mean = 3.80675409583932
2270
+ values = [
2271
+ [2, 3, 5, 7],
2272
+ [2, 3, 5, 7.0],
2273
+ [2, 3, 5.0, 7.0],
2274
+ [2, 3.0, 5.0, 7.0],
2275
+ [2.0, 3.0, 5.0, 7.0],
2276
+ ]
2277
+ for v in values:
2278
+ with self.subTest(v=v):
2279
+ actual_mean = geometric_mean(v)
2280
+ self.assertAlmostEqual(actual_mean, expected_mean, places=5)
2281
+
2282
2283
class TestQuantiles(unittest.TestCase):
2284
0 commit comments