-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DTA Followups - remove redundant methods #24577
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
Conversation
@@ -400,98 +400,98 @@ def test_value_counts_unique_nunique(self): | |||
|
|||
assert o.nunique() == len(np.unique(o.values)) | |||
|
|||
def test_value_counts_unique_nunique_null(self): | |||
@pytest.mark.parametrize('null_obj', [np.nan, None]) |
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.
yeah this is a nasty 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.
lgtm. some comments.
@@ -34,7 +34,7 @@ | |||
_midnight = time(0, 0) | |||
|
|||
|
|||
def _to_m8(key, tz=None): | |||
def _to_M8(key, tz=None): |
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.
isn't the conversion just (line 50)
In [1]: from pandas._libs.tslibs import conversion
In [2]: ts = pd.Timestamp('20181001', tz='UTC')
In [3]: np.int64(conversion.pydt_to_i8(ts)).view('M8[ns]')
Out[3]: numpy.datetime64('2018-10-01T00:00:00.000000000')
In [5]: ts.to_datetime64()
Out[5]: numpy.datetime64('2018-10-01T00:00:00.000000000')
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.
this routine should really just be in conversion.pyx
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’m hoping we can do something clever see #24576. Not sure we are internally consistent enough to do that yet though.
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.
ok
Codecov Report
@@ Coverage Diff @@
## master #24577 +/- ##
==========================================
+ Coverage 92.33% 92.36% +0.02%
==========================================
Files 166 166
Lines 52544 52494 -50
==========================================
- Hits 48517 48486 -31
+ Misses 4027 4008 -19
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #24577 +/- ##
==========================================
+ Coverage 92.33% 92.36% +0.02%
==========================================
Files 166 166
Lines 52544 52494 -50
==========================================
- Hits 48517 48486 -31
+ Misses 4027 4008 -19
Continue to review full report at Codecov.
|
thanks |
Both arrays.datetimes and arrays.timedeltas have a
_to_m8
function. The timedeltas one is removed since it is unnecessary, the datetimes one is given a more accurate name_to_M8
A couple of unused funcs from
tm
are removed.A test is parametrized.