Skip to content

Commit 01ea1b1

Browse files
natmokvalmroeschke
authored andcommitted
DOC: fix an example which raises an Error in whatsnew/v0.10.0.rst (pandas-dev#55057)
* fix an example in whatsnew/v0.10.0.rst * correct thee example in v0.10.0.rst
1 parent 0305571 commit 01ea1b1

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

doc/source/whatsnew/v0.10.0.rst

+30-13
Original file line numberDiff line numberDiff line change
@@ -180,19 +180,36 @@ labeled the aggregated group with the end of the interval: the next day).
180180
DataFrame constructor with no columns specified. The v0.9.0 behavior (names
181181
``X0``, ``X1``, ...) can be reproduced by specifying ``prefix='X'``:
182182

183-
.. ipython:: python
184-
:okexcept:
185-
186-
import io
187-
188-
data = """
189-
a,b,c
190-
1,Yes,2
191-
3,No,4
192-
"""
193-
print(data)
194-
pd.read_csv(io.StringIO(data), header=None)
195-
pd.read_csv(io.StringIO(data), header=None, prefix="X")
183+
.. code-block:: ipython
184+
185+
In [6]: import io
186+
187+
In [7]: data = """
188+
...: a,b,c
189+
...: 1,Yes,2
190+
...: 3,No,4
191+
...: """
192+
...:
193+
194+
In [8]: print(data)
195+
196+
a,b,c
197+
1,Yes,2
198+
3,No,4
199+
200+
In [9]: pd.read_csv(io.StringIO(data), header=None)
201+
Out[9]:
202+
0 1 2
203+
0 a b c
204+
1 1 Yes 2
205+
2 3 No 4
206+
207+
In [10]: pd.read_csv(io.StringIO(data), header=None, prefix="X")
208+
Out[10]:
209+
X0 X1 X2
210+
0 a b c
211+
1 1 Yes 2
212+
2 3 No 4
196213
197214
- Values like ``'Yes'`` and ``'No'`` are not interpreted as boolean by default,
198215
though this can be controlled by new ``true_values`` and ``false_values``

0 commit comments

Comments
 (0)