7 Aug 17:34
concatenate array with number
From: Nicolas Chopin <nicolas.chopin <at> bristol.ac.uk>
Subject: concatenate array with number
Newsgroups: gmane.comp.python.scientific.user
Date: 2008-08-07 15:37:01 GMT
Subject: concatenate array with number
Newsgroups: gmane.comp.python.scientific.user
Date: 2008-08-07 15:37:01 GMT
Hi list,
I want to do this:
x = concatenate( (x,x[-1]) )
i.e. append to 1d array x its last element.
However, the only way I managed to do this is:
x = concatenate( (x,array(x[-1],ndmin=1)) )
which is a bit cryptic. (if you remove ndmin, it does not work.)
1. Is there a better way?
2. Could concatenate accept floating point numbers as arguments for convenience?
Thanks in advance,
Nicolas
I want to do this:
x = concatenate( (x,x[-1]) )
i.e. append to 1d array x its last element.
However, the only way I managed to do this is:
x = concatenate( (x,array(x[-1],ndmin=1)) )
which is a bit cryptic. (if you remove ndmin, it does not work.)
1. Is there a better way?
2. Could concatenate accept floating point numbers as arguments for convenience?
Thanks in advance,
Nicolas
_______________________________________________ SciPy-user mailing list SciPy-user <at> scipy.org http://projects.scipy.org/mailman/listinfo/scipy-user
RSS Feed