84
84
delimiters are prone to ignoring quoted data. Regex example: ``'\r\t'``.
85
85
delimiter : str, default ``None``
86
86
Alias for sep.
87
- header : int or list of ints , default 'infer'
87
+ header : int, list of int , default 'infer'
88
88
Row number(s) to use as the column names, and the start of the
89
89
data. Default behavior is to infer the column names: if no names
90
90
are passed the behavior is identical to ``header=0`` and column
98
98
parameter ignores commented lines and empty lines if
99
99
``skip_blank_lines=True``, so ``header=0`` denotes the first line of
100
100
data rather than the first line of the file.
101
- names : array-like, default None
101
+ names : array-like, optional
102
102
List of column names to use. If file contains no header row, then you
103
103
should explicitly pass ``header=None``. Duplicates in this list will cause
104
104
a ``UserWarning`` to be issued.
105
- index_col : int or sequence or False, default None
105
+ index_col : int, sequence or bool, optional
106
106
Column to use as the row labels of the DataFrame. If a sequence is given, a
107
107
MultiIndex is used. If you have a malformed file with delimiters at the end
108
108
of each line, you might consider ``index_col=False`` to force pandas to
109
109
not use the first column as the index (row names).
110
- usecols : list-like or callable, default None
110
+ usecols : list-like or callable, optional
111
111
Return a subset of the columns. If list-like, all elements must either
112
112
be positional (i.e. integer indices into the document columns) or strings
113
113
that correspond to column names provided either by the user in `names` or
127
127
parsing time and lower memory usage.
128
128
squeeze : bool, default False
129
129
If the parsed data only contains one column then return a Series.
130
- prefix : str, default None
130
+ prefix : str, optional
131
131
Prefix to add to column numbers when no header, e.g. 'X' for X0, X1, ...
132
132
mangle_dupe_cols : bool, default True
133
133
Duplicate columns will be specified as 'X', 'X.1', ...'X.N', rather than
134
134
'X'...'X'. Passing in False will cause data to be overwritten if there
135
135
are duplicate names in the columns.
136
- dtype : Type name or dict of column -> type, default None
136
+ dtype : Type name or dict of column -> type, optional
137
137
Data type for data or columns. E.g. {{'a': np.float64, 'b': np.int32}}
138
138
Use `str` or `object` together with suitable `na_values` settings
139
139
to preserve and not interpret dtype.
142
142
engine : {{'c', 'python'}}, optional
143
143
Parser engine to use. The C engine is faster while the python engine is
144
144
currently more feature-complete.
145
- converters : dict, default None
145
+ converters : dict, optional
146
146
Dict of functions for converting values in certain columns. Keys can either
147
147
be integers or column labels.
148
- true_values : list, default None
148
+ true_values : list, optional
149
149
Values to consider as True.
150
- false_values : list, default None
150
+ false_values : list, optional
151
151
Values to consider as False.
152
152
skipinitialspace : bool, default False
153
153
Skip spaces after delimiter.
154
- skiprows : list-like or int or callable, default None
154
+ skiprows : list-like, int or callable, optional
155
155
Line numbers to skip (0-indexed) or number of lines to skip (int)
156
156
at the start of the file.
157
157
160
160
An example of a valid callable argument would be ``lambda x: x in [0, 2]``.
161
161
skipfooter : int, default 0
162
162
Number of lines at bottom of file to skip (Unsupported with engine='c').
163
- nrows : int, default None
163
+ nrows : int, optional
164
164
Number of rows of file to read. Useful for reading pieces of large files.
165
- na_values : scalar, str, list-like, or dict, default None
165
+ na_values : scalar, str, list-like, or dict, optional
166
166
Additional strings to recognize as NA/NaN. If dict passed, specific
167
167
per-column NA values. By default the following values are interpreted as
168
168
NaN: '""" + fill ("', '" .join (sorted (_NA_VALUES )),
190
190
Indicate number of NA values placed in non-numeric columns.
191
191
skip_blank_lines : bool, default True
192
192
If True, skip over blank lines rather than interpreting as NaN values.
193
- parse_dates : bool or list of ints or names or list of lists or dict, \
193
+ parse_dates : bool or list of int or names or list of lists or dict, \
194
194
default False
195
195
The behavior is as follows:
196
196
197
197
* boolean. If True -> try parsing the index.
198
- * list of ints or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3
198
+ * list of int or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3
199
199
each as a separate date column.
200
200
* list of lists. e.g. If [[1, 3]] -> combine columns 1 and 3 and parse as
201
201
a single date column.
215
215
keep_date_col : bool, default False
216
216
If True and `parse_dates` specifies combining multiple columns then
217
217
keep the original columns.
218
- date_parser : function, default None
218
+ date_parser : function, optional
219
219
Function to use for converting a sequence of string columns to an array of
220
220
datetime instances. The default uses ``dateutil.parser.parser`` to do the
221
221
conversion. Pandas will try to call `date_parser` in three different ways,
230
230
iterator : bool, default False
231
231
Return TextFileReader object for iteration or getting chunks with
232
232
``get_chunk()``.
233
- chunksize : int, default None
233
+ chunksize : int, optional
234
234
Return TextFileReader object for iteration.
235
235
See the `IO Tools docs
236
236
<http://pandas.pydata.org/pandas-docs/stable/io.html#io-chunking>`_
244
244
245
245
.. versionadded:: 0.18.1 support for 'zip' and 'xz' compression.
246
246
247
- thousands : str, default None
247
+ thousands : str, optional
248
248
Thousands separator.
249
249
decimal : str, default '.'
250
250
Character to recognize as decimal point (e.g. use ',' for European data).
251
- lineterminator : str (length 1), default None
251
+ lineterminator : str (length 1), optional
252
252
Character to break file into lines. Only valid with C parser.
253
253
quotechar : str (length 1), optional
254
254
The character used to denote the start and end of a quoted item. Quoted
260
260
When quotechar is specified and quoting is not ``QUOTE_NONE``, indicate
261
261
whether or not to interpret two consecutive quotechar elements INSIDE a
262
262
field as a single ``quotechar`` element.
263
- escapechar : str (length 1), default None
263
+ escapechar : str (length 1), optional
264
264
One-character string used to escape delimiter when quoting is QUOTE_NONE.
265
- comment : str, default None
265
+ comment : str, optional
266
266
Indicates remainder of line should not be parsed. If found at the beginning
267
267
of a line, the line will be ignored altogether. This parameter must be a
268
268
single character. Like empty lines (as long as ``skip_blank_lines=True``),
269
269
fully commented lines are ignored by the parameter `header` but not by
270
270
`skiprows`. For example, if ``comment='#'``, parsing
271
271
``#empty\\ na,b,c\\ n1,2,3`` with ``header=0`` will result in 'a,b,c' being
272
272
treated as the header.
273
- encoding : str, default None
273
+ encoding : str, optional
274
274
Encoding to use for UTF when reading/writing (ex. 'utf-8'). `List of Python
275
275
standard encodings
276
276
<https://docs.python.org/3/library/codecs.html#standard-encodings>`_ .
277
- dialect : str or csv.Dialect instance, default None
277
+ dialect : str or csv.Dialect, optional
278
278
If provided, this parameter will override values (default or not) for the
279
279
following parameters: `delimiter`, `doublequote`, `escapechar`,
280
280
`skipinitialspace`, `quotechar`, and `quoting`. If it is necessary to
@@ -743,13 +743,13 @@ def read_fwf(filepath_or_buffer, colspecs='infer',
743
743
By file-like object, we refer to objects with a ``read()`` method,
744
744
such as a file handler (e.g. via builtin ``open`` function)
745
745
or ``StringIO``.
746
- colspecs : list of pairs (int, int) or 'infer'. optional
747
- A list of pairs ( tuples) giving the extents of the fixed-width
746
+ colspecs : list of tuple (int, int) or 'infer'. optional
747
+ A list of tuples giving the extents of the fixed-width
748
748
fields of each line as half-open intervals (i.e., [from, to[ ).
749
749
String value 'infer' can be used to instruct the parser to try
750
750
detecting the column specifications from the first 100 rows of
751
751
the data which are not being skipped via skiprows (default='infer').
752
- widths : list of ints. optional
752
+ widths : list of int, optional
753
753
A list of field widths which can be used instead of 'colspecs' if
754
754
the intervals are contiguous.
755
755
**kwds : optional
@@ -765,7 +765,6 @@ def read_fwf(filepath_or_buffer, colspecs='infer',
765
765
--------
766
766
to_csv : Write DataFrame to a comma-separated values (csv) file.
767
767
read_csv : Read a comma-separated values (csv) file into DataFrame.
768
- read_fwf : Read a table of fixed-width formatted lines into DataFrame.
769
768
770
769
Examples
771
770
--------
@@ -2055,45 +2054,45 @@ def TextParser(*args, **kwds):
2055
2054
----------
2056
2055
data : file-like object or list
2057
2056
delimiter : separator character to use
2058
- dialect : str or csv.Dialect instance, default None
2057
+ dialect : str or csv.Dialect instance, optional
2059
2058
Ignored if delimiter is longer than 1 character
2060
2059
names : sequence, default
2061
2060
header : int, default 0
2062
2061
Row to use to parse column labels. Defaults to the first row. Prior
2063
2062
rows will be discarded
2064
- index_col : int or list, default None
2063
+ index_col : int or list, optional
2065
2064
Column or columns to use as the (possibly hierarchical) index
2066
2065
has_index_names: bool, default False
2067
2066
True if the cols defined in index_col have an index name and are
2068
2067
not in the header.
2069
- na_values : scalar, str, list-like, or dict, default None
2068
+ na_values : scalar, str, list-like, or dict, optional
2070
2069
Additional strings to recognize as NA/NaN.
2071
2070
keep_default_na : bool, default True
2072
- thousands : str, default None
2071
+ thousands : str, optional
2073
2072
Thousands separator
2074
- comment : str, default None
2073
+ comment : str, optional
2075
2074
Comment out remainder of line
2076
2075
parse_dates : bool, default False
2077
2076
keep_date_col : bool, default False
2078
- date_parser : function, default None
2077
+ date_parser : function, optional
2079
2078
skiprows : list of integers
2080
2079
Row numbers to skip
2081
2080
skipfooter : int
2082
2081
Number of line at bottom of file to skip
2083
- converters : dict, default None
2082
+ converters : dict, optional
2084
2083
Dict of functions for converting values in certain columns. Keys can
2085
2084
either be integers or column labels, values are functions that take one
2086
2085
input argument, the cell (not column) content, and return the
2087
2086
transformed content.
2088
- encoding : str, default None
2087
+ encoding : str, optional
2089
2088
Encoding to use for UTF when reading/writing (ex. 'utf-8')
2090
2089
squeeze : bool, default False
2091
2090
returns Series if only one column.
2092
2091
infer_datetime_format: bool, default False
2093
2092
If True and `parse_dates` is True for a column, try to infer the
2094
2093
datetime format based on the first datetime string. If the format
2095
2094
can be inferred, there often will be a large parsing speed-up.
2096
- float_precision : str, default None
2095
+ float_precision : str, optional
2097
2096
Specifies which converter the C engine should use for floating-point
2098
2097
values. The options are None for the ordinary converter,
2099
2098
'high' for the high-precision converter, and 'round_trip' for the
0 commit comments