Skip to content

Commit

Permalink
Change default to str
Browse files Browse the repository at this point in the history
This makes the default na repr match the expected type
for the formatter.
  • Loading branch information
TomAugspurger committed Dec 28, 2018
1 parent 33b5434 commit e29d898
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def _ndarray_values(self):
# ----------------------------------------------------------------
# Rendering Methods

def _format_native_types(self, na_rep=u'NaT', date_format=None):
def _format_native_types(self, na_rep='NaT', date_format=None):
"""
Helper method for astype when converting to strings.
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def _validate_fill_value(self, fill_value):
# -----------------------------------------------------------------
# Rendering Methods

def _format_native_types(self, na_rep=u'NaT', date_format=None, **kwargs):
def _format_native_types(self, na_rep='NaT', date_format=None, **kwargs):
from pandas.io.formats.format import _get_format_datetime64_from_values
fmt = _get_format_datetime64_from_values(self, date_format)

Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def asfreq(self, freq=None, how='E'):
# ------------------------------------------------------------------
# Rendering Methods

def _format_native_types(self, na_rep=u'NaT', date_format=None, **kwargs):
def _format_native_types(self, na_rep='NaT', date_format=None, **kwargs):
"""
actually format my specific types
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ 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, na_rep=u'NaT', date_format=None):
def _format_native_types(self, na_rep='NaT', date_format=None):
from pandas.io.formats.format import _get_format_timedelta64

formatter = _get_format_timedelta64(self._data, na_rep)
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/period.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def _maybe_convert_timedelta(self, other):
# ------------------------------------------------------------------------
# Rendering Methods

def _format_native_types(self, na_rep=u'NaT', quoting=None, **kwargs):
def _format_native_types(self, na_rep='NaT', quoting=None, **kwargs):
# just dispatch, return ndarray
return self._data._format_native_types(na_rep=na_rep,
quoting=quoting,
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/timedeltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def _formatter_func(self):
from pandas.io.formats.format import _get_format_timedelta64
return _get_format_timedelta64(self, box=True)

def _format_native_types(self, na_rep=u'NaT', date_format=None, **kwargs):
def _format_native_types(self, na_rep='NaT', date_format=None, **kwargs):
from pandas.io.formats.format import Timedelta64Formatter
return Timedelta64Formatter(values=self,
nat_rep=na_rep,
Expand Down

0 comments on commit e29d898

Please sign in to comment.