Questions and discussion for this lecture live here. Fire away by hitting Reply below ![]()
Hi Dr. Sean,
I have problem with the phyton script, especially for this code below:
disp = np.array([[UG[ia,0],UG[ia+1,0],UG[ib],UG[ja,0],UG[jb,0]]]).T
The error is:
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (1, 5) + inhomogeneous part.
It seems that the main problem is UG[ib] as this has different matrix size compared to the others. I am wondering how your code is working with this configuration. Can you help me with this? Thank you in advance.
Regards,
Avandi
Hi @Avandi_Novena - Have you downloaded the complete code from Lecture 39?
Usually the quickest way to identify your issue is to compare your code with the completed version - this will typically identify any typos leading to your error.
Your interpretation of the error is correct - so this suggests to me that you have a type somewhere before this point in your code that misses a guard against this error occurring.
S
Hi Dr. Sean,
Thank you for your reply. I will have a look on it. Thanks for your help.
Regards,
Avandi