-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Conversation
There was a problem hiding this 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.
__tests__/series.test.ts
Outdated
${"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 |
There was a problem hiding this comment.
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"));
});
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
Adding ewmMean, ewmStd, ewmVar to close #126