143143 Append ``.squeeze("columns")`` to the call to ``read_excel`` to squeeze
144144 the data.
145145dtype : Type name or dict of column -> type, default None
146- Data type for data or columns. E.g. {'a': np.float64, 'b': np.int32}
146+ Data type for data or columns. E.g. {{ 'a': np.float64, 'b': np.int32} }
147147 Use `object` to preserve data as stored in Excel and not interpret dtype.
148148 If converters are specified, they will be applied INSTEAD
149149 of dtype conversion.
227227 each as a separate date column.
228228 * list of lists. e.g. If [[1, 3]] -> combine columns 1 and 3 and parse as
229229 a single date column.
230- * dict, e.g. {'foo' : [1, 3]} -> parse columns 1, 3 as date and call
230+ * dict, e.g. {{ 'foo' : [1, 3]} } -> parse columns 1, 3 as date and call
231231 result 'foo'
232232
233233 If a column or index contains an unparsable date, the entire column or
277277 Duplicate columns will be specified as 'X', 'X.1', ...'X.N', rather than
278278 'X'...'X'. Passing in False will cause data to be overwritten if there
279279 are duplicate names in the columns.
280- storage_options : dict, optional
281- Extra options that make sense for a particular storage connection, e.g.
282- host, port, username, password, etc., if using a URL that will
283- be parsed by ``fsspec``, e.g., starting "s3://", "gcs://". An error
284- will be raised if providing this argument with a local path or
285- a file-like buffer. See the fsspec and backend storage implementation
286- docs for the set of allowed keys and values.
280+ {storage_options}
287281
288282 .. versionadded:: 1.2.0
289283
329323Column types are inferred but can be explicitly specified
330324
331325>>> pd.read_excel('tmp.xlsx', index_col=0,
332- ... dtype={'Name': str, 'Value': float}) # doctest: +SKIP
326+ ... dtype={{ 'Name': str, 'Value': float} }) # doctest: +SKIP
333327 Name Value
3343280 string1 1.0
3353291 string2 2.0
@@ -425,6 +419,7 @@ def read_excel(
425419 ...
426420
427421
422+ @doc (storage_options = _shared_docs ["storage_options" ])
428423@deprecate_nonkeyword_arguments (allowed_args = ["io" , "sheet_name" ], version = "2.0" )
429424@Appender (_read_excel_doc )
430425def read_excel (
@@ -766,6 +761,7 @@ def parse(
766761 return output [asheetname ]
767762
768763
764+ @doc (storage_options = _shared_docs ["storage_options" ])
769765class ExcelWriter (metaclass = abc .ABCMeta ):
770766 """
771767 Class for writing DataFrame objects into excel sheets.
@@ -799,16 +795,13 @@ class ExcelWriter(metaclass=abc.ABCMeta):
799795 datetime_format : str, default None
800796 Format string for datetime objects written into Excel files.
801797 (e.g. 'YYYY-MM-DD HH:MM:SS').
802- mode : {'w', 'a'}, default 'w'
798+ mode : {{ 'w', 'a'} }, default 'w'
803799 File mode to use (write or append). Append does not work with fsspec URLs.
804- storage_options : dict, optional
805- Extra options that make sense for a particular storage connection, e.g.
806- host, port, username, password, etc., if using a URL that will
807- be parsed by ``fsspec``, e.g., starting "s3://", "gcs://".
800+ {storage_options}
808801
809802 .. versionadded:: 1.2.0
810803
811- if_sheet_exists : {'error', 'new', 'replace', 'overlay'}, default 'error'
804+ if_sheet_exists : {{ 'error', 'new', 'replace', 'overlay'} }, default 'error'
812805 How to behave when trying to write to a sheet that already
813806 exists (append mode only).
814807
@@ -929,7 +922,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
929922 >>> with pd.ExcelWriter(
930923 ... "path_to_file.xlsx",
931924 ... engine="xlsxwriter",
932- ... engine_kwargs={"options": {"nan_inf_to_errors": True}}
925+ ... engine_kwargs={{ "options": {{ "nan_inf_to_errors": True}} }}
933926 ... ) as writer:
934927 ... df.to_excel(writer) # doctest: +SKIP
935928
@@ -940,7 +933,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
940933 ... "path_to_file.xlsx",
941934 ... engine="openpyxl",
942935 ... mode="a",
943- ... engine_kwargs={"keep_vba": True}
936+ ... engine_kwargs={{ "keep_vba": True} }
944937 ... ) as writer:
945938 ... df.to_excel(writer, sheet_name="Sheet2") # doctest: +SKIP
946939 """
0 commit comments