Skip to content

Commit 5b4a89c

Browse files
author
gshiba
committed
Fix Series too
1 parent e90320e commit 5b4a89c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pandas/io/formats/format.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,7 @@ def to_string(self):
288288
if self.index:
289289
result = self.adj.adjoin(3, *[fmt_index[1:], fmt_values])
290290
else:
291-
result = self.adj.adjoin(3, fmt_values).replace('\n ',
292-
'\n').strip()
291+
result = self.adj.adjoin(3, fmt_values)
293292

294293
if self.header and have_header:
295294
result = fmt_index[0] + '\n' + result

pandas/tests/io/formats/test_format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1835,7 +1835,7 @@ def test_to_string_without_index(self):
18351835
# GH 11729 Test index=False option
18361836
s = Series([1, 2, 3, 4])
18371837
result = s.to_string(index=False)
1838-
expected = (u('1\n') + '2\n' + '3\n' + '4')
1838+
expected = (u(' 1\n') + ' 2\n' + ' 3\n' + ' 4')
18391839
assert result == expected
18401840

18411841
def test_unicode_name_in_footer(self):

0 commit comments

Comments
 (0)