Skip to content

Commit 910cfea

Browse files
committed
Add whatnews and to_string decimal test
1 parent c41c1ea commit 910cfea

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc/source/whatsnew/v0.24.0.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ New features
2020
the user to override the engine's default behavior to include or omit the
2121
dataframe's indexes from the resulting Parquet file. (:issue:`20768`)
2222
- :meth:`DataFrame.corr` and :meth:`Series.corr` now accept a callable for generic calculation methods of correlation, e.g. histogram intersection (:issue:`22684`)
23-
23+
- :func:`DataFrame.to_string` now accepts ``decimal`` as an argument, allowing
24+
the user to use a decimal separator. (:issue:`23614`)
2425

2526
.. _whatsnew_0240.enhancements.extension_array_operators:
2627

@@ -945,6 +946,7 @@ Other API Changes
945946
- :class:`DateOffset` attribute `_cacheable` and method `_should_cache` have been removed (:issue:`23118`)
946947
- Comparing :class:`Timedelta` to be less or greater than unknown types now raises a ``TypeError`` instead of returning ``False`` (:issue:`20829`)
947948
- :meth:`Index.hasnans` and :meth:`Series.hasnans` now always return a python boolean. Previously, a python or a numpy boolean could be returned, depending on circumstances (:issue:`23294`).
949+
- The order of the arguments of `DataFrame.to_html` and `DataFrame.to_string` is rearranged.
948950

949951
.. _whatsnew_0240.deprecations:
950952

pandas/tests/io/formats/test_format.py

+5
Original file line numberDiff line numberDiff line change
@@ -1451,6 +1451,11 @@ def test_to_string_format_na(self):
14511451
'4 4.0 bar')
14521452
assert result == expected
14531453

1454+
def test_to_string_decimal(self):
1455+
df = DataFrame({'A': [6.0, 3.1, 2.2]})
1456+
expected = ' A\n0 6,0\n1 3,1\n2 2,2'
1457+
assert df.to_string(decimal=',') == expected
1458+
14541459
def test_to_string_line_width(self):
14551460
df = DataFrame(123, lrange(10, 15), lrange(30))
14561461
s = df.to_string(line_width=80)

0 commit comments

Comments
 (0)