From a48d561173bb42068ad3c936dcff4c1815781429 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Thu, 7 Sep 2023 21:35:42 +0200 Subject: [PATCH 1/2] fix an example in whatsnew/v0.10.0.rst --- doc/source/whatsnew/v0.10.0.rst | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/doc/source/whatsnew/v0.10.0.rst b/doc/source/whatsnew/v0.10.0.rst index 3425986a37743..e48610794f834 100644 --- a/doc/source/whatsnew/v0.10.0.rst +++ b/doc/source/whatsnew/v0.10.0.rst @@ -180,19 +180,35 @@ labeled the aggregated group with the end of the interval: the next day). DataFrame constructor with no columns specified. The v0.9.0 behavior (names ``X0``, ``X1``, ...) can be reproduced by specifying ``prefix='X'``: -.. ipython:: python - :okexcept: +.. code-block:: ipython - import io + In [6]: import io - data = """ + In [7]: data = """ + ....: a,b,c + ....: 1,Yes,2 + ....: 3,No,4 + """ + + In [8]: print(data) + Out[8]: a,b,c 1,Yes,2 3,No,4 - """ - print(data) - pd.read_csv(io.StringIO(data), header=None) - pd.read_csv(io.StringIO(data), header=None, prefix="X") + + In [9]: pd.read_csv(io.StringIO(data), header=None) + Out[9]: + 0 1 2 + 0 a b c + 1 1 Yes 2 + 2 3 No 4 + + In [10]: pd.read_csv(io.StringIO(data), header=None, prefix="X") + Out[10]: + X0 X1 X2 + 0 a b c + 1 1 Yes 2 + 2 3 No 4 - Values like ``'Yes'`` and ``'No'`` are not interpreted as boolean by default, though this can be controlled by new ``true_values`` and ``false_values`` From ffbb5ee12119ac77653ce6702544a6f842ead405 Mon Sep 17 00:00:00 2001 From: Natalia Mokeeva Date: Sat, 9 Sep 2023 00:07:17 +0200 Subject: [PATCH 2/2] correct thee example in v0.10.0.rst --- doc/source/whatsnew/v0.10.0.rst | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/doc/source/whatsnew/v0.10.0.rst b/doc/source/whatsnew/v0.10.0.rst index e48610794f834..422efc1b36946 100644 --- a/doc/source/whatsnew/v0.10.0.rst +++ b/doc/source/whatsnew/v0.10.0.rst @@ -185,30 +185,31 @@ labeled the aggregated group with the end of the interval: the next day). In [6]: import io In [7]: data = """ - ....: a,b,c - ....: 1,Yes,2 - ....: 3,No,4 - """ + ...: a,b,c + ...: 1,Yes,2 + ...: 3,No,4 + ...: """ + ...: In [8]: print(data) - Out[8]: - a,b,c - 1,Yes,2 - 3,No,4 + + a,b,c + 1,Yes,2 + 3,No,4 In [9]: pd.read_csv(io.StringIO(data), header=None) Out[9]: - 0 1 2 - 0 a b c - 1 1 Yes 2 - 2 3 No 4 + 0 1 2 + 0 a b c + 1 1 Yes 2 + 2 3 No 4 In [10]: pd.read_csv(io.StringIO(data), header=None, prefix="X") Out[10]: - X0 X1 X2 - 0 a b c - 1 1 Yes 2 - 2 3 No 4 + X0 X1 X2 + 0 a b c + 1 1 Yes 2 + 2 3 No 4 - Values like ``'Yes'`` and ``'No'`` are not interpreted as boolean by default, though this can be controlled by new ``true_values`` and ``false_values``