Hy everybody,
I'm wondering what is the (best) way to apply the same function to multiple
arrays.
For example, in the following code:
from numpy import *
def f(arr):
return arr*2
a = array( [1,1,1] )
b = array( [2,2,2] )
c = array( [3,3,3] )
d = array( [4,4,4] )
a = f(a)
b = f(b)
c = f(c
On Sun, Sep 11, 2011 at 14:44, Travis Vaught wrote:
>
> On Sep 11, 2011, at 2:58 AM, Robert Kern wrote:
>
>> On Sun, Sep 11, 2011 at 00:30, Travis Vaught wrote:
>>> Greetings,
>>>
>>> Is there a particular reason why a list of lists can't be passed in to
>>> create a recarray given a particular
On Sep 11, 2011, at 2:58 AM, Robert Kern wrote:
> On Sun, Sep 11, 2011 at 00:30, Travis Vaught wrote:
>> Greetings,
>>
>> Is there a particular reason why a list of lists can't be passed in to
>> create a recarray given a particular dtype?
>>
>> A list of tuples works fine. I keep getting bi
On Sun, Sep 11, 2011 at 13:23, Pauli Virtanen wrote:
> Sun, 11 Sep 2011 03:03:26 -0500, Pengkui Luo wrote:
> [clip]
> > However, converting a large sparse matrix to dense would easily eat up
> > the memory. Is there a way for np.sign (as well as other ufunc) to take
> > a sparse matrix as paramet
Sun, 11 Sep 2011 03:03:26 -0500, Pengkui Luo wrote:
[clip]
> However, converting a large sparse matrix to dense would easily eat up
> the memory. Is there a way for np.sign (as well as other ufunc) to take
> a sparse matrix as parameter, and return a sparse matrix?
For CSR, CSC, and DIA you can do
ESCO 2012 - European Seminar on Coupled Problems
=
ESCO2012 http://esco2012.femhub.com/ is the 3rd event in a series of
interdisciplineary meetings dedicated to computational science challenges
in multi-physics and PDEs.
I was invited as ESCO last y
It seems that numpy universal functions only apply to ndarray (or dense
matrix). Is there a way to apply them to scipy sparse matrices also?
For example, suppose S is an large sparse matrix (lil_matrix format,
dtype=np.float). I want to get another sparse matrix B (of the same shape)
that represen
On Sun, Sep 11, 2011 at 00:30, Travis Vaught wrote:
> Greetings,
>
> Is there a particular reason why a list of lists can't be passed in to create
> a recarray given a particular dtype?
>
> A list of tuples works fine. I keep getting bitten by this and was thinking
> it should be an easy check/