[SciPy-User] creating a particular numpy array

Oleksandr Huziy guziy.sasha at gmail.com
Wed Apr 30 12:15:21 EDT 2014


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 at 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 at 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 at 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 at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>>
>>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>


-- 
Sasha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20140430/5640d358/attachment.html>


More information about the SciPy-User mailing list