-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Assorted Cleanups #27791
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
CLN: Assorted Cleanups #27791
Changes from all commits
e51a1a4
144df10
915bb4e
61764db
ba8adf1
2038621
ffd9274
030fa64
14e8313
870fb6e
a4e15bc
e4c9258
3bfc1f5
a15a93f
1dafe5c
3dec0b4
09c8048
fe0d5ec
394883f
c447d3c
c118ac3
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 |
---|---|---|
|
@@ -161,8 +161,8 @@ def strftime(self, date_format): | |
|
||
Returns | ||
------- | ||
Index | ||
Index of formatted strings. | ||
ndarray | ||
NumPy ndarray of formatted strings. | ||
|
||
See Also | ||
-------- | ||
|
@@ -180,9 +180,7 @@ def strftime(self, date_format): | |
'March 10, 2018, 09:00:02 AM'], | ||
dtype='object') | ||
""" | ||
from pandas import Index | ||
|
||
return Index(self._format_native_types(date_format=date_format)) | ||
return self._format_native_types(date_format=date_format).astype(object) | ||
jorisvandenbossche marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
|
||
class TimelikeOps: | ||
|
@@ -1018,9 +1016,9 @@ def _add_delta_tdi(self, other): | |
|
||
if isinstance(other, np.ndarray): | ||
# ndarray[timedelta64]; wrap in TimedeltaIndex for op | ||
from pandas import TimedeltaIndex | ||
from pandas.core.arrays import TimedeltaArray | ||
|
||
other = TimedeltaIndex(other) | ||
other = TimedeltaArray._from_sequence(other) | ||
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. if 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. it is timedelta64, but not necessarily timedelta64[ns]. 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. @jbrockmendel I think we should avoid using 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 do you want to avoid _from_sequence? |
||
|
||
self_i8 = self.asi8 | ||
other_i8 = other.asi8 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,10 +71,9 @@ def test_NaT_scalar(self): | |
series[2] = val | ||
assert pd.isna(series[2]) | ||
|
||
@pytest.mark.xfail(reason="PeriodDtype Series not supported yet") | ||
def test_NaT_cast(self): | ||
result = Series([np.nan]).astype("period[D]") | ||
expected = Series([pd.NaT]) | ||
expected = Series([pd.NaT], dtype="period[D]") | ||
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. This is changing a test, no? Why are we dropping 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. IIUC the xfail was from a time before |
||
tm.assert_series_equal(result, expected) | ||
|
||
def test_set_none(self): | ||
|
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.
IIRC @jschendel didn't we just change this to make a perf fix? is this change compat with that
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 put together this version by looking at the old version and taking out the non-executed paths. So this shouldn't take a hti
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.
@jreback : I think you're referring to #27669, which should not be impacted by this.
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.
OT: we might be able to remove is_categorical entirely?
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.
Yah we should. Will need to be deprecated since its in the API