72
72
By file-like object, we refer to objects with a ``read()`` method, such as
73
73
a file handler (e.g. via builtin ``open`` function) or ``StringIO``.
74
74
%s
75
- delim_whitespace : bool, default False
76
- Specifies whether or not whitespace (e.g. ``' '`` or ``'\t'``) will be
77
- used as the sep. Equivalent to setting ``sep='\s+'``. If this option
78
- is set to True, nothing should be passed in for the ``delimiter``
79
- parameter.
80
-
81
- .. versionadded:: 0.18.1 support for the Python parser.
82
-
83
75
header : int or list of ints, default 'infer'
84
76
Row number(s) to use as the column names, and the start of the
85
77
data. Default behavior is to infer the column names: if no names
242
234
Thousands separator.
243
235
decimal : str, default '.'
244
236
Character to recognize as decimal point (e.g. use ',' for European data).
245
- float_precision : str, default None
246
- Specifies which converter the C engine should use for floating-point
247
- values. The options are `None` for the ordinary converter,
248
- `high` for the high-precision converter, and `round_trip` for the
249
- round-trip converter.
250
237
lineterminator : str (length 1), default None
251
238
Character to break file into lines. Only valid with C parser.
252
239
quotechar : str (length 1), optional
280
267
override values, a ParserWarning will be issued. See csv.Dialect
281
268
documentation for more details.
282
269
tupleize_cols : bool, default False
270
+ Leave a list of tuples on columns as is (default is to convert to
271
+ a MultiIndex on the columns).
283
272
.. deprecated:: 0.21.0
284
273
This argument will be removed and will always convert to MultiIndex
285
274
286
- Leave a list of tuples on columns as is (default is to convert to
287
- a MultiIndex on the columns).
288
275
error_bad_lines : bool, default True
289
276
Lines with too many fields (e.g. a csv line with too many commas) will by
290
277
default cause an exception to be raised, and no DataFrame will be returned.
293
280
warn_bad_lines : bool, default True
294
281
If error_bad_lines is False, and warn_bad_lines is True, a warning for each
295
282
"bad line" will be output.
283
+ delim_whitespace : bool, default False
284
+ Specifies whether or not whitespace (e.g. ``' '`` or ``'\t '``) will be
285
+ used as the sep. Equivalent to setting ``sep='\s+'``. If this option
286
+ is set to True, nothing should be passed in for the ``delimiter``
287
+ parameter.
288
+
289
+ .. versionadded:: 0.18.1 support for the Python parser.
290
+
296
291
low_memory : bool, default True
297
292
Internally process the file in chunks, resulting in lower memory use
298
293
while parsing, but possibly mixed type inference. To ensure no mixed
304
299
If a filepath is provided for `filepath_or_buffer`, map the file object
305
300
directly onto memory and access the data directly from there. Using this
306
301
option can improve performance because there is no longer any I/O overhead.
302
+ float_precision : str, default None
303
+ Specifies which converter the C engine should use for floating-point
304
+ values. The options are `None` for the ordinary converter,
305
+ `high` for the high-precision converter, and `round_trip` for the
306
+ round-trip converter.
307
307
308
308
Returns
309
309
-------
310
- result : DataFrame or TextParser
311
- """
310
+ result : DataFrame or TextParser"""
312
311
313
312
# engine is not used in read_fwf() so is factored out of the shared docstring
314
313
_engine_doc = """engine : {'c', 'python'}, optional
334
333
""" % (_parser_params % (_sep_doc .format (default = "','" ), _engine_doc ))
335
334
336
335
_read_table_doc = """
336
+ Read general delimited file into DataFrame.
337
337
338
338
.. deprecated:: 0.24.0
339
339
Use :func:`pandas.read_csv` instead, passing ``sep='\t '`` if necessary.
340
340
341
- Read general delimited file into DataFrame
342
-
343
341
%s
344
342
""" % (_parser_params % (_sep_doc .format (default = "\\ t (tab-stop)" ),
345
343
_engine_doc ))
361
359
"""
362
360
363
361
_read_fwf_doc = """
364
- Read a table of fixed-width formatted lines into DataFrame
362
+ Read a table of fixed-width formatted lines into DataFrame.
365
363
366
364
%s
367
365
""" % (_parser_params % (_fwf_widths , '' ))
@@ -471,10 +469,10 @@ def _read(filepath_or_buffer, kwds):
471
469
_parser_defaults = {
472
470
'delimiter' : None ,
473
471
474
- 'doublequote' : True ,
475
472
'escapechar' : None ,
476
473
'quotechar' : '"' ,
477
474
'quoting' : csv .QUOTE_MINIMAL ,
475
+ 'doublequote' : True ,
478
476
'skipinitialspace' : False ,
479
477
'lineterminator' : None ,
480
478
@@ -483,14 +481,16 @@ def _read(filepath_or_buffer, kwds):
483
481
'names' : None ,
484
482
'prefix' : None ,
485
483
'skiprows' : None ,
484
+ 'skipfooter' : 0 ,
485
+ 'nrows' : None ,
486
486
'na_values' : None ,
487
+ 'keep_default_na' : True ,
488
+
487
489
'true_values' : None ,
488
490
'false_values' : None ,
489
491
'converters' : None ,
490
492
'dtype' : None ,
491
- 'skipfooter' : 0 ,
492
493
493
- 'keep_default_na' : True ,
494
494
'thousands' : None ,
495
495
'comment' : None ,
496
496
'decimal' : b'.' ,
@@ -500,10 +500,8 @@ def _read(filepath_or_buffer, kwds):
500
500
'keep_date_col' : False ,
501
501
'dayfirst' : False ,
502
502
'date_parser' : None ,
503
-
504
503
'usecols' : None ,
505
504
506
- 'nrows' : None ,
507
505
# 'iterator': False,
508
506
'chunksize' : None ,
509
507
'verbose' : False ,
@@ -576,6 +574,7 @@ def parser_f(filepath_or_buffer,
576
574
false_values = None ,
577
575
skipinitialspace = False ,
578
576
skiprows = None ,
577
+ skipfooter = 0 ,
579
578
nrows = None ,
580
579
581
580
# NA and Missing Data Handling
@@ -603,6 +602,7 @@ def parser_f(filepath_or_buffer,
603
602
lineterminator = None ,
604
603
quotechar = '"' ,
605
604
quoting = csv .QUOTE_MINIMAL ,
605
+ doublequote = True ,
606
606
escapechar = None ,
607
607
comment = None ,
608
608
encoding = None ,
@@ -613,10 +613,7 @@ def parser_f(filepath_or_buffer,
613
613
error_bad_lines = True ,
614
614
warn_bad_lines = True ,
615
615
616
- skipfooter = 0 ,
617
-
618
616
# Internal
619
- doublequote = True ,
620
617
delim_whitespace = False ,
621
618
low_memory = _c_parser_defaults ['low_memory' ],
622
619
memory_map = False ,
@@ -668,6 +665,7 @@ def parser_f(filepath_or_buffer,
668
665
names = names ,
669
666
prefix = prefix ,
670
667
skiprows = skiprows ,
668
+ skipfooter = skipfooter ,
671
669
na_values = na_values ,
672
670
true_values = true_values ,
673
671
false_values = false_values ,
@@ -684,7 +682,6 @@ def parser_f(filepath_or_buffer,
684
682
nrows = nrows ,
685
683
iterator = iterator ,
686
684
chunksize = chunksize ,
687
- skipfooter = skipfooter ,
688
685
converters = converters ,
689
686
dtype = dtype ,
690
687
usecols = usecols ,
0 commit comments