![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python数据分析
python数据分析
IN_Joseph
这个作者很懒,什么都没留下…
展开
-
python数据分析【2】numpy
1 创建数组1.1 np.array () 一维&二维数组基于list或者tupleimport numpy as np# 一维数组arr1 = np.array([1,2,3,4])arr2 = np.array((1,2,3,4))# 二维数组 (2*3)arr3 = np.array([[1,2,4], [3,4,5]])print(arr1)print(arr2)print(arr3)[1 2 3 4][1 2 3 4][[1 2 4] [3 4 5]]原创 2020-08-10 09:55:33 · 1170 阅读 · 0 评论 -
numpy中数组切片
二维数组import numpy as np a = np.array([[1,2,3],[4,5,6]])print(a.shape)print(a[0,:],a[0,:].shape)print(a[-1,:],a[-1,:].shape)print(a[0:2,:],a[0:2,:].shape)print("------------------")print(a[:,0],a[:,0].shape)print(a[:,1],a[:,1].shape)print(a[:,0:2原创 2020-08-10 09:25:30 · 316 阅读 · 0 评论 -
python数据分析【1】pandas
安装numpy:下载地址:https://pypi.org/project/numpy/#files,下载文件后,把whl文件放到python路径的Scripts文件夹中,cmd中cd转到该文件夹,然后输入pip3.8 install 文件名.whl,如果未安装pip则需要先安装。安装pandas:可以用pycharm中:file-settings-project interpreter中的加号,进行搜索安装1 读取文件1.1 csv文件import numpy as npimport pa原创 2020-07-27 22:28:50 · 292 阅读 · 0 评论