>From my experience working on my own projects and Cython:
* the C code making Python C-API calls could be made to
version-agnostic by using preprocessor macros, and even some
compatibility header conditionally included. Perhaps the later would
be the easiest for C-API calls (we have a lot already
Robert Kern wrote:
> On Thu, Dec 4, 2008 at 18:54, Brennan Williams
> <[EMAIL PROTECTED]> wrote:
>
>> Thanks
>>
>> [EMAIL PROTECTED] wrote:
>>
>>> I didn't check what this does behind the scenes, but try this
>>>
>>>
>>>
>> import hashlib #standard python library
>> import numpy as n
On Thu, Dec 4, 2008 at 18:54, Brennan Williams
<[EMAIL PROTECTED]> wrote:
> Thanks
>
> [EMAIL PROTECTED] wrote:
>> I didn't check what this does behind the scenes, but try this
>>
>>
> import hashlib #standard python library
> import numpy as np
>> m = hashlib.md5()
>> m.update(np.array(range(100))
Thanks
[EMAIL PROTECTED] wrote:
> I didn't check what this does behind the scenes, but try this
>
>
import hashlib #standard python library
import numpy as np
> m = hashlib.md5()
> m.update(np.array(range(100)))
> m.update(np.array(range(200)))
>
> m2 = hashlib.md5()
> m2.update(np.array(range(
On Thu, Dec 4, 2008 at 6:57 PM, <[EMAIL PROTECTED]> wrote:
> I didn't check what this does behind the scenes, but try this
>
I forgot to paste:
import hashlib #standard python library
Josef
___
Numpy-discussion mailing list
Numpy-discussion@scipy.org
I didn't check what this does behind the scenes, but try this
m = hashlib.md5()
m.update(np.array(range(100)))
m.update(np.array(range(200)))
m2 = hashlib.md5()
m2.update(np.array(range(100)))
m2.update(np.array(range(200)))
print m.hexdigest()
print m2.hexdigest()
assert m.hexdigest() == m2.h
On Thu, Dec 4, 2008 at 17:43, Brennan Williams
<[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>> On Thu, Dec 4, 2008 at 6:17 PM, Brennan Williams
>> <[EMAIL PROTECTED]> wrote:
>>
>>> My app reads in one or more float arrays from a binary file.
>>>
>>> Sometimes due to network timeouts etc th
On Fri, Dec 5, 2008 at 4:03 AM, Robert Kern <[EMAIL PROTECTED]> wrote:
> On Thu, Dec 4, 2008 at 12:57, Charles R Harris
> <[EMAIL PROTECTED]> wrote:
>>
>>
>> On Thu, Dec 4, 2008 at 9:39 AM, Charles R Harris <[EMAIL PROTECTED]>
>> wrote:
>>>
>>>
>>> On Thu, Dec 4, 2008 at 1:20 AM, Erik Tollerud <[EM
[EMAIL PROTECTED] wrote:
> On Thu, Dec 4, 2008 at 6:17 PM, Brennan Williams
> <[EMAIL PROTECTED]> wrote:
>
>> My app reads in one or more float arrays from a binary file.
>>
>> Sometimes due to network timeouts etc the array is not read correctly.
>>
>> What would be the best way of checking the
I am not familiar with this, but it looks quite useful:
http://www.stecf.org/software/PYTHONtools/astroasciidata/
or (http://www.scipy.org/AstroAsciiData)
"Within the AstroAsciiData project we envision a module which can be
used to work on all kinds of ASCII tables. The module provides a
convenien
On Thu, Dec 4, 2008 at 6:17 PM, Brennan Williams
<[EMAIL PROTECTED]> wrote:
> My app reads in one or more float arrays from a binary file.
>
> Sometimes due to network timeouts etc the array is not read correctly.
>
> What would be the best way of checking the validity of the data?
>
> Would some s
On Thu, Dec 4, 2008 at 17:17, Brennan Williams
<[EMAIL PROTECTED]> wrote:
> My app reads in one or more float arrays from a binary file.
>
> Sometimes due to network timeouts etc the array is not read correctly.
>
> What would be the best way of checking the validity of the data?
>
> Would some sor
My app reads in one or more float arrays from a binary file.
Sometimes due to network timeouts etc the array is not read correctly.
What would be the best way of checking the validity of the data?
Would some sort of checksum approach be a good idea?
Would that work with an array of floating poin
On Tue, Dec 2, 2008 at 9:57 PM, Gabriel Gellner <[EMAIL PROTECTED]>wrote:
> After some discussion on the Cython lists I thought I would try my hand at
> writing some Cython accelerators for empty and zeros. This will involve
> using
> PyArray_EMPTY, I have a simple prototype I would like to get wo
>> I want to apply a function (myfunc which takes and returns a scalar) to each
>> element in a multi-dimensioned array (data):
>>
>> I can do this:
>>
>> newdata = numpy.array([myfunc(d) for d in data.flat]).reshape(data.shape)
>>
>> But I'm wondering if there's a faster more numpy way. I've looke
[EMAIL PROTECTED] wrote:
>>> Raise a ValueError (even in 2.5, therefore risking to break something)
+1 as well
> it took me a while to figure out that some
> mysteriously appearing zeros were nans that were silently converted
> during casting to int.
and this is why -- a zero is a perfectly vali
Pierre GM wrote:
> All,
> Here's the second round of genloadtxt. That's a tad cleaner version than
> the previous one, where I tried to take into account the different
> comments and suggestions that were posted. So, tabs should be supported
> and explicit whitespaces are not collapsed.
Looks
On Dec 4, 2008, at 3:24 PM, [EMAIL PROTECTED] wrote:
> On Thu, Dec 4, 2008 at 2:40 PM, Jarrod Millman
> <[EMAIL PROTECTED]> wrote:
>> On Thu, Dec 4, 2008 at 11:14 AM, Pierre GM <[EMAIL PROTECTED]>
>> wrote:
>>> Raise a ValueError (even in 2.5, therefore risking to break
>>> something)
>>
>>
On Thu, Dec 4, 2008 at 12:15 PM, Tommy Grav <[EMAIL PROTECTED]> wrote:
> On Dec 4, 2008, at 2:03 PM, Robert Kern wrote:
>> It does. What problems are people seeing? Is it just the Windows build
>> that causes people to say "numpy doesn't work with Python 2.6"?
>
> There is currently no official Mac
On Thu, Dec 4, 2008 at 2:40 PM, Jarrod Millman <[EMAIL PROTECTED]> wrote:
> On Thu, Dec 4, 2008 at 11:14 AM, Pierre GM <[EMAIL PROTECTED]> wrote:
>> Raise a ValueError (even in 2.5, therefore risking to break something)
>
> +1
>
+1
I'm not yet a serious user of numpy/scipy, but when debugging the
On Dec 4, 2008, at 2:03 PM, Robert Kern wrote:
> It does. What problems are people seeing? Is it just the Windows build
> that causes people to say "numpy doesn't work with Python 2.6"?
There is currently no official Mac OSX binary for numpy for python 2.6,
but you can build it from source. Is the
On Thu, Dec 4, 2008 at 11:14 AM, Pierre GM <[EMAIL PROTECTED]> wrote:
> Raise a ValueError (even in 2.5, therefore risking to break something)
+1
--
Jarrod Millman
Computational Infrastructure for Research Labs
10 Giannini Hall, UC Berkeley
phone: 510.643.4014
http://cirl.berkeley.edu/
_
On Nov 25, 2008, at 12:23 PM, Pierre GM wrote:
> All,
> Sorry to bump my own post, and I was kinda threadjacking anyway:
>
> Some functions of numy.ma (eg, ma.max, ma.min...) accept explicit
> outputs that may not be MaskedArrays.
> When such an explicit output is not a MaskedArray, a value tha
On Thu, Dec 4, 2008 at 12:57, Charles R Harris
<[EMAIL PROTECTED]> wrote:
>
>
> On Thu, Dec 4, 2008 at 9:39 AM, Charles R Harris <[EMAIL PROTECTED]>
> wrote:
>>
>>
>> On Thu, Dec 4, 2008 at 1:20 AM, Erik Tollerud <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> I noticed that the Python 3000 final was release
On Thu, Dec 4, 2008 at 9:39 AM, Charles R Harris
<[EMAIL PROTECTED]>wrote:
>
>
> On Thu, Dec 4, 2008 at 1:20 AM, Erik Tollerud <[EMAIL PROTECTED]>wrote:
>
>> I noticed that the Python 3000 final was released today... is there
>> any sense of how long it will take to get numpy working under 3k? I
2008/12/4 Charles R Harris <[EMAIL PROTECTED]>:
>
>
> On Thu, Dec 4, 2008 at 8:26 AM, Olivier Grisel <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi list,
>>
>> Suppose I have array a with dimensions (d1, d3) and array b with
>> dimensions (d2, d3). I want to compute array c with dimensions (d1,
>> d2) holdi
On Dec 4, 2008, at 7:22 AM, Manuel Metz wrote:
>
> Will loadtxt in that case remain as is? Or will the _faulttolerantconv
> class be used?
No idea, we need to discuss it. There's a problem with
_faulttolerantconv: using np.nan as default value will not work in
Python2.6 if the output is to be
On Thu, Dec 4, 2008 at 8:26 AM, Olivier Grisel <[EMAIL PROTECTED]>wrote:
> Hi list,
>
> Suppose I have array a with dimensions (d1, d3) and array b with
> dimensions (d2, d3). I want to compute array c with dimensions (d1,
> d2) holding the squared euclidian norms of vectors in a and b with
> size
2008/12/4 Stéfan van der Walt <[EMAIL PROTECTED]>:
> Hi Olivier
>
> 2008/12/4 Olivier Grisel <[EMAIL PROTECTED]>:
>> To avoid the python level loop I then tried to use broadcasting as follows:
>>
> c = sum((a[:,newaxis,:] - b) ** 2, axis=2)
>>
>> But this build a useless and huge (d1, d2, d3) t
On Thu, Dec 4, 2008 at 1:20 AM, Erik Tollerud <[EMAIL PROTECTED]>wrote:
> I noticed that the Python 3000 final was released today... is there
> any sense of how long it will take to get numpy working under 3k? I
> would imagine it'll be a lot to adapt given the low-level change, but
> is the work
> I needed it to help me fixing a couple of bugs for old CPU, so it
> ended up being implemented in the nsis script for scipy now (I will
> add it to numpy installers too). So from now, any newly releases of
> both numpy and scipy installers could be overriden:
>
> installer-name.exe /arch native -
Hi Olivier
2008/12/4 Olivier Grisel <[EMAIL PROTECTED]>:
> To avoid the python level loop I then tried to use broadcasting as follows:
>
c = sum((a[:,newaxis,:] - b) ** 2, axis=2)
>
> But this build a useless and huge (d1, d2, d3) temporary array that
> does not fit in memory for large values
Hi list,
Suppose I have array a with dimensions (d1, d3) and array b with
dimensions (d2, d3). I want to compute array c with dimensions (d1,
d2) holding the squared euclidian norms of vectors in a and b with
size d3.
My first take was to use a python level loop:
>>> from numpy import *
>>> c =
Pierre GM wrote:
> All,
> Here's the second round of genloadtxt. That's a tad cleaner version than
> the previous one, where I tried to take into account the different
> comments and suggestions that were posted. So, tabs should be supported
> and explicit whitespaces are not collapsed.
> FYI,
And now for the tests:
# pylint disable-msg=E1101, W0212, W0621
import numpy as np
import numpy.ma as ma
from numpy.ma.testutils import *
from StringIO import StringIO
from _preview import *
class TestLineSplitter(TestCase):
"Tests the LineSplitter class."
#
def test_no_delimite
All,
Here's the second round of genloadtxt. That's a tad cleaner version
than the previous one, where I tried to take into account the
different comments and suggestions that were posted. So, tabs should
be supported and explicit whitespaces are not collapsed.
FYI, in the __main__ section,
I noticed that the Python 3000 final was released today... is there
any sense of how long it will take to get numpy working under 3k? I
would imagine it'll be a lot to adapt given the low-level change, but
is the work already in progress?
___
Numpy-discu
37 matches
Mail list logo