Skip to content

Commit 5d718e6

Browse files
committed
Fixed TimedeltaArray._format_native_types
1 parent 5fa32e9 commit 5d718e6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pandas/core/arrays/timedeltas.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,11 @@ def _formatter(self, boxed=False):
268268
from pandas.io.formats.format import _get_format_timedelta64
269269
return _get_format_timedelta64(self, box=True)
270270

271-
def _format_native_types(self):
272-
return self.astype(object)
271+
def _format_native_types(self, na_rep=u'NaT', date_format=None):
272+
from pandas.io.formats.format import _get_format_timedelta64
273+
274+
formatter = _get_format_timedelta64(self._data, na_rep)
275+
return np.array([formatter(x) for x in self._data])
273276

274277
# ----------------------------------------------------------------
275278
# Arithmetic Methods

0 commit comments

Comments
 (0)