
python
Datawhale
一个开源的学习组织
展开
-
【numpy学习笔记】数组的创建和基本运算
1. 创建numpy数组1.1 通过tuple和list创建数组import numpy as np通过tuplet=(1,2,3)a=np.array(t,dtype= 'int')#array([1, 2, 3])通过listlist1 = [1,2,3]a = np.array(list1,dtype='int')#array([1, 2, 3])用多个...原创 2018-07-10 17:49:43 · 1296 阅读 · 0 评论 -
PIP_安装PYTHON包的三种方式
PIP1. 从官方库下载pip install 包名如:pip install pandas由于从官方库有时候速度很慢2. 从国内镜像下载豆瓣:http://pypi.douban.com/simple/清华:https://pypi.tuna.tsinghua.edu.cn/simple可以在使用pip install -i 国内镜像地址 包名如:pip in...原创 2018-08-15 18:11:56 · 3477 阅读 · 1 评论 -
PYTHON专题
教材廖雪峰python入门与进阶Python编程从入门到实践.Python编程导论(Introduction to Computer Science and Programming Using Python)利用Python进行数据分析Python数据分析与挖掘实战课程Introduction to Computer Science and Programming Usi...原创 2018-08-10 18:18:35 · 1269 阅读 · 0 评论 -
【pandas学习笔记】综合整理
1. ReindexSeries Reindex import numpy as npimport pandas as pd>>>s1 = pd.Series(np.random.randn(1, 4).tolist()[0], index=['A', 'B','C','D']) #先将数组转成listA 0.523862B -0.341507C...原创 2018-07-13 19:59:02 · 742 阅读 · 0 评论 -
【pandas学习笔记】DataFrame
1. 创建DataFrame可以通过以下方式进行创建 1. list 2. dictionary 3. ndarrays 4. 2d ndnarrays等通过dictionary key默认为列名# 索引自动添加df = pd.DataFrame({'Student_1':[90,100, 95], 'Student_2':[60, 80, 100]})# 索引主动...原创 2018-07-12 15:41:05 · 979 阅读 · 0 评论 -
【pandas学习笔记】Series
import pandas as pdimport numpy as npimport matplotlib.pyplot as plt%matplotlib inline创建Series以及对Series的相关操作# 自动添加索引# np.nan:empty value>>>s1 = pd.Series([1,2,3,4,np.nan,5,6,7]) 0 ...原创 2018-07-12 11:20:45 · 752 阅读 · 0 评论 -
【numpy学习笔记】数组的存储和下载
1. Saving array in binary format (.npy)>>>a = np.array([1,2,3,4,5])>>>np.save('array_a',a)>>>np.load('array_a.npy')a原创 2018-07-11 20:45:31 · 625 阅读 · 0 评论 -
【numpy学习笔记】 Array processing
1. numpy where function>>>A = np.array([1,2,3,4])>>>B= np.array([5,1,7,2])>>>condition = np.array([True,False,False,False])>>>np.where(condition,A,B)array([...原创 2018-07-11 17:45:08 · 794 阅读 · 0 评论 -
【numpy学习笔记】矩阵操作
转置a = np.array([[1,2,3],[3,4,5]],dtype='float')# array([[ 1., 2., 3.], [ 3., 4., 5.]])a.T # array([[ 1., 3.], [ 2., 4.], [ 3., 5.]])a = np.array([[[1,2,3,0],[...原创 2018-07-11 17:25:49 · 1294 阅读 · 1 评论 -
【numpy学习笔记】数组的切片,索引,迭代
1. 一维数组切片a = np.arange(10)# array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])a[5]# 5a[2:6] # array([2, 3, 4, 5])a[0:3] = 100a # 原数组发生改变array([100, 100, 100, 3, 4, 5, 6, 7, 8, 9])# ...原创 2018-07-10 20:34:25 · 837 阅读 · 0 评论 -
Python版本的数据结构书_《用Python解决数据结构与算法问题》
源于经典数据结构作为计算机从业人员的必备基础,Java, c 之类的语言有很多这方面的书籍,Python 相对较少, 其中比较著名的一本 problem-solving-with-algorithms-and-data-structure-using-python。其中《用Python解决数据结构与算法问题》是problem-solving-with-algorithms-and-data...原创 2018-08-22 18:16:14 · 5374 阅读 · 1 评论