
python
Datawhale
一个开源的学习组织
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【numpy学习笔记】数组的创建和基本运算
1. 创建numpy数组 1.1 通过tuple和list创建数组 import numpy as np 通过tuple t=(1,2,3) a=np.array(t,dtype= 'int') #array([1, 2, 3]) 通过list list1 = [1,2,3] a = np.array(list1,dtype='int') #array([1, 2, 3]) 用多个...原创 2018-07-10 17:49:43 · 1327 阅读 · 0 评论 -
PIP_安装PYTHON包的三种方式
PIP 1. 从官方库下载 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 · 3498 阅读 · 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 · 1282 阅读 · 0 评论 -
【pandas学习笔记】综合整理
1. Reindex Series Reindex import numpy as np import pandas as pd >>>s1 = pd.Series(np.random.randn(1, 4).tolist()[0], index=['A', 'B','C','D']) #先将数组转成list A 0.523862 B -0.341507 C...原创 2018-07-13 19:59:02 · 767 阅读 · 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 · 1006 阅读 · 0 评论 -
【pandas学习笔记】Series
import pandas as pd import numpy as np import 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 · 774 阅读 · 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 · 641 阅读 · 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 · 817 阅读 · 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 · 1311 阅读 · 1 评论 -
【numpy学习笔记】数组的切片,索引,迭代
1. 一维数组 切片 a = np.arange(10) # array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) a[5] # 5 a[2:6] # array([2, 3, 4, 5]) a[0:3] = 100 a # 原数组发生改变 array([100, 100, 100, 3, 4, 5, 6, 7, 8, 9]) # ...原创 2018-07-10 20:34:25 · 859 阅读 · 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 · 5405 阅读 · 1 评论