Skip to content

Commit 204856d

Browse files
committed
Update readers.py
1 parent 38fa19a commit 204856d

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

pandas/io/parsers/readers.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,65 +1196,65 @@ def read_csv(
11961196
11971197
Examples
11981198
--------
1199-
>>> pd.read_csv("data.csv") # doctest: +SKIP
1200-
Name Value
1201-
0 foo 1
1202-
1 bar 2
1203-
2 #baz 3
1199+
>>> pd. >>> pd.read_csv("data.csv") # doctest: +SKIP
1200+
Name Value
1201+
0 foo 1
1202+
1 bar 2
1203+
2 #baz 3
12041204
12051205
Index and header can be specified via the `index_col` and `header`
12061206
arguments.
12071207
12081208
>>> pd.read_csv("data.csv", header=None) # doctest: +SKIP
1209-
0 1
1210-
0 Name Value
1211-
1 foo 1
1212-
2 bar 2
1213-
3 #baz 3
1209+
0 1
1210+
0 Name Value
1211+
1 foo 1
1212+
2 bar 2
1213+
3 #baz 3
12141214
12151215
>>> pd.read_csv("data.csv", index_col="Value") # doctest: +SKIP
1216-
Name
1216+
Name
12171217
Value
1218-
1 foo
1219-
2 bar
1220-
3 #baz
1218+
1 foo
1219+
2 bar
1220+
3 #baz
12211221
12221222
Column types are inferred but can be explicitly specified using the
1223-
dtype argument.
1223+
`dtype` argument.
12241224
12251225
>>> pd.read_csv("data.csv", dtype={"Value": float}) # doctest: +SKIP
1226-
Name Value
1227-
0 foo 1.0
1228-
1 bar 2.0
1229-
2 #baz 3.0
1226+
Name Value
1227+
0 foo 1.0
1228+
1 bar 2.0
1229+
2 #baz 3.0
12301230
12311231
True, False, and NA values, and thousands separators have defaults,
12321232
but can be explicitly specified, too. Supply the values you would like
12331233
as strings or lists of strings!
12341234
12351235
>>> pd.read_csv("data.csv", na_values=["foo", "bar"]) # doctest: +SKIP
1236-
Name Value
1237-
0 NaN 1
1238-
1 NaN 2
1239-
2 #baz 3
1236+
Name Value
1237+
0 NaN 1
1238+
1 NaN 2
1239+
2 #baz 3
12401240
12411241
Comment lines in the input file can be skipped using the `comment`
12421242
argument.
12431243
12441244
>>> pd.read_csv("data.csv", comment="#") # doctest: +SKIP
1245-
Name Value
1246-
0 foo 1
1247-
1 bar 2
1245+
Name Value
1246+
0 foo 1
1247+
1 bar 2
12481248
12491249
By default, columns with dates will be read as ``object`` rather than
12501250
``datetime``.
12511251
12521252
>>> df = pd.read_csv("tmp.csv") # doctest: +SKIP
12531253
12541254
>>> df # doctest: +SKIP
1255-
col 1 col 2 col 3
1256-
0 10 10/04/2018 Sun 15 Jan 2023
1257-
1 20 15/04/2018 Fri 12 May 2023
1255+
col 1 col 2 col 3
1256+
0 10 10/04/2018 Sun 15 Jan 2023
1257+
1 20 15/04/2018 Fri 12 May 2023
12581258
12591259
>>> df.dtypes # doctest: +SKIP
12601260
col 1 int64

0 commit comments

Comments
 (0)