-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
STY: use strict zip in pandas/tests/window
#62852
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -764,7 +764,9 @@ def test_iter_rolling_dataframe(df, expected, window, min_periods): | |||
| df = DataFrame(df) | ||||
| expecteds = [DataFrame(values, index=index) for (values, index) in expected] | ||||
|
|
||||
| for expected, actual in zip(expecteds, df.rolling(window, min_periods=min_periods)): | ||||
| for expected, actual in zip( | ||||
| expecteds, df.rolling(window, min_periods=min_periods), strict=False | ||||
zorexsalvo marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
| ): | ||||
| tm.assert_frame_equal(actual, expected) | ||||
|
|
||||
|
|
||||
|
|
@@ -810,7 +812,7 @@ def test_iter_rolling_on_dataframe(expected, window): | |||
| expecteds = [ | ||||
| DataFrame(values, index=df.loc[index, "C"]) for (values, index) in expected | ||||
| ] | ||||
| for expected, actual in zip(expecteds, df.rolling(window, on="C")): | ||||
| for expected, actual in zip(expecteds, df.rolling(window, on="C"), strict=False): | ||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @mroeschke some of the parametrize cases have mismatch lengths which when run with One example is pandas/pandas/tests/window/test_rolling.py Line 749 in a7be4e2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Thanks for highlighting. |
||||
| tm.assert_frame_equal(actual, expected) | ||||
|
|
||||
|
|
||||
|
|
@@ -819,7 +821,7 @@ def test_iter_rolling_on_dataframe_unordered(): | |||
| df = DataFrame({"a": ["x", "y", "x"], "b": [0, 1, 2]}) | ||||
| results = list(df.groupby("a").rolling(2)) | ||||
| expecteds = [df.iloc[idx, [1]] for idx in [[0], [0, 2], [1]]] | ||||
| for result, expected in zip(results, expecteds): | ||||
| for result, expected in zip(results, expecteds, strict=False): | ||||
| tm.assert_frame_equal(result, expected) | ||||
|
|
||||
|
|
||||
|
|
@@ -861,7 +863,7 @@ def test_iter_rolling_series(ser, expected, window, min_periods): | |||
| expecteds = [Series(values, index=index) for (values, index) in expected] | ||||
|
|
||||
| for expected, actual in zip( | ||||
| expecteds, ser.rolling(window, min_periods=min_periods) | ||||
| expecteds, ser.rolling(window, min_periods=min_periods), strict=False | ||||
| ): | ||||
| tm.assert_series_equal(actual, expected) | ||||
|
|
||||
|
|
@@ -909,10 +911,11 @@ def test_iter_rolling_datetime(expected, expected_index, window): | |||
| ser = Series(range(5), index=date_range(start="2020-01-01", periods=5, freq="D")) | ||||
|
|
||||
| expecteds = [ | ||||
| Series(values, index=idx) for (values, idx) in zip(expected, expected_index) | ||||
| Series(values, index=idx) | ||||
| for (values, idx) in zip(expected, expected_index, strict=False) | ||||
| ] | ||||
|
|
||||
| for expected, actual in zip(expecteds, ser.rolling(window)): | ||||
| for expected, actual in zip(expecteds, ser.rolling(window), strict=False): | ||||
| tm.assert_series_equal(actual, expected) | ||||
|
|
||||
|
|
||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.