@@ -2008,54 +2008,56 @@ def _repr_data_resource_(self):
2008
2008
2009
2009
Parameters
2010
2010
----------
2011
- excel_writer : string or ExcelWriter object
2011
+ excel_writer : str or ExcelWriter object
2012
2012
File path or existing ExcelWriter.
2013
- sheet_name : string , default 'Sheet1'
2013
+ sheet_name : str , default 'Sheet1'
2014
2014
Name of sheet which will contain DataFrame.
2015
- na_rep : string , default ''
2015
+ na_rep : str , default ''
2016
2016
Missing data representation.
2017
- float_format : string , optional
2017
+ float_format : str , optional
2018
2018
Format string for floating point numbers. For example
2019
2019
``float_format="%%.2f"`` will format 0.1234 to 0.12.
2020
- columns : sequence or list of string , optional
2020
+ columns : sequence or list of str , optional
2021
2021
Columns to write.
2022
- header : boolean or list of string , default True
2023
- Write out the column names. If a list of strings is given it is
2022
+ header : bool or list of str , default True
2023
+ Write out the column names. If a list of string is given it is
2024
2024
assumed to be aliases for the column names.
2025
- index : boolean , default True
2025
+ index : bool , default True
2026
2026
Write row names (index).
2027
- index_label : string or sequence, optional
2027
+ index_label : str or sequence, optional
2028
2028
Column label for index column(s) if desired. If not specified, and
2029
2029
`header` and `index` are True, then the index names are used. A
2030
2030
sequence should be given if the DataFrame uses MultiIndex.
2031
- startrow : integer , default 0
2031
+ startrow : int , default 0
2032
2032
Upper left cell row to dump data frame.
2033
- startcol : integer , default 0
2033
+ startcol : int , default 0
2034
2034
Upper left cell column to dump data frame.
2035
- engine : string , optional
2035
+ engine : str , optional
2036
2036
Write engine to use, 'openpyxl' or 'xlsxwriter'. You can also set this
2037
2037
via the options ``io.excel.xlsx.writer``, ``io.excel.xls.writer``, and
2038
2038
``io.excel.xlsm.writer``.
2039
- merge_cells : boolean , default True
2039
+ merge_cells : bool , default True
2040
2040
Write MultiIndex and Hierarchical Rows as merged cells.
2041
- encoding : string , optional
2041
+ encoding : str , optional
2042
2042
Encoding of the resulting excel file. Only necessary for xlwt,
2043
2043
other writers support unicode natively.
2044
- inf_rep : string , default 'inf'
2044
+ inf_rep : str , default 'inf'
2045
2045
Representation for infinity (there is no native representation for
2046
2046
infinity in Excel).
2047
- verbose : boolean , default True
2047
+ verbose : bool , default True
2048
2048
Display more information in the error logs.
2049
- freeze_panes : tuple of integer (length 2), optional
2049
+ freeze_panes : tuple of int (length 2), optional
2050
2050
Specifies the one-based bottommost row and rightmost column that
2051
2051
is to be frozen.
2052
2052
2053
2053
.. versionadded:: 0.20.0.
2054
2054
2055
2055
See Also
2056
2056
--------
2057
- read_excel
2058
- ExcelWriter
2057
+ to_csv : Write DataFrame to a comma-separated values (csv) file.
2058
+ ExcelWriter : Class for writing DataFrame objects into excel sheets.
2059
+ read_excel : Read an Excel file into a pandas DataFrame.
2060
+ read_csv : Read a comma-separated values (csv) file into DataFrame.
2059
2061
2060
2062
Notes
2061
2063
-----
@@ -2071,8 +2073,8 @@ def _repr_data_resource_(self):
2071
2073
Create, write to and save a workbook:
2072
2074
2073
2075
>>> df1 = pd.DataFrame([['a', 'b'], ['c', 'd']],
2074
- ... index=['row 1', 'row 2'],
2075
- ... columns=['col 1', 'col 2'])
2076
+ ... index=['row 1', 'row 2'],
2077
+ ... columns=['col 1', 'col 2'])
2076
2078
>>> df1.to_excel("output.xlsx") # doctest: +SKIP
2077
2079
2078
2080
To specify the sheet name:
@@ -2166,7 +2168,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
2166
2168
double_precision : int, default 10
2167
2169
The number of decimal places to use when encoding
2168
2170
floating point values.
2169
- force_ascii : boolean , default True
2171
+ force_ascii : bool , default True
2170
2172
Force encoded string to be ASCII.
2171
2173
date_unit : string, default 'ms' (milliseconds)
2172
2174
The time unit to encode to, governs timestamp and ISO8601
@@ -2176,7 +2178,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
2176
2178
Handler to call if object cannot otherwise be converted to a
2177
2179
suitable format for JSON. Should receive a single argument which is
2178
2180
the object to convert and return a serialisable object.
2179
- lines : boolean , default False
2181
+ lines : bool , default False
2180
2182
If 'orient' is 'records' write out line delimited json format. Will
2181
2183
throw ValueError if incorrect 'orient' since others are not list
2182
2184
like.
@@ -2192,7 +2194,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None,
2192
2194
.. versionadded:: 0.21.0
2193
2195
.. versionchanged:: 0.24.0
2194
2196
'infer' option added and set to default
2195
- index : boolean , default True
2197
+ index : bool , default True
2196
2198
Whether to include the index values in the JSON string. Not
2197
2199
including the index (``index=False``) is only supported when
2198
2200
orient is 'split' or 'table'.
@@ -2375,7 +2377,7 @@ def to_msgpack(self, path_or_buf=None, encoding='utf-8', **kwargs):
2375
2377
----------
2376
2378
path : string File path, buffer-like, or None
2377
2379
if None, return generated string
2378
- append : boolean whether to append to an existing msgpack
2380
+ append : bool whether to append to an existing msgpack
2379
2381
(default is False)
2380
2382
compress : type of compressor (zlib or blosc), default to None (no
2381
2383
compression)
@@ -2410,7 +2412,7 @@ def to_sql(self, name, con, schema=None, if_exists='fail', index=True,
2410
2412
* replace: Drop the table before inserting new values.
2411
2413
* append: Insert new values to the existing table.
2412
2414
2413
- index : boolean , default True
2415
+ index : bool , default True
2414
2416
Write DataFrame index as a column. Uses `index_label` as the column
2415
2417
name in the table.
2416
2418
index_label : string or sequence, default None
0 commit comments