Re: [Numpy-discussion] dot and MKL memory

2015-02-27 Thread Mads Ipsen
On 27/02/15 17:50, Charles R Harris wrote: > > > On Fri, Feb 27, 2015 at 9:02 AM, Mads Ipsen <mailto:mads.ip...@gmail.com>> wrote: > > Hi, > > If I build Python 2.7.2 and numpy-1.9.1 and run the following script > > import numpy >

[Numpy-discussion] dot and MKL memory

2015-02-27 Thread Mads Ipsen
nd run the script, the evaluation of the 'dot' increases the memory by app. 450 MB. Is the expected? Best regards, Mads specs: Ubuntu 12.04 ifort (IFORT) 14.0.1 2013100 gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) -- +---

Re: [Numpy-discussion] Detect if array has been transposed

2014-10-13 Thread Mads Ipsen
On 13/10/14 01:18, Nathaniel Smith wrote: > On Mon, Oct 13, 2014 at 12:07 AM, Pauli Virtanen wrote: >> 12.10.2014, 22:16, Eric Firing kirjoitti: >>> On 2014/10/12, 8:29 AM, Pauli Virtanen wrote: >>>> 12.10.2014, 20:19, Mads Ipsen kirjoitti: >>>>> Is

[Numpy-discussion] Detect if array has been transposed

2014-10-12 Thread Mads Ipsen
has been invoked on the matrix, and thereby only do the copy operation when it really is needed? For example if a_has_transposed_data: foo(a.copy()) else: foo(a) Best regards, Mads -- +-+ | Mads

Re: [Numpy-discussion] Tracking and inspecting numpy objects

2014-09-15 Thread Mads Ipsen
f isinstance(o, T)] > > In [18]: objs > Out[18]: [()] > > In [19]: a = 123. > > In [20]: objs = [o for o in gc.get_objects() if isinstance(o, float)] > > In [21]: objs > Out[21]: [] > > So I guess nothing is tracked, unless it con

[Numpy-discussion] Tracking and inspecting numpy objects

2014-09-15 Thread Mads Ipsen
advance. Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | phone: +45-29716388 | | DK-2500 Valby

Re: [Numpy-discussion] Accessing irregular sized array data from C

2014-07-02 Thread Mads Ipsen
On 02/07/14 12:46, Julian Taylor wrote: > On Wed, Jul 2, 2014 at 12:15 PM, Mads Ipsen wrote: >> Hi, >> >> If you setup an M x N array like this >> >> a = 1.0*numpy.arange(24).reshape(8,3) >> >> you can access the data from a C function l

[Numpy-discussion] Accessing irregular sized array data from C

2014-07-02 Thread Mads Ipsen
= numpy.array([a1,a2,a3]) How can open up the doors to the array data of b on the C-side? Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej

Re: [Numpy-discussion] Fast decrementation of indices

2014-02-03 Thread Mads Ipsen
5, 3, 4, 11, 0, 0, 1, 2, 3, 4, 5] > ]) > > a = [1,2,3,7,8] > > keepdata = np.ones(12, dtype=np.bool) > keepdata[a] = False > w = np.where(keepdata[b[0]] & keepdata[b[1]]) > newindex =

[Numpy-discussion] Fast decrementation of indices

2014-02-02 Thread Mads Ipsen
b = [[0, 0, 1, 1, 2, 2, 2, 3, 5, 6], [2, 3, 5, 2, 1, 6, 0, 0, 1, 2]] The Python for loop in (*) may easily contain 50.000 iteration. Is there a smart way to utilize numpy functionality to avoid this? Thanks and best regards, Mads -- +---

[Numpy-discussion] Porting to the new C-API (1.7)

2013-10-21 Thread Mads Ipsen
Is there a doc somewhere where this whole thing is explained in detail. I must admit, its somewhat hard to grasp what's going on. Best regards, Mads -- +----

Re: [Numpy-discussion] argsort

2013-01-16 Thread Mads Ipsen
towards the correct solution. Best regards, Mads On 01/15/2013 09:53 PM, eat wrote: Hi, On Tue, Jan 15, 2013 at 1:50 PM, Mads Ipsen <mailto:madsip...@gmail.com>> wrote: Hi, I simply can't understand this. I'm trying to use argsort to produce indices that can be us

[Numpy-discussion] argsort

2013-01-15 Thread Mads Ipsen
[[ 4 3] [11 6]] [[ 8 9] [23 7]] [[11 6] [ 8 9]] [[23 7] [ 1 12]]] I thought this should produce a sorted version of the indices array. Any help is appreciated. Best regards, Mads -- +-----+ |

Re: [Numpy-discussion] int and long issues

2013-01-10 Thread Mads Ipsen
Sebastian - thanks - very helpful. Best regards, Mads On 10/01/2013 12:06, Sebastian Berg wrote: > On Thu, 2013-01-10 at 11:32 +0100, Mads Ipsen wrote: >> Hi, >> >> I find this to be a little strange: >> >> x = numpy.arange(10) >> isinstance(

[Numpy-discussion] int and long issues

2013-01-10 Thread Mads Ipsen
ads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads

Re: [Numpy-discussion] Slices from an index list

2012-04-11 Thread Mads Ipsen
remember that.) ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion Thanks - very helpful! -- +----

Re: [Numpy-discussion] Slices from an index list

2012-04-11 Thread Mads Ipsen
On 11/04/2012 13:42, Warren Weckesser wrote: On Wed, Apr 11, 2012 at 4:28 AM, Mads Ipsen <mailto:madsip...@gmail.com>> wrote: Hi, Suppose a have an array of indices, say indices = [0,1,2,3,5,7,8,9,10,12,13,14] Then the following slices a = slice(0,4

[Numpy-discussion] Slices from an index list

2012-04-11 Thread Mads Ipsen
some nifty numpy function that can generate the above slices for me (or their start and stop values)? Best regards, Mads -- +-+ | Mads Ipsen

[Numpy-discussion] Minus zero

2012-03-16 Thread Mads Ipsen
, wouldn't '0.0' instead of '0.' be more readable (and there's certainly space enough to add it)? Best regards, Mads -- +-+ | Mads Ipsen | +---

Re: [Numpy-discussion] _import_array()

2012-02-14 Thread Mads Ipsen
On 14/02/2012 10:30, Pauli Virtanen wrote: > 14.02.2012 10:20, Mads Ipsen kirjoitti: > [clip] >> * Should import_array() only be called one time, namely when the main >> application is started? > It should be called once when the application is started, before you do &g

Re: [Numpy-discussion] _import_array()

2012-02-14 Thread Mads Ipsen
(i.e. PyArray_DIMS and PyArray_DATA could become functions that are looked up in an API-table that must be loaded by import_array() ). Best regards, -Travis On Feb 14, 2012, at 3:03 AM, Mads Ipsen wrote: Hi, I have C++ module (OpenGL) that extracts data from numpy arrays. The interface is

[Numpy-discussion] _import_array()

2012-02-14 Thread Mads Ipsen
ally nasty? Best regards, Mads -- +-----+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark

Re: [Numpy-discussion] Unexpected reorganization of internal data

2012-02-02 Thread Mads Ipsen
oiding copies when it can, for instance -- this give efficiency and flexibility, but you do need to be careful, particularly when interfacing with the binary data directly. -Chris Thanks for all the answers to my question. Helped a lot. Mads -- +--

[Numpy-discussion] Unexpected reorganization of internal data

2012-01-31 Thread Mads Ipsen
= numpy.array(U.transpose()).transpose() and call the C++ routine, everything is perfectly fine, ie. the data structure is as expected. What went wrong? Best regards, Mads -- +--

Re: [Numpy-discussion] Index update

2012-01-10 Thread Mads Ipsen
Thanks - very cool! On 10/01/2012 21:45, Val Kalatsky wrote: A - np.digitize(A, S) Should do the trick, just make sure that S is sorted and A and S do not overlap, if they do remove those items from A using set operations. Val On Tue, Jan 10, 2012 at 2:14 PM, Mads Ipsen <mailto:mad

[Numpy-discussion] Index update

2012-01-10 Thread Mads Ipsen
-- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com

[Numpy-discussion] Warning related to __multiarray_api.h

2011-12-09 Thread Mads Ipsen
Hi, I don't know if this is of importance, but when I compile code using the numpy C API, I get the warning: site-packages/numpy/core/include/numpy/__multiarray_api.h:1532: warning: 'int _import_array()' defined but not used Might be worth cleaning it up. Best regards, Mads __

[Numpy-discussion] dtype

2011-11-28 Thread Mads Ipsen
ards Mads -- +-----+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email

[Numpy-discussion] Build warnings

2011-11-20 Thread Mads Ipsen
-- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip

Re: [Numpy-discussion] Failure to build numpy 1.6.1

2011-11-08 Thread Mads Ipsen
On 11/08/2011 12:14 PM, David Cournapeau wrote: On Tue, Nov 8, 2011 at 9:20 AM, Mads Ipsen wrote: Yup, that fixes it. For now, we can apply a temporary fix on our build system. Is this something that'll go into, say, 1.6.2? That's more of a workaround than a fix. We need to decide

Re: [Numpy-discussion] Failure to build numpy 1.6.1

2011-11-08 Thread Mads Ipsen
On 11/08/2011 10:01 AM, David Cournapeau wrote: Hi Mads, On Tue, Nov 8, 2011 at 8:40 AM, Mads Ipsen wrote: Hi, I am trying to build numpy-1.6.1 with the following gcc compiler specs: Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr

[Numpy-discussion] Failure to build numpy 1.6.1

2011-11-08 Thread Mads Ipsen
l/quantumsource/external-libs/src/numpy-1.6.1/make-stamp] Error 1 -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | |

Re: [Numpy-discussion] Tuple outer product?

2009-09-26 Thread Mads Ipsen
Robert Kern wrote: > On Fri, Sep 25, 2009 at 17:38, Mads Ipsen wrote: > >> Yes, but it should also work for [2.1,3.2,4.5] combined with >> [4.6,-2.3,5.6] - forgot to tell that. >> > > In [5]: np.transpose(np.meshgrid([2.1,3.2,4.5], [4.6,-2.3,5.6])) &

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Alan G Isaac wrote: > On 9/25/2009 4:01 PM, Mads Ipsen wrote: > >> a = numpy.array([1,2,3]) >> b = numpy.array([4,5,6]) >> >> (n,m) = (a.shape[0],b.shape[0]) >> a = numpy.repeat(a,m).reshape(n,m) >> b = numpy.repeat(b,n).reshape(m,n).transpose() >>

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
]) a = numpy.repeat(a,m).reshape(n,m) b = numpy.repeat(b,n).reshape(m,n).transpose() ab = numpy.dstack((a,b)) print ab.tolist() [[[1, 4], [1, 5], [1, 6]], [[2, 4], [2, 5], [2, 6]], [[3, 4], [3, 5], [3, 6]]] -- ++ | Mads Ipsen, Scientific developer | +

Re: [Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Gökhan Sever wrote: > > > On Fri, Sep 25, 2009 at 12:45 PM, Mads Ipsen <mailto:m...@comxnet.dk>> wrote: > > Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], > that > will yield: > > [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,

[Numpy-discussion] Tuple outer product?

2009-09-25 Thread Mads Ipsen
Is there a numpy operation on two arrays, say [1,2,3] and [4,5,6], that will yield: [[(1,4),(1,5),(1,6)],[(2,4),(2,5),(2,6)],[(3,4),(3,5),(3,6)]] Any suggestions are most welcome. Mads -- ++ | Mads Ipsen, Scientific developer

Re: [Numpy-discussion] Error in header file - wrong mailing list?

2009-09-14 Thread Mads Ipsen
current SVN, because apparently the configuration > detection code is not strict C89. > > Well, I don't know you consider this as a valid argument, but to me its a matter of removing a single comma, which will make the source les

[Numpy-discussion] Error in header file - wrong mailing list?

2009-09-12 Thread Mads Ipsen
Hey, I recently posted a bug related to a compile error in the header file 'npy_common.h' but have received no responses so far. Am I posting this in the wrong mailing list? Best regards, Mads -- +----+ | Mads Ipsen,

[Numpy-discussion] error: comma at end of enumerator list

2009-09-10 Thread Mads Ipsen
4.3.2-1ubuntu12) Ubuntu 8.10 Best regards, Mads -- ++ | Mads Ipsen, Scientific developer | +--+-+ | QuantumWise A/S | phone: +45