我是靠谱客的博主 超级盼望,这篇文章主要介绍python利用pandas库函数read_excel读取excel数据,然后获取dataframe中的行列数据,最后将处理的数据写入excel,现在分享给大家,希望可以做个参考。
read_excel函数参数解析
原文地址
利用read_excel读取数据获得dataframe(也即读取完表单后),如何获取特定行列数据
原文地址
#获取对应的值
a=dataframe.iloc[1:2,1:2].values
#得到的a将是一个二维数组
处理数据最后得到一个二维数组然后写入excel文件中
import numpy as np
import pandas as pd
datanew = pd.DataFrame(answer)#这里的answer是二维数组
writer = pd.ExcelWriter('gyx.xlsx')
# 写入Excel文件
datanew.to_excel(writer, 'page_1', float_format='%.5f')
# ‘page_1’是写入excel的sheet名
writer.save()
writer.close()
最后
以上就是超级盼望最近收集整理的关于python利用pandas库函数read_excel读取excel数据,然后获取dataframe中的行列数据,最后将处理的数据写入excel的全部内容,更多相关python利用pandas库函数read_excel读取excel数据,然后获取dataframe中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复