-
-
Notifications
You must be signed in to change notification settings - Fork 141
added np.timedelta64 for series arithmatic methods #432
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 11 commits
acd9ac8
19a7df2
e06f583
fb9dc01
83aa4c0
9fc4c76
dda43a9
994c6db
c0ea3b0
2284670
9e03f29
258e32a
a5ed64d
fee79d6
fd59d02
31db112
f01d3c0
fc41d33
21992b8
cb26631
ca75099
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 |
---|---|---|
|
@@ -1035,3 +1035,18 @@ def test_timedelta_range() -> None: | |
def test_dateoffset_freqstr() -> None: | ||
offset = DateOffset(minutes=10) | ||
check(assert_type(offset.freqstr, str), str) | ||
|
||
|
||
def timedelta64_and_arithmatic_operator() -> None: | ||
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. the name of any test function must begin with You will have to change the tests as well. See example. 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. Sir even after adding the 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. Do 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. yes sir there were errors, I'll fix it then |
||
s1 = pd.Series(data=pd.date_range("1/1/2020", "2/1/2020")) | ||
s2 = pd.Series(data=pd.date_range("1/1/2021", "2/1/2021")) | ||
s3 = s2 - s1 | ||
td = np.timedelta64(1, "M") | ||
check(assert_type((s1 - td), TimestampSeries), pd.Series, pd.Timestamp) | ||
check(assert_type((s1 + td), TimestampSeries), pd.Series, pd.Timestamp) | ||
check(assert_type((s1 * td), TimedeltaSeries), pd.Series, pd.Timestamp) | ||
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. multipying a In Change the test to assert the type, but do not do the |
||
check(assert_type((s1 / td), TimestampSeries), pd.Series, pd.Timestamp) | ||
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. dividing a In Change the test to assert the type, but do not do the |
||
check(assert_type((s3 - td), TimedeltaSeries), pd.Series, pd.Timedelta) | ||
check(assert_type((s3 + td), TimedeltaSeries), pd.Series, pd.Timedelta) | ||
check(assert_type((s3 * td), TimedeltaSeries), pd.Series, pd.Timedelta) | ||
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. multiplying a In Change the test to assert the type, but do not do the 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. Sir in 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. and sir 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.
Yes, you should add that. It is valid to divide 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.
Your job to fix them! 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. Sir just not able to fix 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. You probably have 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. Sir still mypy hows the same error 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. Without seeing your code, I can't see what you are doing wrong. You can push and it will fail and I will tell you what you did wrong. 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. yes sir |
||
check(assert_type((s3 / td), TimedeltaSeries), pd.Series, np.float) |
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.
result here of adding
TimestampSeries
plus a timedelta isTimestampSeries
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.
sir here there is no
TimestampSeries
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.
Look at line 1742