File tree 3 files changed +4
-3
lines changed
3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ MultiIndex
231
231
I/O
232
232
^^^
233
233
- Bug in :meth: `DataFrame.to_stata ` where no error is raised if the :class: `DataFrame ` contains ``-np.inf `` (:issue: `45350 `)
234
- -
234
+ - Bug in :meth: ` DataFrame.info ` where a new line at the end of the output is omitted when called on an empty :class: ` DataFrame ` ( :issue: ` 45494 `)
235
235
236
236
Period
237
237
^^^^^^
Original file line number Diff line number Diff line change @@ -812,7 +812,7 @@ def _fill_empty_info(self) -> None:
812
812
"""Add lines to the info table, pertaining to empty dataframe."""
813
813
self .add_object_type_line ()
814
814
self .add_index_range_line ()
815
- self ._lines .append (f"Empty { type (self .data ).__name__ } " )
815
+ self ._lines .append (f"Empty { type (self .data ).__name__ } \n " )
816
816
817
817
@abstractmethod
818
818
def _fill_non_empty_info (self ) -> None :
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ def duplicate_columns_frame():
29
29
30
30
31
31
def test_info_empty ():
32
+ # GH #45494
32
33
df = DataFrame ()
33
34
buf = StringIO ()
34
35
df .info (buf = buf )
@@ -37,7 +38,7 @@ def test_info_empty():
37
38
"""\
38
39
<class 'pandas.core.frame.DataFrame'>
39
40
Index: 0 entries
40
- Empty DataFrame"""
41
+ Empty DataFrame\n """
41
42
)
42
43
assert result == expected
43
44
You can’t perform that action at this time.
0 commit comments