We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 49dab2a commit 90550b9Copy full SHA for 90550b9
pandas/tests/test_frame.py
@@ -1844,8 +1844,12 @@ def test_to_string_unicode_two(self):
1844
def test_to_string_with_formatters_unicode(self):
1845
df = DataFrame({u'c/\u03c3':[1,2,3]})
1846
result = df.to_string(formatters={u'c/\u03c3': lambda x: '%s' % x})
1847
- assert(result in (' c/\xcf\x83\n0 1 \n1 2 \n2 3 ',
1848
- ' c/?\n0 1 \n1 2 \n2 3 ' ))
+ unicode_version = u' c/\u03c3\x83\n0 1 \n1 2 \n2 3 '
+ assert(result in
1849
+ (' c/\xcf\x83\n0 1 \n1 2 \n2 3 ',
1850
+ unicode_version.encode('cp437', 'replace'),
1851
+ unicode_version.encode('latin1', 'replace'),
1852
+ ' c/?\n0 1 \n1 2 \n2 3 ' ))
1853
1854
def test_head_tail(self):
1855
assert_frame_equal(self.frame.head(), self.frame[:5])
0 commit comments