随笔分类 - 数据可视化pandas,numpy,matplotlib,pycharts基础
摘要:NumPy 数据类型 numpy 支持的数据类型比 Python 内置的类型要多很多,基本上可以和 C 语言的数据类型对应上,其中部分类型对应为 Python 内置的类型。下表列举了常用 NumPy 基本类型。 名称描述 bool_ 布尔型数据类型(True 或者 False) int_ 默认的整数
阅读全文
posted @ 2021-07-03 10:24
秋华
摘要:NumPy Ndarray 对象 NumPy 最重要的一个特点是其 N 维数组对象 ndarray,它是一系列同类型数据的集合,以 0 下标为开始进行集合中元素的索引。 ndarray 对象是用于存放同类型元素的多维数组。 ndarray 中的每个元素在内存中都有相同存储大小的区域。 ndarray
阅读全文
posted @ 2021-07-03 10:19
秋华
摘要:来源:https://zhuanlan.zhihu.com/p/115646862 之前一直对pandas和numpy里的axis 参数理解的不透彻,今天把它写下来加深印象。 axis = 0 是代表跨行,而axis = 1 是代表跨列,想明白这一点,对于其他的操作就都想明白了。 numpy 官方文
阅读全文
posted @ 2021-06-23 23:59
秋华
摘要:Aggregation Once the GroupBy object has been created, several methods are available to perform a computation on the grouped data. These operations are
阅读全文
posted @ 2021-06-11 22:15
秋华
摘要:https://www.pypandas.cn/docs/user_guide/timeseries.html https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timeseries
阅读全文
posted @ 2021-06-11 00:06
秋华
摘要:Statistical functions #Percent change Series and DataFrame have a method pct_change() (opens new window)to compute the percent change over a given num
阅读全文
posted @ 2021-06-11 00:01
秋华
摘要:1 简介 Group by: split-apply-combine By “group by” we are referring to a process involving one or more of the following steps: Splitting the data into g
阅读全文
posted @ 2021-06-10 23:58
秋华
摘要:7 Joining key columns on an index join() takes an optional on argument which may be a column or multiple column names, which specifies that the passed
阅读全文
posted @ 2021-06-10 23:53
秋华
摘要:Database-style DataFrame or named Series joining/merging 1 summary pandas provides a single function, merge(), as the entry point for all standard dat
阅读全文
posted @ 2021-06-10 23:49
秋华
摘要:一 合并 1 Concatenating objects The concat() function (in the main pandas namespace) does all of the heavy lifting of performing concatenation operations
阅读全文
posted @ 2021-06-10 22:48
秋华
摘要:NumPy进阶修炼第四期|NumPy最后二十问 import numpy as np import pandas as pd import warnings warnings.filterwarnings("ignore") 61.如何获得两个数组之间的相同元素 输入: arr1 = np.rand
阅读全文
posted @ 2021-05-04 11:49
秋华
摘要:NumPy进阶修炼第三期 import numpy as np import pandas as pd import warnings warnings.filterwarnings("ignore") 41 生成指定格式数据 备注:使用numpy生成6行6列的二维数组,值为1-100随机数 dat
阅读全文
posted @ 2021-05-04 11:16
秋华
摘要:第二期|基本矩阵操作与运算 import numpy as np 21.创建主对角线都是5的5x5矩阵 result = np.diag([5,5,5,5,5]) result 22.交换第一列与第二列 a = result[:, [1,0,2,3,4]] 23.交换第一行与第二行 b = resu
阅读全文
posted @ 2021-05-04 10:29
秋华
摘要:1.导入并查看NumPy版本 import numpy as np print(np.__version__) 2.创建十个全为0的一维数组 np.zeros(10) 3.创建10个全为0的一维数据并修改数据类型为整数 np.zeros(10,dtype = 'int') 4.创建20个0-100固
阅读全文
posted @ 2021-05-04 10:06
秋华
摘要:来源:https://mp.weixin.qq.com/s?__biz=Mzg5OTU3NjczMQ==&mid=2247510086&idx=1&sn=c379fbe2e8040669fcacfebbdf846ebf&source=41#wechat_redirect 1 创建并查看数据 首先导入
阅读全文
posted @ 2021-05-04 09:35
秋华
摘要:来源:https://mp.weixin.qq.com/s?__biz=Mzg5OTU3NjczMQ==&mid=2247510077&idx=1&sn=eb420503447fefc141542700d40edb8b&source=41#wechat_redirect 什么是NumPy 从官方文档
阅读全文
posted @ 2021-05-04 09:16
秋华
摘要:第五期 一些补充 101.从CSV文件中读取指定数据 #备注 从数据1中的前10行中读取positionName, salary两列 df = pd.read_csv('数据1.csv',encoding='gbk', usecols=['positionName', 'salary'],nrows
阅读全文
posted @ 2021-05-03 23:55
秋华
摘要:第四期 当Pandas遇上NumPy 81.导入并查看pandas与numpy版本 import pandas as pd import numpy as np print(np.__version__) print(pd.__version__) 82.从NumPy数组创建DataFrame #备
阅读全文
posted @ 2021-05-03 22:39
秋华
摘要:第三期 金融数据处理 51.使用绝对路径读取本地Excel数据 #请将下面的路径替换为你存储数据的路径 data = pd.read_excel('/Users/Desktop/600000.SH.xls') WARNING *** OLE2 inconsistency: SSCS size is
阅读全文
posted @ 2021-05-03 22:19
秋华
摘要:第二期 Pandas数据处理 21.读取本地EXCEL数据 import pandas as pd df = pd.read_excel('pandas120.xlsx') 22.查看df数据前5行 df.head() 23.将salary列数据转换为最大值与最小值的平均值 #备注,在某些版本pan
阅读全文
posted @ 2021-05-03 21:42
秋华