1问题描述
DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)
X[i] = np.random.normal(loc=Ex, scale=np.abs(Enn), size=1)
2代码详情
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False
def plot_cloud_model(Ex, En, He, n, ax, label='', color = 'r',marker = 'o'):
'''
Ex 期望
En 熵
He 超熵
n 云滴数量
'''
Y = np.zeros((1, n))
np.random.seed(int(np.random.random()*100))
X= np.random.normal(loc=En, scale=He, size=n)
Y = Y[0]
for i in range(n):
np