Hi

   I'm trying to understand the following code:

 

    import numpy as np

 

    dt=np.dtype([("c",np.int32,(2))])

    

    data=np.ndarray([2],dtype=dt)

    

    x=np.array([0,10])

 

    #the following line doesn't set data[0]["c"] = x

    #only data[0]["c"][0] changes    

    data[0]["c"]=x

    

    #the following does set data[1]["c"][:]=x

    data[1]["c"][:]=x

    

 

What I don't understand is why does, the assignment of data[0]["c"]=x not
set c=x but the second one does?

 

Thanks

Jeremy            

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to