练习篇(Part 3) 31. 略 32. Is the following expressions true? (★☆☆) np.sqrt(-1) == np.emath.sqrt(-1) print(np.sqrt(-1) == np.emath.sqrt(-1)) 运行结果:False 33. How to get the dates of yesterday, today and tomorrow? (★☆☆) yesterday = np.datetime64('today','D')…
Numpy学习之--数组创建 过程展示 import numpy as np a = np.array([2,3,9]) a array([2, 3, 9]) a.dtype dtype('int32') b = np.array([1.2,2.3,3]) b array([1.2, 2.3, 3. ]) b.dtype dtype('float64') 常见的错误是:直接将多个数值当做参数传递,正确的做法是将他们以列表或数组的方式传递 # a = np.array(1,2,3)#错误 b =…