ValueError: setting an array element with a sequence

Here is an example of what generates the stated exception. When you define an array, it should be X x Y dimensions. For example, with X = 3, and Y = 5, you will have a 3 x 5 dimensional array. If you don’t have a value for a given cell, you have to assign it a value of 0 and NOT leave it blank.

Here is a visual that may help in understanding this concept a little bit better:

ValueError_Exception

In figure (a) the the first row has three columns. The second row has two columns. It needs to have three columns. However, the value has to be set to 0 if it has no value. It cannot be left blank. Otherwise, a ValueError: setting an array element with a sequence exception will be generated. Refer to figure (b) for the correct way of defining an array.

Therefore, somewhere in your script, an array or an array like object is being defined as per the characteristics of figure (a).