“The truth value of an array with more than one element is ambiguous” in python
问题 this is how I got the two arrays (array 1 and array2) for my function: x = np.arange(-5, 5,0.01) prob=stats.norm.pdf(x,0,1) prob_array=numpy.array(prob).reshape(1000,1) #array1 x_tran=m.transpose() x_tran_array=array(x_tran) mu_array=array(mu) # mu is stock return mu_array1=numpy.array(mu_array).reshape(54966,1) sigma_array=array(sigma) #sigma is the historical volatility sigma_array1=numpy.array(sigma_array).reshape(54966,1) mu1_mat=mat(ones((1,1000))) #for matrix calculation original_x=mu