Converting dolfin vector dtype object to float

I am getting output in object datatype. I wanted float data output, but that gives “ValueError: setting an array element with a sequence” error. The extract of code is shown below

W = FunctionSpace(mesh, MixedElement([Ve, Re]))
dv = TrialFunction(W)
(v, lamb) = split(w)
dx = Measure('dx')(subdomain_data=subdomains)
def eps(v):
    return as_vector([0,v[1].dx(0),v[1].dx(0),v[1].dx(0),v[1].dx(0),v[0].dx(0)])


solve (a==L,w) 

DD = np.zeros((6,),dtype =object)
for p in range(6):


< at 0x7f6d5fa2e7a0>


< at 0x7f6d64b65f80>

I wanted to get float values of DD matrix. If I add some number like 100, then it shows different location as shown above.

If I remove the dtype from DD, it gives the following error

DD = np.zeros((6,))
for p in range(6):

TypeError                                 Traceback (most recent call last)
TypeError: float() argument must be a string or a real number, not ''

The above exception was the direct cause of the following exception:

ValueError                                Traceback (most recent call last)
/tmp/ipykernel_238/ in <module>
      2 for p in range(6):
      3     for q in range(6):
----> 4         DD[p,q]=assemble(sum([outer(dot(Com(i),eps(dv)),V)[p,q]*dx(i) for i in range(nphases)]))/vol

ValueError: setting an array element with a sequence.

Kindly help me for getting DD in float/ real number output.

Please format the code with 3x` encapsulation.

# add code here 


I have edited the code with sugessted encapsulation. Thanks @dokken.

You code is not complete, as in there is no way to reproduce your erro message as the code currently stands.
Also, it is unclear to me if this is your actual code, as:

contains a trial function, and no test function, which does not make sense to be.
Are you trying to compute something with your solution (w) here?