Skip to content

Commit 4a28d12

Browse files
author
Matt Roeschke
committed
ensure value is not np.nan
1 parent 883224f commit 4a28d12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/io/formats/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ def _format(x):
947947
if self.na_rep is not None and is_scalar(x) and isna(x):
948948
if x is None:
949949
return 'None'
950-
elif x is NaT or is_null_datetimelike(x):
950+
elif x is NaT or (is_null_datetimelike(x) and not np.isnan(x)):
951951
return 'NaT'
952952
return self.na_rep
953953
elif isinstance(x, PandasObject):

0 commit comments

Comments
 (0)