Fix inconsistent return type for statistics median_grouped() gh-92531 (GH-92533) (#92656)

This commit is contained in:
Miss Islington (bot) 2022-05-10 21:45:17 -07:00 committed by GitHub
parent 5197134c1c
commit 951cfc8e54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 14 deletions

View file

@ -1742,6 +1742,12 @@ class TestMedianGrouped(TestMedian):
data = [x]*count
self.assertEqual(self.func(data), float(x))
def test_single_value(self):
# Override method from AverageMixin.
# Average of a single value is the value as a float.
for x in (23, 42.5, 1.3e15, Fraction(15, 19), Decimal('0.28')):
self.assertEqual(self.func([x]), float(x))
def test_odd_fractions(self):
# Test median_grouped works with an odd number of Fractions.
F = Fraction