[Numpy-discussion] reshape

Nadav Horesh nadavh at visionsense.com
Thu Nov 6 14:43:30 EST 2008


cc = C.ravel()
lines_list = cc[i:i+8] for i in range(1, len(cc),  8)]

  Nadav

-----הודעה מקורית-----
מאת: numpy-discussion-bounces at scipy.org בשם Nils Wagner
נשלח: ה 06-נובמבר-08 20:59
אל: Discussion of Numerical Python
נושא: Re: [Numpy-discussion] reshape
 
On Thu, 6 Nov 2008 19:47:19 +0200
  "Nadav Horesh" <nadavh at visionsense.com> wrote:
> Can you clarify?
  
I have an array with a number of rows (nrows) and two 
columns.
The first column entries correspond to x_i, the second
column contains the corresponding values y_i = f(x_i)
That array should be written to a file where each line
consists 4 pairs (x_i, y_i=f(x_i)) except the last line
if nrows/8 is not an integer.

HTH,
          Nils


  
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3143 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20081106/e4cf1f59/attachment.bin>


More information about the NumPy-Discussion mailing list