Error with copying

Karthikesh Raju karthik at james.hut.fi
Fri Nov 22 05:55:53 EST 2002


Hi,

i am trying to copy an slice of an array and i keep getting the error:

>> Object too deep for desired array


i tried the following:


sCode = Numeric.zeros([nprime*C,K*L*(window+1)],'d') # nprime = 1

for k in range(K):
        for l in range(L):
            code1 = copy.deepcopy(Numeric.array(code[k,0:C-pd[k,l]]))
            code1.shape = (C-pd[k,l],1)
            sCode[:, (window+1)*l+window*L*k]  = Numeric.concatenate((Numeric.zeros([pd[k,l],1]),Numeric.zeros([C*window,1]),code1))
             

Where:

K is 1, L is 1,
pd = array([[0]])
code = array([[-1,1,-1,1,1]])
window = 1

i thought that this is due to the references generated at every slice,
but i am struck now....

Thankx in advance
karthik

-- 

-----------------------------------------------------------------------
Karthikesh Raju,		    email: karthik at james.hut.fi		
Researcher,			    http://www.cis.hut.fi/karthik
Helsinki University of Technology,  Tel: +358-9-451 5389
Laboratory of Comp. & Info. Sc.,    Fax: +358-9-451 3277
Department of Computer Sc.,
P.O Box 5400, FIN 02015 HUT,
Espoo, FINLAND
-----------------------------------------------------------------------



More information about the Python-list mailing list