[sage-support] Re: Creating a growing array in sage

2009-11-01 Thread Ichnich
Hi, take a look at this... http://www.scipy.org/Numpy_Example_List#head-12c005e9fff429abb657745defd2923dab55c62d import numpy as np a=np.array([[1,2],[3,4]]) b=np.array([[1,2],[5,6]]) a=np.append(a,[b[1]],axis=0) a Greets! Stefan On Nov 1, 3:28 pm, MaxTheMouse wrote: > I should add the ref

[sage-support] Re: Creating a growing array in sage

2009-11-01 Thread MaxTheMouse
I should add the reference. I found it on a scipy list: http://osdir.com/ml/python.scientific.user/2003-07/msg00078.html ~adam --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to

[sage-support] Re: Creating a growing array in sage

2009-11-01 Thread MaxTheMouse
Hi, See http://mathesaurus.sourceforge.net/matlab-numpy.html for concatenate commands etc. c = numpy.concatenate((a,b), axis=1) is not exactly what you want but should help although you have a repeat of the first column. The following is untested but might help. def remove(arr, index, dim=0):

[sage-support] Re: Creating a growing array in sage

2009-11-01 Thread Yotam Avital
No, in your solution you simply merge the files into two long columns. What I want is to create a table of data say those are my tables: table 1: wavelength absorption 330 0.65 331 0.68 332 0.70 333 0.69 334

[sage-support] Re: Creating a growing array in sage

2009-11-01 Thread MaxTheMouse
Sorry, I wasn't paying attention. I have a massive fever today. You want to add a column. I am thinking a slice operation should work. Adam --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, s

[sage-support] Re: Creating a growing array in sage

2009-11-01 Thread MaxTheMouse
On Nov 1, 7:20 am, Yotam Avital wrote: > This is not what I want. > > sage: !cat file1 > 1 3 > 2 0 > 3 10 > sage: !cat file2 > 1 29 > 2 21 > 3  -19 > sage: a=numpy.loadtxt('file1') > sage: b=numpy.loadtxt('file2') > > sage: out  = a b > > sage: out > array([[ 1.,  3. ,29], >          [ 2.,  0.

[sage-support] Re: Creating a growing array in sage

2009-10-31 Thread Yotam Avital
This is not what I want. sage: !cat file1 1 3 2 0 3 10 sage: !cat file2 1 29 2 21 3 -19 sage: a=numpy.loadtxt('file1') sage: b=numpy.loadtxt('file2') sage: out = a b sage: out array([[ 1., 3. ,29], [ 2., 0. ,21], [ 3., 10. ,-19]]) On Sun, Nov 1, 2009 at 3:02 AM, Jason

[sage-support] Re: Creating a growing array in sage

2009-10-31 Thread Jason Grout
yotama9 wrote: > Hello. > > I have several files of data that I want to merge into a single array > and then manipulate it (adding a single column to all the column > etc.) > > Each file is constructed of two columns. I want to take the columns of > the first file and add to the the second colum

[sage-support] Re: Creating a growing array in sage

2009-10-31 Thread David Joyner
On Sat, Oct 31, 2009 at 3:05 PM, yotama9 wrote: > > Hello. > > I have several files of data that I want to merge into a single array > and then manipulate it (adding a single column to all the column > etc.) > > Each file is constructed of two columns. I want to take the columns of > the first fi