Re: [Numpy-discussion] "Symbol table not found" compiling numpy from git repository on Windows

2014-12-10 Thread melmell
Hey Guys, I'm having the same problem with building a python wrapper for a C library using windows. Tried applying the patch mentioned above, but still receiving the following error message. Any thoughts? Thanks Mel Looking for python34.dll Building import library (arch=AMD64): "c:\Python34

Re: [Numpy-discussion] Add a function to broadcast arrays to a given shape to numpy's stride_tricks?

2014-12-10 Thread Stephan Hoyer
On Wed, Dec 10, 2014 at 4:00 PM, Nathaniel Smith wrote: > 2) Add a broadcast_to(arr, shape) function, which broadcasts the array > to exactly the shape given, or else errors out if this is not > possible. > I like np.broadcast_to as a new function. We can document it alongside broadcast and broa

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Sturla Molden
Chris Barker wrote: > I haven't managed to trigger a segfault yet but it sure looks like I > could... You can also trigger random errors. If the array is small, Python's memory mamager might keep the memory in the heap for reuse by PyMem_Malloc. And then you can actually modify some random Pytho

Re: [Numpy-discussion] Add a function to broadcast arrays to a given shape to numpy's stride_tricks?

2014-12-10 Thread Nathaniel Smith
On Sun, Dec 7, 2014 at 7:10 AM, Stephan Hoyer wrote: > I recently wrote function to manually broadcast an ndarray to a given shape > according to numpy's broadcasting rules (using strides): > https://github.com/xray/xray/commit/7aee4a3ed2dfd3b9aff7f3c5c6c68d51df2e3ff3 > > The same functionality ca

Re: [Numpy-discussion] Question about dtype

2014-12-10 Thread Nathaniel Smith
On Wed, Dec 10, 2014 at 8:26 PM, Valentin Haenel wrote: > Hi, > > I am using numpy version 1.9.0 and Python 2.7.9 and have a question > about the dtype: > > In [14]: np.dtype(" Out[14]: dtype('float64') > > In [15]: np.dtype(u" Out[15]: dtype('float64') > > In [16]: np.dtype([(" Out[16]: dtype([('

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Nathaniel Smith
On Wed, Dec 10, 2014 at 9:03 PM, Chris Barker wrote: > On Wed, Dec 10, 2014 at 11:44 AM, Andrea Gavana > wrote: >> >> The argument is not check_refs, but refcheck. > > thanks -- yup, that works. > > Useful -- but dangerous! > > I haven't managed to trigger a segfault yet but it sure looks like I

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Chris Barker
On Wed, Dec 10, 2014 at 11:44 AM, Andrea Gavana wrote: > The argument is not check_refs, but refcheck. > thanks -- yup, that works. Useful -- but dangerous! I haven't managed to trigger a segfault yet but it sure looks like I could... -CHB -- Christopher Barker, Ph.D. Oceanographer Eme

Re: [Numpy-discussion] help using np.correlate to produce correlograms.

2014-12-10 Thread Jose Guzman
Dear Pierre, thank you very much for your time to correct my notebook and to point me in the direction of my wrong lag estimation. It has been very useful! Best Jose On 09/12/14 17:23, Pierre Haessig wrote: > Hi, > > Le 08/12/2014 22:02, Jose Guzman a écrit : >> I'm trying to compute the cross

[Numpy-discussion] Question about dtype

2014-12-10 Thread Valentin Haenel
Hi, I am using numpy version 1.9.0 and Python 2.7.9 and have a question about the dtype: In [14]: np.dtype(" in () > 1 np.dtype([(u" in () > 1 np.dtype([["http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Andrea Gavana
On 10 December 2014 at 20:36, Chris Barker wrote: > On Tue, Dec 9, 2014 at 11:03 PM, Sturla Molden > wrote: > >> Nathaniel Smith wrote: >> >> > @contextmanager >> > def tmp_zeros(*args, **kwargs): >> > arr = np.zeros(*args, **kwargs) >> > try: >> > yield arr >> > finally: >>

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Eric Moore
The second argument is named `refcheck` rather than check_refs. Eric On Wed, Dec 10, 2014 at 2:36 PM, Chris Barker wrote: > On Tue, Dec 9, 2014 at 11:03 PM, Sturla Molden > wrote: > >> Nathaniel Smith wrote: >> >> > @contextmanager >> > def tmp_zeros(*args, **kwargs): >> > arr = np.zeros(

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Chris Barker
On Tue, Dec 9, 2014 at 11:03 PM, Sturla Molden wrote: > Nathaniel Smith wrote: > > > @contextmanager > > def tmp_zeros(*args, **kwargs): > > arr = np.zeros(*args, **kwargs) > > try: > > yield arr > > finally: > > arr.resize((0,), check_refs=False) > > That one is inte

[Numpy-discussion] Fwd: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition

2014-12-10 Thread Nathaniel Smith
-- Forwarded message -- From: "Bruno Cauet" Date: 10 Dec 2014 17:07 Subject: [Python-Dev] Python 2.x and 3.x use survey, 2014 edition To: , Cc: "Dan Stromberg" Hi all, Last year a survey was conducted on python 2 and 3 usage. Here is the 2014 edition, slightly updated (from 9 to

Re: [Numpy-discussion] Should ndarray be a context manager?

2014-12-10 Thread Sebastian Berg
On Mi, 2014-12-10 at 07:25 +, Sturla Molden wrote: > Nathaniel Smith wrote: > > > This should be pretty trivial to implement. AFAICT you don't need any > > complicated cython > > I have a bad habit of thinking in terms of too complicated C instead of > just using NumPy. > > > > @contextman

Re: [Numpy-discussion] Add a function to broadcast arrays to a given shape to numpy's stride_tricks?

2014-12-10 Thread Stephan Hoyer
On Sun, Dec 7, 2014 at 11:31 PM, Pierre Haessig wrote: > Instead of putting this function in stride_tricks (which is quite > hidden), could it be added instead as a boolean flag to the existing > `reshape` method ? Something like: > > x.reshape(y.shape, broadcast=True) > > What other people think