Python Numpy np.hermone()方法
在np.hermone()方法的帮助下,我们可以通过使用np.hermone()方法用hermzero代替np. ones。
语法: np.hermone()
返回:返回数组([1])
例子#1 :
在这个例子中,我们可以看到,通过使用np.hermone()方法,我们能够获得与此方法相同的np.ones的功能。
输出 :
[2 3 4 5 6]
例子#2 :
输出 :
[[ 3 5 7]
[ 4 7 10]]
在np.hermone()方法的帮助下,我们可以通过使用np.hermone()方法用hermzero代替np. ones。
语法: np.hermone()
返回:返回数组([1])
例子#1 :
在这个例子中,我们可以看到,通过使用np.hermone()方法,我们能够获得与此方法相同的np.ones的功能。
输出 :
[2 3 4 5 6]
例子#2 :
输出 :
[[ 3 5 7]
[ 4 7 10]]