-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
gh:552 - Corrected Series.mean return type #622
Conversation
Now |
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.
- For the errors in
test_windowing.py
, change the return types of_mean()
tonp.float64
- For the errors in
test_resampler.py
, change the return types of the functionsh()
in line 161 andf()
in line 251 tonp.float.64
- For the errors in
test_frame.py
, change the return types of these functions tonp.float64
:sum_mean()
in line 2046lfunc
should have typeCallable[[pd.DataFrame], np.float64]
in line 2050
tests/test_series.py
Outdated
f2: float = s.mean(skipna=False) | ||
f3: float = s.mean(numeric_only=False) | ||
check(assert_type(s.mean(), np.float64), np.float64) | ||
s1 = s.groupby(level=0) |
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.
don't change this test. please revert
tests/test_series.py
Outdated
check(assert_type(s.mean(), np.float64), np.float64) | ||
s1 = s.groupby(level=0) | ||
check(assert_type(s1.mean(skipna=False), pd.Series), np.float64) | ||
check(assert_type(s1.mean(numeric_only=False), pd.Series), np.float64) |
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.
above two tests should be using s.mean()
and checking result against np.float64
|
You may have to make changes to other parts of the tests to make this work, since the tests assumed |
Thanks |
Sir I actually what should we write the |
If the results are coming back as |
thanks i'll do it |
The |
Can you try the following?
If that creates new typing errors, then change the callables for |
Done Sir |
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.
thanks @ramvikrams
assert_type()
to assert the type of any return value