Skip to content

Commit

Permalink
Fix trapz
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrumiller committed Jun 16, 2024
1 parent 1a47c46 commit 6438f54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion py-polars/tests/unit/operations/map/test_map_batches.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_error_on_reducing_map() -> None:
r"the input length \(6\); consider using `apply` instead"
),
):
df.group_by("id").agg(pl.map_batches(["t", "y"], np.trapz))
df.group_by("id").agg(pl.map_batches(["t", "y"], np.trapezoid))

df = pl.DataFrame({"x": [1, 2, 3, 4], "group": [1, 2, 1, 2]})

Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/operations/map/test_map_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def test_map_groups_numpy_output_3057() -> None:
)

result = df.group_by("id", maintain_order=True).agg(
pl.map_groups(["y", "t"], lambda lst: np.trapz(y=lst[0], x=lst[1])).alias(
pl.map_groups(["y", "t"], lambda lst: np.trapezoid(y=lst[0], x=lst[1])).alias(
"result"
)
)
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_error_on_reducing_map() -> None:
r"the input length \(6\); consider using `apply` instead"
),
):
df.group_by("id").agg(pl.map_batches(["t", "y"], np.trapz))
df.group_by("id").agg(pl.map_batches(["t", "y"], np.trapezoid))

df = pl.DataFrame({"x": [1, 2, 3, 4], "group": [1, 2, 1, 2]})
with pytest.raises(
Expand Down

0 comments on commit 6438f54

Please sign in to comment.