python入门经典视频系列教程(免费,2K超清,送书)
https://study.163.com/course/courseMain.htm?courseId=1006183019&share=2&shareId=400000000398149
目录:
1.numpy.vstack()
2. np.ones_like(x)
3.numpy.random.seed(0)
4.numpy.random.randn
5.flatten
1.numpy.vstack()
函数原型:numpy.vstack(tup)
等价于:np.concatenate(tup, axis=0) if tup contains arrays thatare at least 2-dimensional.
程序实例:
>>> a = np.array([1, 2, 3]) >>> b = np.array([2, 3, 4]) >>> np.vstack((a,b)) array([[1, 2, 3], [2, 3, 4]]) >>> >>> a = np.array([[1], [2], [3]]) >>> b = np.array([[2], [3], [4]]) >>> np.vstack((a,b)) array([[1], [2], [3], [2], [3], [4]])
2. np.ones_like(x)
>>> x = np.arange(6) >>> x = x.reshape((2, 3)) >>> x array([[0, 1, 2], [3, 4, 5]]) >>> np.ones_like(x) array([[1, 1, 1], [1, 1, 1]]) >>> y = np.arange(3, dtype=np.float) >>> y array([ 0., 1., 2.]) >>> np.ones_like(y) array([ 1., 1., 1.])
3.numpy.random.seed(0)
>>>> numpy.random.seed(0) ; numpy.random.rand(4) array([ 0.55, 0.72, 0.6 , 0.54]) >>> numpy.random.seed(0) ; numpy.random.rand(4) array([ 0.55, 0.72, 0.6 , 0.54]) >>> numpy.random.rand(4) array([ 0.42, 0.65, 0.44, 0.89]) >>> numpy.random.rand(4) array([ 0.96, 0.38, 0.79, 0.53])
4.numpy.random.randn
https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.randn.html
numpy.random.randn(d0, d1, …, dn)是从标准正态分布中返回一个或多个样本值。
numpy.random.rand(d0, d1, …, dn)的随机样本位于[0, 1)中。
5.flatten
Python中flatten用法
http://blog.csdn.net/maoersong/article/details/23823925
pandas和SQL数据分析实战视频教程
https://study.163.com/course/courseMain.htm?courseId=1006383008&share=2&shareId=400000000398149