Skip to content

Commit f2348e7

Browse files
committed
test EngFormatter with np.inf
1 parent 83f4091 commit f2348e7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/formats/test_format.py

+8
Original file line numberDiff line numberDiff line change
@@ -4047,6 +4047,14 @@ def test_nan(self):
40474047
self.assertTrue('NaN' in result)
40484048
self.reset_display_options()
40494049

4050+
def test_inf(self):
4051+
# Issue #11981
4052+
4053+
formatter = fmt.EngFormatter(accuracy=1, use_eng_prefix=True)
4054+
result = formatter(np.inf)
4055+
self.assertEqual(result, u('inf'))
4056+
4057+
40504058
def _three_digit_exp():
40514059
return '%.4g' % 1.7e8 == '1.7e+008'
40524060

0 commit comments

Comments
 (0)