
飞桨
文章平均质量分 58
静海彭于晏
这个作者很懒,什么都没留下…
展开
-
百度飞桨—PM2.5预测
项目1-PM2.5预测环境配置import sysimport pandas as pdimport numpy as np#读取测试数据data = pd.read_csv('work/hw1_data/train.csv', encoding = 'big5')print(data)#检查Python版本print(pd.__version__)预处理#从第三列筛取data = data.iloc[:, 3:]print(data)#筛掉未知数NA.原创 2022-01-26 18:15:10 · 1610 阅读 · 0 评论 -
Python—Pandas之iloc、loc
目录一、loc二、ilocPython除了最基本的筛选外,例:data[‘A’]还有loc、iloc、ix(已不推荐使用)区分loc与iloc:loc(location):以loc就只能用条件或者行列的名字来进行筛选;iloc(indx location):index是什么,我把它当作是索引位置,第几行第几列的意思,所以iloc是用第几行第几列这样的数字来筛选的。详细见下列子:切片生成一个10X10的表import pandas as pdimport num原创 2022-01-25 19:33:22 · 800 阅读 · 0 评论 -
Python—pandas库基础
pandas是python第三方库,提供高性能易用数据类型和分析工具。pandas基于numpy实现,常与numpy和matplotlib一同使用更多学习,请参考pandas中文网:https://www.pypandas.cn/1.SeriesSeries是一种类似于一维数组的对象,它由一维数组(各种numpy数据类型)以及一组与之相关的数据标签(即索引)组成.可理解为带标签的一维数组,可存储整数、浮点数、字符串、Python 对象等类型的数据。import p.原创 2022-01-25 17:46:51 · 215 阅读 · 0 评论 -
Python—Numpy库基础
NumPy是使用Python进行科学计算的基础软件包。更多学习,可参考numpy中文网:https://www.numpy.org.cn/目录NumPy是使用Python进行科学计算的基础软件包。更多学习,可参考numpy中文网:https://www.numpy.org.cn/1.数组创建2.数组的计算3.数组的索引与切片1.数组创建可以使用array函数从常规Python列表或元组中创建数组。得到的数组的类型是从Python列表中元素的类型推导出来的。原创 2022-01-24 23:21:51 · 433 阅读 · 0 评论 -
查找特定名称文件
源代码:#导入OS模块import os#待搜索的目录路径path = "Day1-homework"#待搜索的名称filename = "2020"#定义保存结果的数组result = []def findfiles(): #在这里写下您的查找文件代码吧! t = 1 for root, dirs, files in os.walk(path): for filename in files: if "2020" in原创 2022-01-23 22:25:09 · 157 阅读 · 0 评论 -
输出 9*9 乘法口诀表(飞浆试题)
def table(): #在这里写下您的乘法口诀表代码吧! for x in range(1,10): string = '' for y in range(1,x+1): string = string + str(y) + '*' + str(x) + '=' + str(x*y) + '\t' print(string)if __name__ == '__main__': tabl.原创 2022-01-23 22:18:52 · 192 阅读 · 0 评论