答案 0 :(得分:2)
但请记住,在Ionic中如果要使用Native API,则必须先等待import numpy as np
def func(a, b, c, d):
if len(a.shape) == 1:
cf = -c
cf[:len(b)] += a - b
cf[-len(d)] -= d
else:
cf = -c
cf[:, :b.shape[1]] += a - b
cf[:, -d.shape[1]:] -= d
return cf
a = np.array([1, 1, 1, 1, 1, 1, 1])
b = np.array([2, 2, 2, 2, 2, 2, 2])
c = np.array([3, 3, 3, 3, 3, 3, 3, 3])
d = np.array([4])
func(a, b, c, d)
n = 10
a = np.zeros((n, 7))+1
b = np.zeros((n, 7))+2
c = np.zeros((n, 8))+3
d = np.zeros((n, 1))+4
func(a, b, c, d)
此事件将通知所有内容已加载且可以使用。
platform.ready()