Skip to content

Commit d1c4200

Browse files
committed
Merge remote-tracking branch 'upstream/main' into Wrong-error-message-in-HDFStore.append
2 parents 4627462 + fc6da9c commit d1c4200

File tree

2 files changed

+26
-71
lines changed

2 files changed

+26
-71
lines changed

pandas/core/groupby/groupby.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,8 +2170,7 @@ def mean(
21702170
numeric_only no longer accepts ``None`` and defaults to ``False``.
21712171
21722172
skipna : bool, default True
2173-
Exclude NA/null values. If an entire row/column is NA, the result
2174-
will be NA.
2173+
Exclude NA/null values. If an entire group is NA, the result will be NA.
21752174
21762175
.. versionadded:: 3.0.0
21772176
@@ -2271,8 +2270,7 @@ def median(self, numeric_only: bool = False, skipna: bool = True) -> NDFrameT:
22712270
numeric_only no longer accepts ``None`` and defaults to False.
22722271
22732272
skipna : bool, default True
2274-
Exclude NA/null values. If an entire row/column is NA, the result
2275-
will be NA.
2273+
Exclude NA/null values. If an entire group is NA, the result will be NA.
22762274
22772275
.. versionadded:: 3.0.0
22782276
@@ -2405,8 +2403,7 @@ def std(
24052403
numeric_only now defaults to ``False``.
24062404
24072405
skipna : bool, default True
2408-
Exclude NA/null values. If an entire row/column is NA, the result
2409-
will be NA.
2406+
Exclude NA/null values. If an entire group is NA, the result will be NA.
24102407
24112408
.. versionadded:: 3.0.0
24122409
@@ -2524,8 +2521,7 @@ def var(
25242521
numeric_only now defaults to ``False``.
25252522
25262523
skipna : bool, default True
2527-
Exclude NA/null values. If an entire row/column is NA, the result
2528-
will be NA.
2524+
Exclude NA/null values. If an entire group is NA, the result will be NA.
25292525
25302526
.. versionadded:: 3.0.0
25312527
@@ -2742,8 +2738,7 @@ def sem(
27422738
numeric_only now defaults to ``False``.
27432739
27442740
skipna : bool, default True
2745-
Exclude NA/null values. If an entire row/column is NA, the result
2746-
will be NA.
2741+
Exclude NA/null values. If an entire group is NA, the result will be NA.
27472742
27482743
.. versionadded:: 3.0.0
27492744
@@ -3021,8 +3016,7 @@ def prod(
30213016
than ``min_count`` non-NA values are present the result will be NA.
30223017
30233018
skipna : bool, default True
3024-
Exclude NA/null values. If an entire row/column is NA, the result
3025-
will be NA.
3019+
Exclude NA/null values. If an entire group is NA, the result will be NA.
30263020
30273021
.. versionadded:: 3.0.0
30283022
@@ -3242,8 +3236,7 @@ def first(
32423236
The required number of valid values to perform the operation. If fewer
32433237
than ``min_count`` valid values are present the result will be NA.
32443238
skipna : bool, default True
3245-
Exclude NA/null values. If an entire row/column is NA, the result
3246-
will be NA.
3239+
Exclude NA/null values. If an entire group is NA, the result will be NA.
32473240
32483241
.. versionadded:: 2.2.1
32493242
@@ -3329,8 +3322,7 @@ def last(
33293322
The required number of valid values to perform the operation. If fewer
33303323
than ``min_count`` valid values are present the result will be NA.
33313324
skipna : bool, default True
3332-
Exclude NA/null values. If an entire row/column is NA, the result
3333-
will be NA.
3325+
Exclude NA/null values. If an entire group is NA, the result will be NA.
33343326
33353327
.. versionadded:: 2.2.1
33363328
@@ -5530,8 +5522,7 @@ def _idxmax_idxmin(
55305522
numeric_only : bool, default False
55315523
Include only float, int, boolean columns.
55325524
skipna : bool, default True
5533-
Exclude NA/null values. If an entire row/column is NA, the result
5534-
will be NA.
5525+
Exclude NA/null values. If an entire group is NA, the result will be NA.
55355526
ignore_unobserved : bool, default False
55365527
When True and an unobserved group is encountered, do not raise. This used
55375528
for transform where unobserved groups do not play an impact on the result.

pandas/tests/io/json/test_ujson.py

Lines changed: 17 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -53,60 +53,24 @@ def orient(request):
5353

5454
class TestUltraJSONTests:
5555
@pytest.mark.skipif(not IS64, reason="not compliant on 32-bit, xref #15865")
56-
def test_encode_decimal(self):
57-
sut = decimal.Decimal("1337.1337")
58-
encoded = ujson.ujson_dumps(sut, double_precision=15)
59-
decoded = ujson.ujson_loads(encoded)
60-
assert decoded == "1337.1337"
61-
62-
sut = decimal.Decimal("0.95")
63-
encoded = ujson.ujson_dumps(sut, double_precision=1)
64-
assert encoded == '"0.95"'
65-
66-
decoded = ujson.ujson_loads(encoded)
67-
assert decoded == "0.95"
68-
69-
sut = decimal.Decimal("0.94")
70-
encoded = ujson.ujson_dumps(sut, double_precision=1)
71-
assert encoded == '"0.94"'
72-
73-
decoded = ujson.ujson_loads(encoded)
74-
assert decoded == "0.94"
75-
76-
sut = decimal.Decimal("1.95")
77-
encoded = ujson.ujson_dumps(sut, double_precision=1)
78-
assert encoded == '"1.95"'
79-
80-
decoded = ujson.ujson_loads(encoded)
81-
assert decoded == "1.95"
82-
83-
sut = decimal.Decimal("-1.95")
84-
encoded = ujson.ujson_dumps(sut, double_precision=1)
85-
assert encoded == '"-1.95"'
86-
87-
decoded = ujson.ujson_loads(encoded)
88-
assert decoded == "-1.95"
89-
90-
sut = decimal.Decimal("0.995")
91-
encoded = ujson.ujson_dumps(sut, double_precision=2)
92-
assert encoded == '"0.995"'
93-
94-
decoded = ujson.ujson_loads(encoded)
95-
assert decoded == "0.995"
96-
97-
sut = decimal.Decimal("0.9995")
98-
encoded = ujson.ujson_dumps(sut, double_precision=3)
99-
assert encoded == '"0.9995"'
100-
101-
decoded = ujson.ujson_loads(encoded)
102-
assert decoded == "0.9995"
103-
104-
sut = decimal.Decimal("0.99999999999999944")
105-
encoded = ujson.ujson_dumps(sut, double_precision=15)
106-
assert encoded == '"0.99999999999999944"'
107-
56+
@pytest.mark.parametrize(
57+
"value, double_precision",
58+
[
59+
("1337.1337", 15),
60+
("0.95", 1),
61+
("0.94", 1),
62+
("1.95", 1),
63+
("-1.95", 1),
64+
("0.995", 2),
65+
("0.9995", 3),
66+
("0.99999999999999944", 15),
67+
],
68+
)
69+
def test_encode_decimal(self, value, double_precision):
70+
sut = decimal.Decimal(value)
71+
encoded = ujson.ujson_dumps(sut, double_precision=double_precision)
10872
decoded = ujson.ujson_loads(encoded)
109-
assert decoded == "0.99999999999999944"
73+
assert decoded == value
11074

11175
@pytest.mark.parametrize("ensure_ascii", [True, False])
11276
def test_encode_string_conversion(self, ensure_ascii):

0 commit comments

Comments
 (0)