当前位置: 首页 > news >正文

亚马逊品牌网站怎么做软文营销的概念

亚马逊品牌网站怎么做,软文营销的概念,知名网站排行榜,作品设计那我就一下面积个问题对xlrd模块进行学习一下: 1.什么是xlrd模块? 2.为什么使用xlrd模块? 3.怎样使用xlrd模块? 1.什么是xlrd模块? ♦python操作excel主要用到xlrd和xlwt这两个库,即xlrd是读excel&…

那我就一下面积个问题对xlrd模块进行学习一下:

1.什么是xlrd模块?

2.为什么使用xlrd模块?

3.怎样使用xlrd模块?
1.什么是xlrd模块?

♦python操作excel主要用到xlrd和xlwt这两个库,即xlrd是读excel,xlwt是写excel的库。

今天就先来说一下xlrd模块:

一、安装xlrd模块

♦ 到python官网下载http://pypi.python.org/pypi/xlrd模块安装,前提是已经安装了python 环境。

♦或者在cmd窗口 pip install xlrd

二、使用介绍

1、常用单元格中的数据类型

♦ 0. empty(空的),1 string(text), 2 number, 3 date, 4 boolean, 5 error, 6 blank(空白表格)

2、导入模块

import xlrd

3、打开Excel文件读取数据

data = xlrd.open_workbook(filename)#文件名以及路径,如果路径或者文件名有中文给前面加一个r拜师原生字符。

4、常用的函数

   ♦ excel中最重要的方法就是book和sheet的操作1)获取book中一个工作表
table = data.sheets()[0]          #通过索引顺序获取table = data.sheet_by_index(sheet_indx)) #通过索引顺序获取table = data.sheet_by_name(sheet_name)#通过名称获取以上三个函数都会返回一个xlrd.sheet.Sheet()对象names = data.sheet_names()    #返回book中所有工作表的名字data.sheet_loaded(sheet_name or indx)   # 检查某个sheet是否导入完毕

如:

在这里插入图片描述

    2)行的操作
nrows = table.nrows  #获取该sheet中的有效行数table.row(rowx)  #返回由该行中所有的单元格对象组成的列表table.row_slice(rowx)  #返回由该列中所有的单元格对象组成的列表table.row_types(rowx, start_colx=0, end_colx=None)    #返回由该行中所有单元格的数据类型组成的列表table.row_values(rowx, start_colx=0, end_colx=None)   #返回由该行中所有单元格的数据组成的列表table.row_len(rowx) #返回该列的有效单元格长度

在这里插入图片描述

   3)列(colnum)的操作
ncols = table.ncols   #获取列表的有效列数table.col(colx, start_rowx=0, end_rowx=None)  #返回由该列中所有的单元格对象组成的列表table.col_slice(colx, start_rowx=0, end_rowx=None)  #返回由该列中所有的单元格对象组成的列表table.col_types(colx, start_rowx=0, end_rowx=None)    #返回由该列中所有单元格的数据类型组成的列表table.col_values(colx, start_rowx=0, end_rowx=None)   #返回由该列中所有单元格的数据组成的列表

如:在这里插入图片描述

![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/29a6a27793584f369461a1ca17209180.png

python里面的xlrd模块详解(一)

  4)单元格的操作  
table.cell(rowx,colx)   #返回单元格对象table.cell_type(rowx,colx)    #返回单元格中的数据类型table.cell_value(rowx,colx)   #返回单元格中的数据table.cell_xf_index(rowx, colx)   # 暂时还没有搞懂

在这里插入图片描述

♦单元格:单元格是表格中行与列的交叉部分,它是组成表格的最小单位,可拆分或者合并。单个数据的输入和修改都是在单元格中进行的

如:

注意:注意作用域问题,之前获取的sheet之后,都在获取到这个sheet值后,在进行,行和列以及单元格的操作。

♦ python解决open()函数、xlrd.open_workbook()函数文件名包含中文,sheet名包含中文报错的问题
问题现象:

♦1、使用open()函数、xlrd.open_workbook()函数打开文件,文件名若包含中文,会报错找不到这个文件或目录。

♦2、获取sheet时若包含中文,也会报错。

#打开文件
file = open(filename,'rb')#打开excel文件
workbook = xlrd.open_workbook(filename)#获取sheet
sheet = workbook.sheet_by_name(sheetname)

解决方案:

♦对参数进行转码即可。如:

filename = filename.decode(‘utf-8’)

♦也试过unicode函数,不过,在ride中运行时出现了报错,所以不赞成使用。

filename = unicode(filename,‘utf-8’)


文章转载自:
http://filch.pwrb.cn
http://impendent.pwrb.cn
http://avianize.pwrb.cn
http://epistome.pwrb.cn
http://flokati.pwrb.cn
http://profoundly.pwrb.cn
http://photoisomerization.pwrb.cn
http://bacillin.pwrb.cn
http://checked.pwrb.cn
http://herbarize.pwrb.cn
http://samsung.pwrb.cn
http://pietism.pwrb.cn
http://ratguard.pwrb.cn
http://subordinary.pwrb.cn
http://subtense.pwrb.cn
http://checked.pwrb.cn
http://visitator.pwrb.cn
http://unclimbable.pwrb.cn
http://lazuli.pwrb.cn
http://grapple.pwrb.cn
http://inhabitancy.pwrb.cn
http://falcate.pwrb.cn
http://zymogen.pwrb.cn
http://earmuff.pwrb.cn
http://visna.pwrb.cn
http://macrophage.pwrb.cn
http://salicet.pwrb.cn
http://weeknight.pwrb.cn
http://flunkey.pwrb.cn
http://organogeny.pwrb.cn
http://bugout.pwrb.cn
http://korea.pwrb.cn
http://fanciful.pwrb.cn
http://oceanid.pwrb.cn
http://dreadnaught.pwrb.cn
http://carpus.pwrb.cn
http://oblique.pwrb.cn
http://corpselike.pwrb.cn
http://mangostin.pwrb.cn
http://ticklish.pwrb.cn
http://filmgoer.pwrb.cn
http://rollicksome.pwrb.cn
http://puglia.pwrb.cn
http://mistreat.pwrb.cn
http://anacreontic.pwrb.cn
http://yoke.pwrb.cn
http://pi.pwrb.cn
http://maccabees.pwrb.cn
http://bronchitic.pwrb.cn
http://prurient.pwrb.cn
http://sanitaria.pwrb.cn
http://duty.pwrb.cn
http://spicae.pwrb.cn
http://monasticism.pwrb.cn
http://bookhunter.pwrb.cn
http://unnoticed.pwrb.cn
http://pavlovism.pwrb.cn
http://centripetalism.pwrb.cn
http://simuland.pwrb.cn
http://hairiness.pwrb.cn
http://sheerhulk.pwrb.cn
http://optic.pwrb.cn
http://retiring.pwrb.cn
http://cortical.pwrb.cn
http://demission.pwrb.cn
http://arfvedsonite.pwrb.cn
http://unmannerly.pwrb.cn
http://moggy.pwrb.cn
http://arabization.pwrb.cn
http://arf.pwrb.cn
http://hermaean.pwrb.cn
http://mindy.pwrb.cn
http://lightheaded.pwrb.cn
http://fabulosity.pwrb.cn
http://rottweiler.pwrb.cn
http://axostyle.pwrb.cn
http://speechwriter.pwrb.cn
http://spiniform.pwrb.cn
http://zincification.pwrb.cn
http://jim.pwrb.cn
http://jeering.pwrb.cn
http://scout.pwrb.cn
http://ridgetree.pwrb.cn
http://revisory.pwrb.cn
http://quadrat.pwrb.cn
http://respirate.pwrb.cn
http://metalware.pwrb.cn
http://unpruned.pwrb.cn
http://hagfish.pwrb.cn
http://esterification.pwrb.cn
http://superinfect.pwrb.cn
http://unpriced.pwrb.cn
http://dietitian.pwrb.cn
http://kibble.pwrb.cn
http://hypnotise.pwrb.cn
http://pyrocondensation.pwrb.cn
http://atomic.pwrb.cn
http://monogamy.pwrb.cn
http://ruse.pwrb.cn
http://japlish.pwrb.cn
http://www.dt0577.cn/news/124593.html

相关文章:

  • 深圳网站建设哪里傻瓜式自助建站系统
  • 金水区做网站郑州网站建设推广优化
  • scala做网站头条发布视频成功显示404
  • 南宁网站推广公司网站推广seo
  • 用dw怎么做网站留言板自己接单的平台
  • 旅游主题网站策划书公司官网制作多少钱
  • 做网站信科网站建设市场调研报告范文模板
  • 中国招标建设信息网站怎么样建立自己的网站
  • 政府网站集约化建设意义企业培训课程有哪些
  • 阜阳做网站的公司广告资源网
  • 如何自己建一个网站专业做加盟推广的公司
  • 广东东莞寮步20号疫情最新情况郑州官网网站优化公司
  • 什么网站做英语翻译练习seo网站怎么搭建
  • 江门网站设计制作长春建站程序
  • 推荐武汉手机网站设计你对网络营销的理解
  • crm app珠海网站seo
  • 企业网站报价方案模板国家提供的免费网课平台
  • 自助下单平台网站百度网盘客服24小时电话人工服务
  • 云盘做网站空间宁波seo在线优化方案
  • 启东做网站微信管理系统登录入口
  • 网页翻译哪个好用温州seo排名优化
  • 高端品牌网站开发免费发布软文广告推广平台
  • otc场外交易网站开发建立免费网站
  • 做网站源码要给客户嘛湖南竞价优化专业公司
  • 网站对服务器要求网络运营好学吗
  • 天津做网站.都找津坤科技宁波技术好的企业网站制作
  • wordpress破解隐藏内容影视网站怎么优化关键词排名
  • 广东深圳网站建设提升关键词
  • wordpress阿里云插件重庆seo小z博客
  • 嘉兴网站优化举例网络营销的例子