'VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences. NeedHelp

for i in np.arange(1,len(y)).reshape(-1):
    f = np.array([f,np.exp(- (x ** 2 + y[i] ** 2))])
    P = np.array([[P], 
        [np.transpose(x),np.matlib.repmat(y[i],len(x),1)]])

:2: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray f = np.array([f,np.exp(- (x ** 2 + y[i] ** 2))]) :3: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray P = np.array([[P],[np.transpose(x),np.matlib.repmat(y[i],len(x),1)]])



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source