Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Polars to v0.33 #721

Merged
merged 8 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Product and correlation are now different
  • Loading branch information
philss committed Sep 29, 2023
commit 025a7df3d0899c07bfad5cb20f518f6fbf0fa78e
2 changes: 1 addition & 1 deletion test/explorer/data_frame_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ defmodule Explorer.DataFrameTest do
df3 = DF.new(a: [1], b: [4]) |> DF.mutate(c: covariance(a, a), d: correlation(a, a))

assert df3 |> DF.head(1) |> DF.to_columns(atom_keys: true) ==
%{a: [1], b: [4], c: [:nan], d: [:nan]}
%{a: [1], b: [4], c: [:nan], d: [nil]}
end

test "clip/3" do
Expand Down
11 changes: 7 additions & 4 deletions test/explorer/series_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3588,7 +3588,7 @@ defmodule Explorer.SeriesTest do

test "product of integers with nil" do
s = Series.from_list([1, 2, nil, 3])
assert Series.product(s) === nil
assert Series.product(s) === 6
end

test "product of a series with a single value" do
Expand All @@ -3607,8 +3607,11 @@ defmodule Explorer.SeriesTest do
end

test "product of an empty series" do
s = Series.from_list([])
assert Series.product(s) === nil
s = Series.from_list([], dtype: :integer)
assert Series.product(s) === 1

s = Series.from_list([], dtype: :float)
assert Series.product(s) === 1.0
end

test "product of a series with zero" do
Expand Down Expand Up @@ -3913,7 +3916,7 @@ defmodule Explorer.SeriesTest do

s1 = Series.from_list([1.0])
s2 = Series.from_list([2.0])
assert Series.correlation(s1, s2) == :nan
assert Series.correlation(s1, s2) == nil
assert Series.covariance(s1, s2) == :nan

s1 = Series.from_list([1.0, 2.0])
Expand Down