[Numpy-discussion] array manupulation

Sudheer Joseph sudheer.joseph at yahoo.com
Sat May 25 08:19:58 EDT 2013


Dear experts,
I can do below operation in matlab but I wanted to do the same in python numpy array.
I tried np.vstak  and np.concatenate but not getting the desired results. please help. I wanted to add a row of zeros to the beginning of a numpy array. What is  the available quick way. 

>> cc=[1:10;1:10]

cc =
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10
>> cc=[cc(1,:)*0;cc]
cc =
     0     0     0     0     0     0     0     0     0     0
     1     2     3     4     5     6     7     8     9    10
     1     2     3     4     5     6     7     8     9    10

wit best regards,
Sudheer 
***************************************************************
Sudheer Joseph 
Indian National Centre for Ocean Information Services
Ministry of Earth Sciences, Govt. of India
POST BOX NO: 21, IDA Jeedeemetla P.O.
Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55
Tel:+91-40-23886047(O),Fax:+91-40-23895011(O),
Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile)
E-mail:sjo.India at gmail.com;sudheer.joseph at yahoo.com
Web- http://oppamthadathil.tripod.com
***************************************************************



More information about the NumPy-Discussion mailing list