pandas 1.4.2

ParametersRaisesReturns
_refine_defaults_read(dialect: 'str | csv.Dialect', delimiter: 'str | object', delim_whitespace: 'bool', engine: 'CSVEngine | None', sep: 'str | object', error_bad_lines: 'bool | None', warn_bad_lines: 'bool | None', on_bad_lines: 'str | Callable | None', names: 'ArrayLike | None | object', prefix: 'str | None | object', defaults: 'dict[str, Any]')

Parameters

dialect : str or csv.Dialect

If provided, this parameter will override values (default or not) for the following parameters: :None:None:`delimiter`, :None:None:`doublequote`, :None:None:`escapechar`, :None:None:`skipinitialspace`, :None:None:`quotechar`, and :None:None:`quoting`. If it is necessary to override values, a ParserWarning will be issued. See csv.Dialect documentation for more details.

delimiter : str or object

Alias for sep.

delim_whitespace : bool

Specifies whether or not whitespace (e.g. ' ' or ' ' ) will be used as the sep. Equivalent to setting sep='\s+' . If this option is set to True, nothing should be passed in for the delimiter parameter.

engine : {{'c', 'python'}}

Parser engine to use. The C engine is faster while the python engine is currently more feature-complete.

sep : str or object

A delimiter provided by the user (str) or a sentinel value, i.e. pandas._libs.lib.no_default.

error_bad_lines : str or None

Whether to error on a bad line or not.

warn_bad_lines : str or None

Whether to warn on a bad line or not.

on_bad_lines : str, callable or None

An option for handling bad lines or a sentinel value(None).

names : array-like, optional

List of column names to use. If the file contains a header row, then you should explicitly pass header=0 to override the column names. Duplicates in this list are not allowed.

prefix : str, optional

Prefix to add to column numbers when no header, e.g. 'X' for X0, X1, ...

defaults: dict :

Default values of input parameters.

Raises

ValueError :

If a delimiter was specified with sep (or delimiter ) and delim_whitespace=True . If on_bad_lines is specified(not None ) and error_bad_lines / warn_bad_lines is True.

Returns

kwds : dict

Input parameters with correct values.

Validate/refine default values of input parameters of read_csv, read_table.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/io/parsers/readers.py#1428
type: <class 'function'>
Commit: