Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into Wrong-error-message…
Browse files Browse the repository at this point in the history
…-in-HDFStore.append
  • Loading branch information
JakeTT404 committed Feb 4, 2025
2 parents 4627462 + fc6da9c commit d1c4200
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 71 deletions.
27 changes: 9 additions & 18 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -2170,8 +2170,7 @@ def mean(
numeric_only no longer accepts ``None`` and defaults to ``False``.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 3.0.0
Expand Down Expand Up @@ -2271,8 +2270,7 @@ def median(self, numeric_only: bool = False, skipna: bool = True) -> NDFrameT:
numeric_only no longer accepts ``None`` and defaults to False.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 3.0.0
Expand Down Expand Up @@ -2405,8 +2403,7 @@ def std(
numeric_only now defaults to ``False``.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 3.0.0
Expand Down Expand Up @@ -2524,8 +2521,7 @@ def var(
numeric_only now defaults to ``False``.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 3.0.0
Expand Down Expand Up @@ -2742,8 +2738,7 @@ def sem(
numeric_only now defaults to ``False``.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 3.0.0
Expand Down Expand Up @@ -3021,8 +3016,7 @@ def prod(
than ``min_count`` non-NA values are present the result will be NA.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 3.0.0
Expand Down Expand Up @@ -3242,8 +3236,7 @@ def first(
The required number of valid values to perform the operation. If fewer
than ``min_count`` valid values are present the result will be NA.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 2.2.1
Expand Down Expand Up @@ -3329,8 +3322,7 @@ def last(
The required number of valid values to perform the operation. If fewer
than ``min_count`` valid values are present the result will be NA.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
.. versionadded:: 2.2.1
Expand Down Expand Up @@ -5530,8 +5522,7 @@ def _idxmax_idxmin(
numeric_only : bool, default False
Include only float, int, boolean columns.
skipna : bool, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA.
Exclude NA/null values. If an entire group is NA, the result will be NA.
ignore_unobserved : bool, default False
When True and an unobserved group is encountered, do not raise. This used
for transform where unobserved groups do not play an impact on the result.
Expand Down
70 changes: 17 additions & 53 deletions pandas/tests/io/json/test_ujson.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,60 +53,24 @@ def orient(request):

class TestUltraJSONTests:
@pytest.mark.skipif(not IS64, reason="not compliant on 32-bit, xref #15865")
def test_encode_decimal(self):
sut = decimal.Decimal("1337.1337")
encoded = ujson.ujson_dumps(sut, double_precision=15)
decoded = ujson.ujson_loads(encoded)
assert decoded == "1337.1337"

sut = decimal.Decimal("0.95")
encoded = ujson.ujson_dumps(sut, double_precision=1)
assert encoded == '"0.95"'

decoded = ujson.ujson_loads(encoded)
assert decoded == "0.95"

sut = decimal.Decimal("0.94")
encoded = ujson.ujson_dumps(sut, double_precision=1)
assert encoded == '"0.94"'

decoded = ujson.ujson_loads(encoded)
assert decoded == "0.94"

sut = decimal.Decimal("1.95")
encoded = ujson.ujson_dumps(sut, double_precision=1)
assert encoded == '"1.95"'

decoded = ujson.ujson_loads(encoded)
assert decoded == "1.95"

sut = decimal.Decimal("-1.95")
encoded = ujson.ujson_dumps(sut, double_precision=1)
assert encoded == '"-1.95"'

decoded = ujson.ujson_loads(encoded)
assert decoded == "-1.95"

sut = decimal.Decimal("0.995")
encoded = ujson.ujson_dumps(sut, double_precision=2)
assert encoded == '"0.995"'

decoded = ujson.ujson_loads(encoded)
assert decoded == "0.995"

sut = decimal.Decimal("0.9995")
encoded = ujson.ujson_dumps(sut, double_precision=3)
assert encoded == '"0.9995"'

decoded = ujson.ujson_loads(encoded)
assert decoded == "0.9995"

sut = decimal.Decimal("0.99999999999999944")
encoded = ujson.ujson_dumps(sut, double_precision=15)
assert encoded == '"0.99999999999999944"'

@pytest.mark.parametrize(
"value, double_precision",
[
("1337.1337", 15),
("0.95", 1),
("0.94", 1),
("1.95", 1),
("-1.95", 1),
("0.995", 2),
("0.9995", 3),
("0.99999999999999944", 15),
],
)
def test_encode_decimal(self, value, double_precision):
sut = decimal.Decimal(value)
encoded = ujson.ujson_dumps(sut, double_precision=double_precision)
decoded = ujson.ujson_loads(encoded)
assert decoded == "0.99999999999999944"
assert decoded == value

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

0 comments on commit d1c4200

Please sign in to comment.