赞
踩
利用Python 进行数据分析 徐敬一 译
Python for Data Analysis:Data Wrangling with Pandas Numpy and IPython Author Wes McKinney
http://github.com/wesm/pydata-book
1.3 重要的Python 库
第二章 Python 语言基础
第三章 内建数据结构,函数及文件
3.1.1元组
3.1.2 列表
3.1.3 内建序函数
3.1.4字典
3.1.5集合
3.2 函数
第四章 Numpy
- #chapter4 numpy basic
- from numpy import *
- eye(4)
-
- import numpy as np
- data = np.random.randn(2,3)
- data
-
- data.shape
- data.dtype
-
- #4.1.1 生成ndarray
-
- data1 = [6,7.5,8,0,1]
- arr1 = np.array(data1)
- arr1
-
- data2 = [[1,2,3,4],[5,6,7,8]]
- arr2 = np.array(data2)
- arr2
-
-
- arr2.ndim
- arr2.shape
-
- np.zeros(10)
- np.zeros((3,6))
- np.empty((2,3,2))
-
- np.arange(15)
-
-
-
-
- #深度学习入门 4.3.2 数值微分的例子
-
- import numpy as np
- import matplotlib.pylab as plt
-
- def function_1(x):
- return 0.01*x**2+0.1*x
-
- x=np.arange(0.0,20.0,0.1) # 以0.1 为单位,从0到20的数组X
- y=function_1(x)
- plt.xlabel("x")
- plt.ylabel("f(x)")
- plt.plot(x,y)
- plt.show()
-
-
-
- #4.1.2 ndarray 数据类型
- #4.1.3 numpy 数组计算
- #4.1.4 基础索引与切片
-
- arr= np.arange(10)
- arr
- arr[5]
- arr[5:8]
- #4.1.5 布尔索引
- names = np.array(['Bob','Joe','Will','Bob','will','Joe','Joe
![](https://csdnimg.cn/release/blogv2/dist/pc/img/newCodeMoreWhite.png)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。