DataFrame的read_excel方法类似于read_csv方法:

dfs = pd.read_excel(xlsx_file, sheetname="sheet1")

Help on function read_excel in module pandas.io.excel:

read_excel(io, sheetname=0, header=0, skiprows=None, skip_footer=0, index_col=None, names=None, parse_cols=None, parse_dates=False, date_parser=None, na_values=None, thousands=None, convert_float=True, has_index_names=None, converters=None, true_values=None, false_values=None, engine=None, squeeze=False, **kwds)

Read an Excel table into a pandas DataFrame

Parameters

----------

io : string, path object (pathlib.Path or py._path.local.LocalPath),

file-like object, pandas ExcelFile, or xlrd workbook.

The string could be a URL. Valid URL schemes include http, ftp, s3,

and file. For file URLs, a host is expected. For instance, a local

file could be file://localhost/path/to/workbook.xlsx

sheetname : string, int, mixed list of strings/ints, or None, default 0

Strings are used for sheet names, Integers are used in zero-indexed

sheet positions.

Lists of strings/integers are used to request multiple sheets.

Specify None to get all sheets.

str|int -> DataFrame is returned.

list|None -> Dict of DataFrames is returned, with keys representing

sheets.

Available Cases

* Defaults to 0 -> 1st sheet as a DataFrame

* 1 -> 2nd sheet as a DataFrame

* "Sheet1" -> 1st sheet as a DataFrame

* [0,1,"Sheet5"] -> 1st, 2nd & 5th sheet as a dictionary of DataFrames

* None -> All sheets as a dictionary of DataFrames

header : int, list of ints, default 0

Row (0-indexed) to use for the column labels of the parsed

DataFrame. If a list of integers is passed those row positions will

be combined into a ``MultiIndex``

skiprows : list-like

Rows to skip at the beginning (0-indexed)

skip_footer : int, default 0

Rows at the end to skip (0-indexed)

index_col : int, list of ints, default None

Column (0-indexed) to use as the row labels of the DataFrame.

Pass None if there is no such column. If a list is passed,

those columns will be combined into a ``MultiIndex``

names : array-like, default None

List of column names to use. If file contains no header row,

then you should explicitly pass header=None

converters : dict, default None

Dict of functions for converting values in certain columns. Keys can

either be integers or column labels, values are functions that take one

input argument, the Excel cell content, and return the transformed

content.

true_values : list, default None

Values to consider as True

.. versionadded:: 0.19.0

false_values : list, default None

Values to consider as False

.. versionadded:: 0.19.0

parse_cols : int or list, default None

* If None then parse all columns,

* If int then indicates last column to be parsed

* If list of ints then indicates list of column numbers to be parsed

* If string then indicates comma separated list of column names and

column ranges (e.g. "A:E" or "A,C,E:F")

squeeze : boolean, default False

If the parsed data only contains one column then return a Series

na_values : scalar, str, list-like, or dict, default None

Additional strings to recognize as NA/NaN. If dict passed, specific

per-column NA values. By default the following values are interpreted

as NaN: '', '#N/A', '#N/A N/A', '#NA', '-1.#IND', '-1.#QNAN', '-NaN', '-nan',

'1.#IND', '1.#QNAN', 'N/A', 'NA', 'NULL', 'NaN', 'nan'.

thousands : str, default None

Thousands separator for parsing string columns to numeric. Note that

this parameter is only necessary for columns stored as TEXT in Excel,

any numeric columns will automatically be parsed, regardless of display

format.

keep_default_na : bool, default True

If na_values are specified and keep_default_na is False the default NaN

values are overridden, otherwise they're appended to.

verbose : boolean, default False

Indicate number of NA values placed in non-numeric columns

engine: string, default None

If io is not a buffer or path, this must be set to identify io.

Acceptable values are None or xlrd

convert_float : boolean, default True

convert integral floats to int (i.e., 1.0 --> 1). If False, all numeric

data will be read in as floats: Excel stores all numbers as floats

internally

has_index_names : boolean, default None

DEPRECATED: for version 0.17+ index names will be automatically

inferred based on index_col. To read Excel output from 0.16.2 and

prior that had saved index names, use True.

Returns

-------

parsed : DataFrame or Dict of DataFrames

DataFrame from the passed in Excel file. See notes in sheetname

argument for more information on when a Dict of Dataframes is returned.

python读取xlsx文件pandas_python-如何使用iPython中的pandas库读取.xlsx文件?相关推荐

  1. python如何安装panda数据库_在Pycharm中安装Pandas库方法(简单易懂)

    开发环境的搭建是一件入门比较头疼的事情,在上期的文稿基础上,增加一项Anaconda的安装介绍.Anaconda是Python的一个发行版本,安装好了Anaconda就相当于安装好了Python,并且 ...

  2. pandas读取csv写入mysql_使用python的pandas库读取csv文件保存至mysql数据库

    第一:pandas.read_csv读取本地csv文件为数据框形式 data=pd.read_csv('G:\data_operation\python_book\chapter5\\sales.cs ...

  3. python pandas库读取excel/csv中指定行或列数据详解

    通过阅读表格,可以发现Pandas中提供了非常丰富的数据读写方法,下面这篇文章主要给大家介绍了关于python利用pandas库读取excel/csv中指定行或列数据的相关资料,需要的朋友可以参考下 ...

  4. 利用python中的csv库读写csv文件

    利用python中的csv库读写csv文件 python读写csv文件就我知道的方法有:1)利用csv库,2)利用读写txt文件的方式处理,3)利用numpy或pandas库处理 在这篇博客中,博主就 ...

  5. 使用pandas库读取数据

    概况 现尝试自己用pandas读取所需数据,记录步骤和错误 pandas库本身的安装可以在settings的python编译器里搜索安装包进行安装,也可以找镜像源在终端通过pip管理工具安装,因为已经 ...

  6. python中的pandas库_数据分析中 pandas 库的基本用法详解

    上篇分享了数据分析用到的一个库:Numpy 库,今天分享一个比 Numpy 更高效的库:pandas,它可以对数据进行导入.清洗.处理.统计和输出.pandas 是基于 Numpy 库的,可以说,pa ...

  7. 在 node 中使用 koa-multer 库上传文件详解

    本文主要介绍了上传单个文件.多个文件,文件数量大小限制.限制文件上传类型和对上传的图片进行不同大小的裁剪,阅读本篇文章需要具备一定的 node 和 koa 框架的基础知识以及 async await ...

  8. 【Docker镜像文件加载原理生产中重新制作并提交镜像文件案例演示】

    一.知识回顾 之前的内容都帮你整理好了,在这里哟! [0.Docker相关目录文章整理,可自行查看,包含多节内容] [1.Docker详细安装部署&阿里镜像地址配置] [2.Docker架构& ...

  9. pandas库读取多个excel文件数据并进行筛选合并处理后导入到新表格中

    一.说明: 通过pandas库解决生活中的实际问题,关键词:pandas:Series/DataFrame 实际场景: ①前几日家中的服装店部分库存需要补货,店长向厂家下了部分订单: ②几日后到了一批 ...

最新文章

  1. Swift学习——Swift解释特定的基础(七)
  2. 华为5720设置静态路由不通_如何设置静态路由与网关?一文了解清楚
  3. 【SLAM】gradslam(∇SLAM)开源:论文、代码全都有
  4. 内存中发堆和栈,栈是运行时的单位,而堆是存储的单位
  5. 赶紧看一下mysql8.0版本的新特性,你的数据库是不是该升级了
  6. [收藏]SQL Server 索引结构及其使用
  7. java输入年月输出日历_12月营销热点日历 | 2020年创意冲刺倒计时!
  8. 计算机表情识别技术研究学什么,表情识别的图像预处理和特征提取方法研究
  9. utilities(matlab)—— mat2imgcell
  10. stream常用list转map list转list
  11. 400电话查询php,PHP 匹配电话,手机,400号码 函数 及正则。很管用。
  12. 毕业设计——如何画系统功能结构图?
  13. 讲解如何在HTML中添加背景图片?
  14. xv6操作系统中增加一个系统调用
  15. 《海洋测绘》:从地方坐标系到2000国家大地坐标系的转换方法
  16. 2020款苹果iPad Pro将搭载3D感应后置摄像头
  17. 和平精英服务器响应超时什么意思,和平精英服务器无响应,和平精英服务器超时...
  18. 解决: Attribute meta-data#package_name@value at AndroidManifest.xml:23:13-44 requires a placeholder 错误
  19. InDesign 教程如何更改字体和字体大小?
  20. 机器学习:浅谈先验概率,后验概率

热门文章

  1. AndroidOrientation Sensor(方向传感器),新的替代方法详解(安卓官方提供)
  2. 最优化——线性规划总结2(单纯形法问题总结,检验数为0和退化)
  3. linux终端获取root,ubuntu18.04获取root权限并用root用户登录的实现
  4. ubuntu 下通过 sh 命令运行脚本产生如下错误:[: y: unexpected operator
  5. Cpp / checked_delete 原理
  6. Qt / 如何解决移动了 Qt 的项目,但是 Qt 在原目录下生成编译文件的问题
  7. 用git从github网站上下载代码的方法
  8. 启明云端分享|ESP32学习笔记参考GPIO口操作
  9. 社交牛逼症研发小哥的校招和入职初体验
  10. 零基础也可以实现“机器同传翻译”!