Deprecated action in code. What does this mean and how do I fix it?

Hello,
I am workign on this project and created an numpy array and this error message showed up. What does it mean and how do I get rid of it for future reference?

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.
  SW_G = np.array([0,0,-SW_UDL]) #Global self-weight UDL force vector for the element

Thank you!

You have a newer version of NumPy installed (1.19?)

try adding this to your array: dtype=object

Also, to check what version you have, try this:

(if on a Mac, in terminal):
at the prompt:
python -m pip show numpy

See:

and,

1 Like