On 11/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
On 11/30/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
>
> On 11/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
> >
> > It is also possible to put the variables of interest in a dictionary,
> then
> > pickle the dictionary. That way y
On 11/30/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
On 11/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
>
> It is also possible to put the variables of interest in a dictionary,
then
> pickle the dictionary. That way you can also store the variable names.
>
> In [27]: f = open(' dump.pkl'
On 11/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
>
> It is also possible to put the variables of interest in a dictionary, then
> pickle the dictionary. That way you can also store the variable names.
>
> In [27]: f = open(' dump.pkl','w')
>
> In [28]: pickle.dump( {'a':a,'b':b}, f)
>
> In
On 11/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
On 11/30/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
>
> What's a good way to save matrix objects to file for later use? I just
> need something quick for debugging.
>
> I saw two suggestions on this list from Francesc Altet (2006-05-22
On 11/30/06, Charles R Harris <[EMAIL PROTECTED]> wrote:
>
>
> On 11/30/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
> > What's a good way to save matrix objects to file for later use? I just
> > need something quick for debugging.
> >
> > I saw two suggestions on this list from Francesc Altet (200
On 11/30/06, Keith Goodman <[EMAIL PROTECTED]> wrote:
What's a good way to save matrix objects to file for later use? I just
need something quick for debugging.
I saw two suggestions on this list from Francesc Altet (2006-05-22):
1. Use tofile and fromfile and save the meta data yourself.
2.
What's a good way to save matrix objects to file for later use? I just
need something quick for debugging.
I saw two suggestions on this list from Francesc Altet (2006-05-22):
1. Use tofile and fromfile and save the meta data yourself.
2. pytables
Any suggestions for #3?
If I do #1, how would
Christopher Barker wrote:
>
> Robert Kern wrote:
>
>>> What determines if an array tests for equality as the entire array or
>>> element-wise?
>> There are some special cases for backwards compatibility.
>
> with what?
>
> IIRC, Numeric has raised an error for a very long time with:
>
> a ==
Robert Kern wrote:
>> What determines if an array tests for equality as the entire array or
>> element-wise?
>
> There are some special cases for backwards compatibility.
with what?
IIRC, Numeric has raised an error for a very long time with:
a == None #(a is a Numeric array)
Personally,
Excellent. That explains it.
thank you Robert,
tim
Robert Kern wrote:
> Tim Hirzel wrote:
>
>> Thanks Robert.
>> That makes more sense now. Although I am still a little puzzled by the
>> equality behavior of an array. for example:
>>
>> >>> a = numpy.arange(5)
>> >>> None == a
>> False
>>
Tim Hirzel wrote:
> Thanks Robert.
> That makes more sense now. Although I am still a little puzzled by the
> equality behavior of an array. for example:
>
> >>> a = numpy.arange(5)
> >>> None == a
> False
>
> >>> 5 == a
> array([False, False, False, False, False], dtype=bool)
>
> >>> cla
Thanks Robert.
That makes more sense now. Although I am still a little puzzled by the
equality behavior of an array. for example:
>>> a = numpy.arange(5)
>>> None == a
False
>>> 5 == a
array([False, False, False, False, False], dtype=bool)
>>> class Empty:
pass
>>> e = Empty()
>>> e
Tim Hirzel wrote:
> Does this seem odd to anyone else? I am not sure about the
> implementation of 'in' but it seems like a comparison is going funny
> somewhere. Or I am missing something...
Yes, list.__contains__ uses equality to test for membership, not identity.
--
Robert Kern
"I have c
Hi All,
When a list contains a numpy array and I want to see if a value is a
member of that list, I can get a value error from numpy:
>>> import numpy
>>> numpy.__version__
'1.0'
>>> a = numpy.arange(10)
>>> L = [a]
>>> a in L
True
>>> 2 in L
Traceback (most recent call last):
File "", lin
A colleague of mine wants to write some numpy extension code. I
pointed him to lots of examples in the matplotlib src dir, but the
build environment is more complicated than he needs with all the
numpy/numeric/numarray switches, etc. Does someone have the basic
"hello world" of numpy extensions
Charles R Harris wrote:
> I think that's right. Do you want to make the change?
Done.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Ec
Fang Fang wrote:
> Thanks for your reply. The simplified code is as follows. It takes 7
> seconds to process 1000 rows, which is tolerable, but I wonder why it
> takes so long. Isn't vectorized operation supposed to run very quickly.
>
> from numpy import *
>
> componentcount = 30
> currSum =
Fang Fang wrote:
> Thanks for your reply. The simplified code is as follows. It takes 7
> seconds to process 1000 rows, which is tolerable, but I wonder why it
> takes so long. Isn't vectorized operation supposed to run very quickly.
One problem is that you are creating a new currSum array for eve
Thanks for your reply. The simplified code is as follows. It takes 7 seconds
to process 1000 rows, which is tolerable, but I wonder why it takes so long.
Isn't vectorized operation supposed to run very quickly.
from numpy import *
componentcount = 30
currSum = zeros(componentcount)
row = zer
Fang Fang wrote:
> Hi,
>
> I am writing code to sort the columns according to the sum of each
> column. The dataset is huge (50k rows x 300k cols), so i have to read
> line by line and do the summation to avoid the out-of-memory problem.
> But I don't know why it runs very slow, and part of the co
Hi,
I am writing code to sort the columns according to the sum of each column.
The dataset is huge (50k rows x 300k cols), so i have to read line by line
and do the summation to avoid the out-of-memory problem. But I don't know
why it runs very slow, and part of the code is as follows. Can anyone
On Nov 29, 2006, at 1:09, Travis Oliphant wrote:
> You can
>
> #define PY_SSIZE_T_MIN INT_MIN
> #define PY_SSIZE_T_MAX INT_MAX
>
> before including the NumPy header file and it will by-pass the typedef
> for Py_ssize_t.
Interesting. Is that a test that would work for distinguishing Python
2.5 f
Lionel Roubeyrie wrote:
> Hi Torgil,
> strange, I don't have the same error:
>
> |~|[2]>array(['2'],dtype=float32)
> ---
> exceptions.ValueErrorTraceback
Hi Torgil,
strange, I don't have the same error:
|~|[2]>array(['2'],dtype=float32)
---
exceptions.ValueErrorTraceback (most recent
call last)
/home/lione
24 matches
Mail list logo