Skip to content

Commit

Permalink
DOC: fix an example which raises an Error in whatsnew/v0.10.0.rst (#5…
Browse files Browse the repository at this point in the history
…5057)

* fix an example in whatsnew/v0.10.0.rst

* correct thee example in v0.10.0.rst
  • Loading branch information
natmokval authored Sep 11, 2023
1 parent debf5ac commit aadd9e3
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions doc/source/whatsnew/v0.10.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,36 @@ 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:
import io
data = """
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")
.. code-block:: ipython
In [6]: import io
In [7]: data = """
...: a,b,c
...: 1,Yes,2
...: 3,No,4
...: """
...:
In [8]: print(data)
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
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``
Expand Down

0 comments on commit aadd9e3

Please sign in to comment.