
Python数据分析
gCodeTop 格码拓普 老师
一线程序代码工作者、教师。格码拓普:http://www.gcode.top
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python教学:字符串及编码等
【代码】Python基础教学:字符串及编码等。原创 2025-04-30 11:32:55 · 115 阅读 · 0 评论 -
pip install 镜像安装事项
国内镜像源清华:https://pypi.tuna.tsinghua.edu.cn/simple阿里云:http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/华中理工大学:http://pypi.hustunique.com/山东理工大学:http://pypi.sdutlinux.org/豆瓣:http://pypi.douban.com/simple/临时使用转载 2022-05-10 22:13:24 · 542 阅读 · 0 评论 -
Python对文件的数据处理-基本练习1
有一个记事本:num.txt,有5个数字,内容如下:1100200101--------Python程序读取这5个数字,然后求和,把和再写入到这个文件的尾部,即横杠下方.参考代码1:f=open("src\\num.txt","r")strList=f.readlines()f.close()strList.pop()floatList=list(map(lambda e:int(e),strList))s=sum(floatList)f=open("src\\nu原创 2021-11-09 17:49:40 · 604 阅读 · 0 评论 -
Python 的openpyxl模块的图表测试-1
参考代码1:from openpyxl import Workbookfrom openpyxl.chart import ( AreaChart, Reference, Series,)wb = Workbook()ws = wb.activerows = [ ['Number', 'Batch 1', 'Batch 2'], [2, 40, 30], [3, 40, 25], [4, 50, 30], [5, 30, 1原创 2021-04-25 11:05:06 · 256 阅读 · 0 评论 -
Python模块openpyxl的基本测试-1
参考代码:import openpyxlfrom openpyxl import Workbookfn=r'student.xlsx'wb=openpyxl.load_workbook(fn)ws=wb.worksheets[0]ListScore=[]FemaleListScore=[]MaleListScore=[]for row in ws.rows: if(row[3].value=="Score"): continue if(row[2].value=="F"):原创 2021-04-20 11:10:11 · 174 阅读 · 0 评论 -
Python模块openpyxl的基本测试-2
测试代码1:import openpyxlfrom openpyxl import Workbookimport randomdef generateRandomInformation(filename): wb=Workbook() ws=wb.worksheets[0] ws.append(['Name','Subject','Grade']) first='赵钱孙李' middle='伟昀琛东' last='坤艳志' subjects=('语文','数原创 2021-04-20 11:06:32 · 467 阅读 · 1 评论 -
使用Python完成Excel的数据处理-1
1.第三方相关库:http://yumos.gitee.io/openpyxl3.0/index.htmlhttps://zhuanlan.zhihu.com/p/150045444?from_voters_page=truehttps://blog.csdn.net/weixin_43094965/article/details/82226263https://www.jianshu.com/p/537ae962f3a0原创 2021-04-18 22:02:57 · 170 阅读 · 0 评论 -
爬网BeautifulSoup测试
代码演示:import requestsfrom bs4 import BeautifulSoupimport redef SpiderGet(url): try: r=requests.get(url,timeout=30) # r.rasie_for_status() r.encoding='utf-8' return r.text except: print("出现异常.") return "" url="http://www.exesoft.cn"so原创 2021-04-08 20:22:20 · 163 阅读 · 0 评论 -
Python数据分析基本功训练:Python代码推导式汇编
111111111111#1a = 1b = 2c = a if a>b else bprint(c)#2a = [1,2,3,4,5,6]c = [i for i in a if i%2==0]print(sum(c))#3c={i for i in a if i%2==0} print(c)#4c={i:i**i for i in a if i%2==0}print(c)#5a = [1,2,3]b = [4,5,6]c = [i+j for i in a原创 2020-08-29 12:41:14 · 255 阅读 · 0 评论 -
Python数据分析基本功训练:Numpy及Pandas的基本使用A
1.import pandas as pdobj=pd.Series([True,3,'24','a',12.56])print(obj)print(obj.values)print(obj.index)print(obj[3])2.import pandas as pdobj=pd.Series([1,3,8,24,23],index=['a','b','c','d','e'])print(obj)print(obj.index)print(obj['d'])3.原创 2020-08-25 17:48:14 · 506 阅读 · 0 评论