#-*-coding:utf-8-*-"""SpyderEditorThisisatemporaryscriptfile."""importmxnetasmximportnumpyasnpx=mx.nd.arange(0a,12).reshape(4,3)printxy=x.reshape(3,0)printyy=x.reshape(0,3)printyy=x.reshape(0,2)printy
分类:
Web程序 时间:
2018-11-13 20:14:29
阅读次数:
360
import numpy as np arr = np.array(np.arange(12).reshape(3,4)) print(arr) print(arr[0]) #获取二维数组的第一行 print(arr[1]) #获取二维数组的第二行 print(arr[:3]) #获取二维数组的前三... ...
分类:
编程语言 时间:
2018-11-12 17:53:58
阅读次数:
202
import numpy as np # numpy创建有规律的一维数组(元组构成) l1 = np.arange(5) print(type(l1)) print(l1) # 打印结果 # # [0 1 2 3 4] #创建一个没有规律的一维数组(元组构成) l2 = np.array((1,23... ...
分类:
编程语言 时间:
2018-10-31 10:41:51
阅读次数:
165
content: range() np.arange() np.linspace() 一.range(start, stop, step) 1.range() 为 python 自带函数 2.生成一个从start( 包含 )到stop( 不包含 ),以step为步长的序列。返回一个 list 对象 ...
分类:
其他好文 时间:
2018-09-15 13:12:37
阅读次数:
3167
import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 10, 0.1) y1 = 0.05 * x**2 y2 = -1 * y1 fig, ax1 = plt.subplots() #获取figure默认的坐标系 a... ...
分类:
其他好文 时间:
2018-09-04 14:02:13
阅读次数:
184
from matplotlib import pyplot as plt from matplotlib import animation import numpy as np fig, ax = plt.subplots() x = np.arange(0, 2*np.pi, 0.01) line... ...
分类:
其他好文 时间:
2018-09-04 13:58:28
阅读次数:
185
dates = pd.date_range('20130101', periods=6)df = pd.DataFrame(np.arange(24).reshape((6,4)),index=dates, columns=['A','B','C','D']) 创建了一个dataframe date ...
分类:
其他好文 时间:
2018-09-01 21:53:29
阅读次数:
206
原文出处:numpy.where() 用法讲解 原创作者:massquantity numpy.where() 有两种用法: 1. np.where(condition, x, y) 满足条件(condition),输出x,不满足输出y 情景(一) >>> aa = np.arange(10) >> ...
分类:
其他好文 时间:
2018-08-24 11:40:42
阅读次数:
146
import numpy as np print '读取csv文件做为数组' arr = np.loadtxt('array_ex.txt', delimiter = ',') print arr import numpy as np print '数组文件读写' arr = np.arange(1... ...
分类:
其他好文 时间:
2018-08-23 02:10:12
阅读次数:
142
#保存数据注意他只能保存变量,不能保存神经网络的框架。#保存数据的作用:保存权重有利于下一次的训练,或者可以用这个数据进行识别#np.arange():arange函数用于创建等差数组,使用频率非常高import tensorflow as tf#注意:在保存变量的时候,一定要写出他的类型即dtyp ...
分类:
其他好文 时间:
2018-08-08 13:37:13
阅读次数:
198