摘要: 基本的统计方法 Method Description count Number of non-NA values describe Compute set of summary statistics for Series or each DataFrame column min,max Comput 阅读全文
posted @ 2022-01-24 16:38 溪奇的数据 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Pandas继承了Numpy的运算功能,可以快速对每个元素进行运算,即包括基本运算(加减乘除等),也包括复杂运算(三角函数、指数函数和对数函数等)。 通用函数使用 apply和applymap apply(func,axis=0,broadcast=None,raw=False,reduce=Non 阅读全文
posted @ 2022-01-24 16:28 溪奇的数据 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Series和DataFrame对象与Numpy数组和标准Python字典的数据索引和选择模式一样。 字典形式选择和索引 Series In [1]: import pandas as pd In [2]: data = pd.Series([0.25,0.5,0.75,1.0],index=['a 阅读全文
posted @ 2022-01-24 15:53 溪奇的数据 阅读(47) 评论(0) 推荐(0) 编辑
摘要: Pandas是Python的一个扩展程序库,是在Numpy基础上建立的,提供高性能、易使用的数据结构和数据分析工具。 Pandas 可以从各种文件格式比如 CSV、JSON、SQL、Excel 等中导入数据; Pandas 可以对各种数据进行运算操作,比如归并、再成形、选择,还有数据清洗和数据加工特 阅读全文
posted @ 2022-01-24 15:27 溪奇的数据 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 数据获取和处理 从网页中获取各国的奖牌数量和排名以及奖牌类型(json格式)。 #奖牌榜数据 url = 'https://app-sc.miguvideo.com/vms-livedata/olympic-medal/total-table/15/110000004609' data= reque 阅读全文
posted @ 2022-01-24 14:33 溪奇的数据 阅读(1325) 评论(3) 推荐(0) 编辑
摘要: 数据爬取/处理 爬取深圳2021年全年的天气历史数据。 网址链接:https://lishi.tianqi.com/shenzhen/ 代码: import requests from lxml import etree import pandas as pd headers = { 'User-A 阅读全文
posted @ 2022-01-24 12:40 溪奇的数据 阅读(1002) 评论(5) 推荐(0) 编辑
摘要: 文字和文字位置 通过plt.text()或ax.text()命令可在图形上添加文字。 Signature: ax.text(x, y, s, fontdict=None, withdash=<deprecated parameter>, **kwargs) Docstring: Add text t 阅读全文
posted @ 2022-01-08 19:56 溪奇的数据 阅读(473) 评论(0) 推荐(0) 编辑
摘要: 设置颜色条 对于图形中由彩色的点、线、面构成的连续标签,用颜色条来表示的效果比较好,在Matplotlib中,颜色条是一个独立的坐标轴。 可视图形的颜色选择可参考matplotlib配色方案。 Choosing Colormaps — Matplotlib 1.4.1 documentation 重 阅读全文
posted @ 2022-01-08 19:47 溪奇的数据 阅读(1756) 评论(0) 推荐(0) 编辑
摘要: plt.legend()和ax.legend()参数设置 自动会将每条线的标签与其风格、颜色进行匹配。 plt.legend(*args, **kwargs) Place a legend on the axes. Call signatures:: legend() legend(labels) 阅读全文
posted @ 2022-01-08 19:32 溪奇的数据 阅读(928) 评论(0) 推荐(0) 编辑
摘要: 每个axes对象都有xaxis和yaxis属性,且xaxis和yaxis的每一个坐标轴都有主要刻度线/标签和次要刻度线/标签组成,标签位置通过一个Locator对象设置,标签格式通过一个Formatter设置。 plt.style.use('seaborn-whitegrid') #x轴和y轴设置成 阅读全文
posted @ 2022-01-08 18:40 溪奇的数据 阅读(3714) 评论(0) 推荐(0) 编辑