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

Adding ewmMean, ewmStd, ewmVar #129

Merged
merged 7 commits into from
Oct 15, 2023
Merged

Conversation

Bidek56
Copy link
Collaborator

@Bidek56 Bidek56 commented Oct 4, 2023

Adding ewmMean, ewmStd, ewmVar to close #126

Copy link
Collaborator

@universalmind303 universalmind303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since all of the series functions use the expr functions & should be identical, we should create a new interface in shared-traits similar to what has been done for other shared functions.

${"rollingMean"} | ${pl.Series([1, 2, 3, 2, 1]).rollingMean(2)} | ${pl.Series("", [null, 1.5, 2.5, 2.5, 1.5], pl.Float64)}
${"rollingVar"} | ${pl.Series([1, 2, 3, 2, 1]).rollingVar(2)[1]} | ${0.5}
${"rollingMedian"} | ${pl.Series([1, 2, 3, 3, 2, 10, 8]).rollingMedian({ windowSize: 2 })} | ${pl.Series([null, 1.5, 2.5, 3, 2.5, 6, 9])}
name | actual | expected
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just throw all of the tests in expr.test

This is what we are doing with other ones. (testing series + expr) at the same time

example:

  test("contains:regex", () => {
    const df = pl.DataFrame({
      a: ["Foo", "foo", "FoO"],
    });

    const re = new RegExp("foo", "i");
    const expected = pl.DataFrame({
      a: ["Foo", "foo", "FoO"],
      contains: [true, true, true],
    });
    const seriesActual = df.getColumn("a").str.contains(re).rename("contains");
    const actual = df.withColumn(col("a").str.contains(re).as("contains"));
    expect(actual).toFrameEqual(expected);
    expect(seriesActual).toSeriesEqual(expected.getColumn("contains"));
  });

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you want to move 140 tests to expt.test?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, just the new ones for ewm

@universalmind303 universalmind303 merged commit d80f015 into pola-rs:main Oct 15, 2023
@Bidek56 Bidek56 deleted the issue-126 branch January 11, 2024 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ewm
2 participants