pandas.read_excel

pandas 3.1.1 · Input and output · function

Read a worksheet or multiple worksheets. Use sheet_name to choose sheets and header to identify column labels.

Call syntax

pd.read_excel(…) Full signature
pd.read_excel(
    io,
    sheet_name=0,
    *,
    header=0,
    names=None,
    index_col=None,
    usecols=None,
    dtype=None,
    engine=None,
    converters=None,
    true_values=None,
    false_values=None,
    skiprows=None,
    nrows=None,
    na_values=None,
    keep_default_na=True,
    na_filter=True,
    verbose=False,
    parse_dates=False,
    date_format=None,
    thousands=None,
    decimal='.',
    comment=None,
    skipfooter=0,
    storage_options=None,
    dtype_backend=…,
    engine_kwargs=None,
)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
io Required
Positional or keyword
str, ExcelFile, workbook object, path object, or file-like object
sheet_name Optional
Positional or keyword
Default 0
str, int, list, or None

Choose worksheets by name or zero-based position. None requests every sheet where supported.

header Optional
Keyword only
Default 0
int, list of int

Define which row or rows provide column names, or control whether to write them.

names Optional
Keyword only
Default None
array-like

Supply explicit names for labels, fields, or levels.

index_col Optional
Keyword only
Default None
int, str, list of int

Identify the column or columns whose values should become the row index.

usecols Optional
Keyword only
Default None
str, list-like, or callable

Select a subset of source columns by name, position, or a callable.

dtype Optional
Keyword only
Default None
Type name or dict of column -> type

Choose the data type for the input conversion or result.

engine Optional
Keyword only
Default None
{'openpyxl', 'calamine', 'odf', 'pyxlsb', 'xlrd'}

Choose the implementation that performs the operation.

converters Optional
Keyword only
Default None
dict

Map column labels or positions to conversion functions.

true_values Optional
Keyword only
Default None
list

Add source values that should become boolean True.

false_values Optional
Keyword only
Default None
list

Add source values that should become boolean False.

skiprows Optional
Keyword only
Default None
list-like, int, or callable

Skip selected input rows before creating the DataFrame.

nrows Optional
Keyword only
Default None
int

Limit the number of rows to read or display.

na_values Optional
Keyword only
Default None
scalar, str, list-like, or dict

Add input markers that should be interpreted as missing.

keep_default_na Optional
Keyword only
Default True
bool

Choose whether pandas' built-in missing strings are recognized along with custom markers.

na_filter Optional
Keyword only
Default True
bool
verbose Optional
Keyword only
Default False
bool

Request more detailed diagnostic output where supported.

parse_dates Optional
Keyword only
Default False
bool, list-like, or dict

Choose whether to interpret selected fields as dates during a read.

date_format Optional
Keyword only
Default None
str or dict of column -> format

Specify datetime parsing or formatting directives such as "%Y-%m-%d".

thousands Optional
Keyword only
Default None
str

Identify the character separating groups of digits.

decimal Optional
Keyword only
Default '.'
str

Identify the character used as the decimal mark.

comment Optional
Keyword only
Default None
str

Identify the comment character used when parsing text.

skipfooter Optional
Keyword only
Default 0
int

Skip this many lines at the end of the input.

storage_options Optional
Keyword only
Default None
dict

Pass storage-backend options such as connection settings or HTTP headers.

dtype_backend Optional
Keyword only
{'numpy_nullable', 'pyarrow'}

Choose nullable NumPy-backed dtypes or Arrow-backed dtypes.

engine_kwargs Optional
Keyword only
Default None
dict

Pass a dictionary of options to the selected engine.

Returns

DataFrame or dict of DataFrames