creating a particular numpy array
Hi, I have a particular array MYMAP = [np.zeros([npha, nobs, nex], dtype=float)] how can I create an array of 210 of MYMAP? thanks Gabriele
The way you wrote it, you've a list of length one, with the array being its only element: MYMAP =[....] On Apr 30, 2014 3:38 PM, "Gabriele Brambilla" < gb.gabrielebrambilla@gmail.com> wrote:
Hi,
I have a particular array
MYMAP = [np.zeros([npha, nobs, nex], dtype=float)]
how can I create an array of 210 of MYMAP?
thanks
Gabriele
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
Yes, I have corrected it. sorry MYMAP = np.zeros([npha, nobs, nex, 210], dtype=float) now there is no problem. thanks 2014-04-30 11:28 GMT-04:00 Evgeni Burovski <evgeny.burovskiy@gmail.com>:
The way you wrote it, you've a list of length one, with the array being its only element:
MYMAP =[....] On Apr 30, 2014 3:38 PM, "Gabriele Brambilla" < gb.gabrielebrambilla@gmail.com> wrote:
Hi,
I have a particular array
MYMAP = [np.zeros([npha, nobs, nex], dtype=float)]
how can I create an array of 210 of MYMAP?
thanks
Gabriele
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
If you are OK with having the same obj for each array element: x = np.asarray(210*[np.zeros([npha, nobs, nex], dtype=float)]) Cheers 2014-04-30 11:53 GMT-04:00 Gabriele Brambilla < gb.gabrielebrambilla@gmail.com>:
Yes, I have corrected it. sorry
MYMAP = np.zeros([npha, nobs, nex, 210], dtype=float)
now there is no problem.
thanks
2014-04-30 11:28 GMT-04:00 Evgeni Burovski <evgeny.burovskiy@gmail.com>:
The way you wrote it, you've a list of length one, with the array being
its only element:
MYMAP =[....] On Apr 30, 2014 3:38 PM, "Gabriele Brambilla" < gb.gabrielebrambilla@gmail.com> wrote:
Hi,
I have a particular array
MYMAP = [np.zeros([npha, nobs, nex], dtype=float)]
how can I create an array of 210 of MYMAP?
thanks
Gabriele
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
-- Sasha
participants (3)
-
Evgeni Burovski -
Gabriele Brambilla -
Oleksandr Huziy