8000 implement astype portion of #24024 by jbrockmendel · Pull Request #24405 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

implement astype portion of #24024 #24405

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

Merged
merged 20 commits into from
Dec 28, 2018
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed TimedeltaArray._format_native_types
  • Loading branch information
TomAugspurger committed Dec 28, 2018
commit 5d718e66d86ab8fc6707ece5bb062086cc36424b
7 changes: 5 additions & 2 deletions pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,11 @@ def _formatter(self, boxed=False):
from pandas.io.formats.format import _get_format_timedelta64
return _get_format_timedelta64(self, box=True)

def _format_native_types(self):
return self.astype(object)
def _format_native_types(self, na_rep=u'NaT', date_format=None):
from pandas.io.formats.format import _get_format_timedelta64

formatter = _get_format_timedelta64(self._data, na_rep)
return np.array([formatter(x) for x in self._data])

# ----------------------------------------------------------------
# Arithmetic Methods
Expand Down
0