Re: [Numpy-discussion] How to use user input as equation directly

2016-10-27 Thread John Ladasky
k you in > advance for your help. > > > > -- > View this message in context: http://numpy-discussion.10968. > n7.nabble.com/How-to-use-user-input-as-equation-directly-tp43665.html > Sent from the Numpy-discussion mailing list archive at Nabble.com. > ____

Re: [Numpy-discussion] Numpy set_printoptions, silent failure, bug?

2016-07-19 Thread John Ladasky
Thank you Juan, I've just joined GitHub and I've submitted the description of the bug. On Tue, Jul 19, 2016 at 2:55 PM, Juan Nunez-Iglesias wrote: > https://github.com/numpy/numpy/issues > > > From: John Ladasky > Reply: Discussion of Numerical Python > > D

Re: [Numpy-discussion] Numpy set_printoptions, silent failure, bug?

2016-07-19 Thread John Ladasky
Hi Robert, Thanks for your reply. If no one disagrees with you or with me that this is a Numpy bug, I would appreciate being directed to the appropriate page to submit a bug-fix request. On Tue, Jul 19, 2016 at 2:43 PM, Robert Kern wrote: > On Tue, Jul 19, 2016 at 10:41 PM, John Lada

[Numpy-discussion] Numpy set_printoptions, silent failure, bug?

2016-07-19 Thread John Ladasky
rint a numpy array is remote from the problem, and thus rather uninformative, which is why I did not immediately diagnose my error. Should this be considered a Numpy bug, or is there some reason that set_printoptions would legitimately need to accept a dictionary

Re: [Numpy-discussion] ENH: Add the function 'expand_view'

2016-01-07 Thread John Kirkham
First, off sorry for the long turnaround on responding to these questions. Below I have tried to respond to everyone's questions and comments. I have restructured the order of the messages so that my responses are a little more structured. If anybody has more thoughts or questions, please let me kn

[Numpy-discussion] ENH: Add the function 'expand_view'

2015-11-24 Thread John Kirkham
Takes an array and tacks on arbitrary dimensions on either side, which is returned as a view always. Here are the relevant features: * Creates a view of the array that has the dimensions before and after tacked on to it. * Takes the before and after arguments independent of each other and the c

Re: [Numpy-discussion] Fix masked arrays to properly edit views

2015-04-04 Thread John Kirkham
Hey Eric, That's a good point. I remember seeing this behavior before and thought it was a bit odd. Best, John > On Mar 16, 2015, at 2:20 AM, numpy-discussion-requ...@scipy.org wrote: > > Send NumPy-Discussion mailing list submissions to >numpy-discussion@scipy.org >

[Numpy-discussion] Fix masked arrays to properly edit views

2015-03-14 Thread John Kirkham
The sample case of the issue ( https://github.com/numpy/numpy/issues/5558 ) is shown below. A proposal to address this behavior can be found here ( https://github.com/numpy/numpy/pull/5580 ). Please give me your feedback. I tried to change the mask of `a` through a subindexed view, but was unab

Re: [Numpy-discussion] Numpy where

2015-03-13 Thread John Kirkham
uld rather have a breaking change in the ma module than in core. Best, John >> > I think the question is if scalars should be acceptable for the first >> > argument, not if it should be for the 2nd and 3rd argument. >> > >> > If scalar can be given for

Re: [Numpy-discussion] Best way to expose std::vector to be used with numpy

2014-10-14 Thread John Zwinck
on, maybe you will find the implementation instructive. The functions I described take only a few lines. John Zwinck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread John Zwinck
ly unusual), why force them to always type in the boilerplate independent=True to make it work? John Zwinck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-11 Thread John Zwinck
"independent" has no relevance when the array is 1-d, it can simply be ignored. John Zwinck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Round away from zero (towards +/- infinity)

2014-10-02 Thread John Zwinck
On 3 Oct 2014 07:09, "T J" wrote: > > Any bites on this? > > On Wed, Sep 24, 2014 at 12:23 PM, T J wrote: >> Python's round function goes away from zero, so I am looking for the NumPy equivalent (and using vectorize() seems undesirable). In this sense, it seems that having a ufunc for this type o

Re: [Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-10-02 Thread John Zwinck
On Thu, Oct 2, 2014 at 6:27 PM, Sebastian Wagner wrote: > So, for non-structured arrays, the consens is an Exception. The question > is, which one. > AttributeError would be fully backwards compatible. Existing code checks > for the method and if it exists, the object has fields. > ValueError woul

Re: [Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-10-01 Thread John Zwinck
On 1 Oct 2014 04:30, "Stephan Hoyer" wrote: > > On Tue, Sep 30, 2014 at 1:22 PM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: >> >> On more careful reading of your words, I think we agree; indeed, if keys() is present is should return an iterable; but I don't think it should be present

[Numpy-discussion] Proposal: add ndarray.keys() to return dtype.names

2014-09-30 Thread John Zwinck
this is exactly what I'm aiming at. Thoughts? John Zwinck ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] Building numpy with OpenMP support

2014-09-24 Thread John
I am in the process of trying to build numpy with OpenMP support but have had several issues. Has anyone else built it with success that could offer some guidance in what needs to be passed at build time. For reference I am using Atlas 3.10.2 built with OpenMP as well (-F alg -fopenmp) Thanks, J

[Numpy-discussion] How to get docs for functions processed by numpy.vectorize?

2014-09-11 Thread John Haiducek
When I apply numpy.vectorize() to a function, documentation tools behave inconsistently with regard to the new, vectorized function. The function's __doc__ attribute does contain the docstring of the original function as expected, but the built-in help() command displays the documentation of th

[Numpy-discussion] numpy.vectorize docstrings not shown by help command

2014-09-05 Thread John Haiducek
When I apply numpy.vectorize() to a function, documentation tools behave inconsistently with regard to the new, vectorized function. The function's __doc__ attribute does contain the docstring of the original function as expected, but the built-in help() command displays the documentation of the

Re: [Numpy-discussion] Changing the numpy array into required shape

2014-08-23 Thread John Ladasky
On 08/22/2014 11:14 PM, Cleo Drakos wrote: > > How can I convert this numpy array so that its first element belongs > to (49.875N,179.625W), i.e., upper left latitude and longitude > respectively; and the last element belong to (49.625S,179.875E), i.e., > lower right latitute and longitude respe

Re: [Numpy-discussion] Second order gradient in numpy

2014-05-02 Thread John Mark Agosta
Shawn (Yuxiang) - The right way to compute this is using Runga-Kutta approximations. I'm not aware if numpy supports these. -jm __ John Mark Agosta 650 465-4707 johnmark.ago...@gmail.com *"Unpredictable consequences are the most expected thin

[Numpy-discussion] switching from Numeric to numpy

2013-10-07 Thread john fernando
I have the following C code which is an extension to my python code. The python and C code use #include what is the equivalent I can use in numpy that causes the minimum code change? I did look through the old messages but didn't really find the answer-any help to a novice just starting out i

[Numpy-discussion] NumPy 1.7.0 w/ MKL available on PiCloud

2013-04-17 Thread John Riley
www.picloud.com [2] http://docs.picloud.com/**environment.html<http://docs.picloud.com/environment.html> [3] http://docs.picloud.com/howto/pyscientifictools.html [4] http://docs.picloud.com/howto/primer.html Best Regards, John -- John Riley PiCloud, Inc. _

Re: [Numpy-discussion] how to uninstall numpy

2012-08-07 Thread John Mark Agosta
Here's a good article on the vagaries of python paths when installing a new python. Thus you can check exactly how python finds its modules, to assure the new install is working properly: https://www.usenix.org/publications/login/august-2012-volume-37-number-4/import John Mark Agosta

Re: [Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-07-06 Thread John Salvatier
((5,5)) > x[[0,2,4]]+=numpy.random.rand(3,5) > print x > > This won't work if in the list [0,2,4], there is index duplication, > but with your new code, it will. I think it is the most used case of > advanced indexing. At least, for our lab:) > > Fred > > On Mon, Jul 2,

Re: [Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-07-02 Thread John Salvatier
Hi Fred, That's an excellent idea, but I am not too familiar with this use case. What do you mean by list in 'matrix[list]'? Is the use case, just incrementing in place a sub matrix of a numpy matrix? John On Fri, Jun 29, 2012 at 11:43 AM, Frédéric Bastien wrote: > Hi, >

Re: [Numpy-discussion] Meta: help, devel and stackoverflow

2012-06-30 Thread John Hunter
On Fri, Jun 29, 2012 at 2:20 PM, Jim Vickroy wrote: > As a lurker and user, I too wish for a distinct numpy-users list. -- jv > > This thread is a perfect example of why another list is needed. It's currently 42 semi-philosophical posts about what kind community numpy should be and what kinds o

Re: [Numpy-discussion] Dropping support for Python 2.4 in NumPy 1.8

2012-06-28 Thread John Hunter
On Thu, Jun 28, 2012 at 7:25 AM, Travis Oliphant wrote: > Hey all, > > I'd like to propose dropping support for Python 2.4 in NumPy 1.8 (not the 1.7 > release).      What does everyone think of that? As a tangential point, MPL is dropping support for python2.4 in it's next major release. As su

Re: [Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-06-27 Thread John Salvatier
larifying. > > -Travis > > > > > Fred > > > > On Tue, Jun 26, 2012 at 1:27 PM, John Salvatier > > wrote: > >> Can you clarify why it would be super hard? I just reused the code for > >> advanced indexing (a modification of PyArray_SetMap). Am

Re: [Numpy-discussion] What's the most numpythonic way to support multiple types in a C extension?

2012-06-27 Thread John Salvatier
Thanks nathaniel, that does tricky... On Wed, Jun 27, 2012 at 9:25 AM, Nathaniel Smith wrote: > On Tue, Jun 26, 2012 at 10:53 PM, John Salvatier > wrote: > > I want to support multiple types in the index_increment function that > I've > > written here: > > >

Re: [Numpy-discussion] NumPy 1.7 release delays

2012-06-27 Thread John Hunter
> Some examples would be nice. A lot of people did move already. And I haven't > seen reports of those that tried and got stuck. Also, Debian and Python(x, > y) have 1.6.2, EPD has 1.6.1. In my company, the numpy for our production python install is well behind 1.6. In the world of trading, the u

[Numpy-discussion] What's the most numpythonic way to support multiple types in a C extension?

2012-06-26 Thread John Salvatier
and do the addition operation for that type. It looks like some of the numpy code uses .c.src files to do templating. Is that what I want to do here? Is the syntax described somewhere? John ___ NumPy-Discussion mailing list NumPy-Discussion@scip

Re: [Numpy-discussion] Created NumPy 1.7.x branch

2012-06-26 Thread John Hunter
On Tue, Jun 26, 2012 at 3:27 PM, Thouis (Ray) Jones wrote: > +1 ! > > Speaking as someone trying to get started in contributing to numpy, I > find this discussion extremely off-putting.  It's childish, > meaningless, and spiteful, and I think it's doing more harm than any > possible good that coul

Re: [Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-06-26 Thread John Salvatier
ted as you said. > > Fred > > On Tue, Jun 26, 2012 at 1:27 PM, John Salvatier > wrote: > > Can you clarify why it would be super hard? I just reused the code for > > advanced indexing (a modification of PyArray_SetMap). Am I missing > something > > crucial? > > >

Re: [Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-06-26 Thread John Salvatier
Can you clarify why it would be super hard? I just reused the code for advanced indexing (a modification of PyArray_SetMap). Am I missing something crucial? On Tue, Jun 26, 2012 at 9:57 AM, Travis Oliphant wrote: > > On Jun 26, 2012, at 11:46 AM, John Salvatier wrote: > > Hello

[Numpy-discussion] Would a patch with a function for incrementing an array with advanced indexing be accepted?

2012-06-26 Thread John Salvatier
6.7.] [ 8.9. 40. 11.]] """ Cheers, John ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] PyArray_MapIter{Reset, Next, New, Bind} not exposed?

2012-06-20 Thread John Salvatier
easy way to gain access to these functions? Should I give up on this approach? (The function I was trying to build is index_inc in here ( https://github.com/jsalvatier/advinc/blob/master/advinc/advinc.c)) Cheers, John ___ NumPy-Discussion mailing list

Re: [Numpy-discussion] Incrementing with advanced indexing: why don't repeated indexes repeatedly increment?

2012-06-06 Thread John Salvatier
That does seem like it should work well if len(unique(idx)) is close to len(x). Thanks! On Wed, Jun 6, 2012 at 9:35 AM, Robert Kern wrote: > On Wed, Jun 6, 2012 at 4:52 PM, Robert Cimrman > wrote: > > > Yes (in that thread), but it applies also adding/assembling vectors into > a > > global vect

Re: [Numpy-discussion] Incrementing with advanced indexing: why don't repeated indexes repeatedly increment?

2012-06-06 Thread John Salvatier
py.put.html > > On Wed, Jun 6, 2012 at 4:48 AM, John Salvatier > wrote: > > Hello, > > > > I've noticed that If you try to increment elements of an array with > advanced > > indexing, repeated indexes don't get repeatedly incremented. For example: >

[Numpy-discussion] Incrementing with advanced indexing: why don't repeated indexes repeatedly increment?

2012-06-06 Thread John Salvatier
Hello, I've noticed that If you try to increment elements of an array with advanced indexing, repeated indexes don't get repeatedly incremented. For example: In [30]: x = zeros(5) In [31]: idx = array([1,1,1,3,4]) In [32]: x[idx] += [2,4,8,10,30] In [33]: x Out[33]: array([ 0., 8., 0., 1

Re: [Numpy-discussion] Issue with numpy.random.multivariate_normal Linux RHEL4 np version: 1.6.1

2012-05-12 Thread John Gleeson
On 2012-05-11, at 4:01 PM, Norman Shelley wrote: > Running on Linux RHEL4 > > numpy.random.multivariate_normal seems to work well for 25 mean > values but when I go to 26 mean values (and their corresponding > covariance values) it produces garbage. > Any ideas? The implementation of multiv

Re: [Numpy-discussion] f2py with int8

2012-04-17 Thread John Mitchell
really like to know why and your answer alludes to that. Please excuse my ignorance on this topic. Can you perhaps educate me a little on 'literal kind values'? I take you to mean that 'int8' is not a literal kind value while 1 and 8 are examples of literal kind values. Thanks,

Re: [Numpy-discussion] f2py with int8

2012-04-17 Thread John Mitchell
Thanks Sameer. I confirmed on my side as well. I will try to understand the why part now. Much appreciated. On Mon, Apr 16, 2012 at 11:58 PM, Sameer Grover wrote: > On Tuesday 17 April 2012 11:02 AM, John Mitchell wrote: > > Hi, > > I am using f2py to pass a numpy array of typ

[Numpy-discussion] f2py with int8

2012-04-16 Thread John Mitchell
on bits = 100000001 0 Any Ideas? thanks, John ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] all elements equal

2012-03-05 Thread John Hunter
On Mon, Mar 5, 2012 at 1:29 PM, Keith Goodman wrote: > > I[8] np.allclose(a, a[0]) > O[8] False > I[9] a = np.ones(10) > I[10] np.allclose(a, a[0]) > O[10] True > > One disadvantage of using a[0] as a proxy is that the result depends on the ordering of a (a.max() - a.min()) < epsilon is a

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-29 Thread John Hunter
On Wed, Feb 29, 2012 at 1:20 PM, Neal Becker wrote: > > Much of Linus's complaints have to do with the use of c++ in the _kernel_. > These objections are quite different for an _application_. For example, > there > are issues with the need for support libraries for exception handling. > Not an

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-28 Thread John Hunter
On Sat, Feb 18, 2012 at 5:09 PM, David Cournapeau wrote: > > There are better languages than C++ that has most of the technical > benefits stated in this discussion (rust and D being the most > "obvious" ones), but whose usage is unrealistic today for various > reasons: knowledge, availability on

Re: [Numpy-discussion] Problem Building Numpy with Python 2.7.1 and OS X 10.7.3

2012-02-26 Thread Samuel John
Hi The plain gcc (non-llvm) is no longer there, if you install Lion and directly Xcode 4.3. Only, if you have the old Xcode 4.2 or lower, then you may have a non-llvm gcc. For Xcode 4.3, I recommend installing the "Command Line Tools for Xcode" from the preferences of Xcode. Then you'll have th

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-20 Thread Samuel John
On 17.02.2012, at 21:46, Ralf Gommers wrote: > [...] > So far no one has managed to build the numpy/scipy combo with the LLVM-based > compilers, so if you were willing to have a go at fixing that it would be > hugely appreciated. See http://projects.scipy.org/scipy/ticket/1500 for > details. >

Re: [Numpy-discussion] Numpy governance update

2012-02-16 Thread John Hunter
On Thu, Feb 16, 2012 at 7:26 PM, Alan G Isaac wrote: > On 2/16/2012 7:22 PM, Matthew Brett wrote: > > This has not been an encouraging episode in striving for consensus. > > I disagree. > Failure to reach consensus does not imply lack of striving. > > Hey Alan, thanks for your thoughtful and nuan

Re: [Numpy-discussion] repeat array along new axis without making a copy

2012-02-15 Thread Samuel John
Wow, I wasn't aware of that even if I work with numpy for years now. NumPy is amazing. Samuel ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] just the date part of a datetime64[s]?

2012-02-09 Thread John Salvatier
Thanks Mark! John On Wed, Feb 8, 2012 at 6:48 PM, Mark Wiebe wrote: > Converting between date and datetime requires caution, because it depends > on your time zone. Because all datetime64's are internally stored in UTC, > simply casting as in your example treats it in UT

[Numpy-discussion] just the date part of a datetime64[s]?

2012-02-08 Thread John Salvatier
Hello, is there a good way to get just the date part of a datetime64? Frequently datetime datatypes have month(), date(), hour(), etc functions that pull out part of the datetime, but I didn't see those mentioned in the datetime64 docs. Casting to a 'D' dtype didn't work as I would have hoped: In

Re: [Numpy-discussion] datetime64 format parameter?

2012-02-06 Thread John Salvatier
That makes sense. I figured that ambiguity was the reason it was removed. Thank you for the explanation. I'm a big fan of your work. John On Mon, Feb 6, 2012 at 1:18 PM, Mark Wiebe wrote: > Hey John, > > NumPy doesn't provide this, because it's

[Numpy-discussion] datetime64 format parameter?

2012-02-06 Thread John Salvatier
Hello, Is there a way to specify a format for the datetime64 constructor? The constructor doesn't have a doc. I have dates in a file with the format "MM/dd/YY". datetime64 used to be able to parse these in 1.6.1 but the dev version throws an error

Re: [Numpy-discussion] I must be wrong? -- endian detection failure on Mac OSX 10.5

2012-02-01 Thread Samuel John
Hi! Your Machine should be able to handle at least Mac OS X10.6 and even 10.7. If there is not a strong reason to remain on 10.5... 10.5 is so long ago, I can barely remember. cheers, Samuel On 01.02.2012, at 18:03, Dustin Lang wrote: > > Hi, > > I don't really believe this is a numpy bug t

Re: [Numpy-discussion] histogram help

2012-01-30 Thread Samuel John
Hi Ruby, I still do not fully understand your question but what I do in such cases is to construct a very simple array and test the functions. The help of numpy.histogram2d or numpy.histogramdd (for more than two dims) might help here. So I guess, basically you want to ignore the x,y positions

Re: [Numpy-discussion] Problem installing NumPy with Python 3.2.2/MacOS X 10.7.2

2012-01-26 Thread Samuel John
Hi Hans-Martin! You could try my instructions recently posted to this list http://thread.gmane.org/gmane.comp.python.scientific.devel/15956/ Basically, using llvm-gcc scipy segfaults when scipy.test() (on my system at least). Therefore, I created the homebrew install formula. They work for wha

Re: [Numpy-discussion] OT: MS C++ AMP library

2012-01-26 Thread Samuel John
Yes, I agree 100%. On 26.01.2012, at 10:19, Sturla Molden wrote: > When we have nice libraries like OpenCL, OpenGL and OpenMP, I am so glad > we have Microsoft to screw it up. > > Congratulations to Redmond: Another C++ API I cannot read, and a > scientific compute library I hopefully never hav

Re: [Numpy-discussion] installing matplotlib in MacOs 10.6.8.

2012-01-24 Thread Samuel John
Sorry for the late answer. But at least for the record: If you are using eclipse, I assume you have also installed the eclipse plugin [pydev](http://pydev.org/). Is use it myself, it's good. Then you have to go to the preferences->pydev->PythonInterpreter and select the python version you want

Re: [Numpy-discussion] 'Advanced' save and restore operation

2012-01-24 Thread Samuel John
I know you wrote that you want "TEXT" files, but never-the-less, I'd like to point to http://code.google.com/p/h5py/ . There are viewers for hdf5 and it is stable and widely used. Samuel On 24.01.2012, at 00:26, Emmanuel Mayssat wrote: > After having saved data, I need to know/remember the da

Re: [Numpy-discussion] Unexpected behavior with np.min_scalar_type

2012-01-24 Thread Samuel John
I get the same results as you, Kathy. *surprised* (On OS X (Lion), 64 bit, numpy 2.0.0.dev-55472ca, Python 2.7.2. On 24.01.2012, at 16:29, Kathleen M Tacina wrote: > I was experimenting with np.min_scalar_type to make sure it worked as > expected, and found some unexpected results for integers

Re: [Numpy-discussion] advanced indexing bug with huge arrays?

2012-01-24 Thread Samuel John
On 23.01.2012, at 11:23, David Warde-Farley wrote: >> a = numpy.array(numpy.random.randint(256,size=(500,972)),dtype='uint8') >> b = numpy.random.randint(500,size=(4993210,)) >> c = a[b] >> In [14]: c[100:].sum() >> Out[14]: 0 Same here. Python 2.7.2, 64bit, Mac OS X (Lion), 8GB RAM,

Re: [Numpy-discussion] The NumPy Mandelbrot code 16x slower than Fortran

2012-01-23 Thread Samuel John
I'd like to add http://git.tiker.net/pyopencl.git/blob/HEAD:/examples/demo_mandelbrot.py to the discussion, since I use pyopencl (http://mathema.tician.de/software/pyopencl) with great success in my daily scientific computing. Install with pip. PyOpenCL does understand numpy arrays. You write

Re: [Numpy-discussion] Cross-covariance function

2012-01-21 Thread John Salvatier
I ran into this a while ago and was confused why cov did not behave the way pierre suggested. On Jan 21, 2012 12:48 PM, "Elliot Saba" wrote: > Thank you Sturla, that's exactly what I want. > > I'm sorry that I was not able to reply for so long, but Pierre's code is > similar to what I have alread

Re: [Numpy-discussion] Ufuncs and flexible types, CAPI

2012-01-10 Thread Samuel John
[sorry for duplicate - I used the wrong mail address] I am afraid, I didn't quite get the question. What is the scenario? What is the benefit that would weight out the performance hit of checking whether there is a callback or not. This has to be evaluated quite a lot. Oh well ... and 1.3.0 is

Re: [Numpy-discussion] SParse feature vector generation

2012-01-10 Thread Samuel John
I would just use a lookup dict: names = [ "uc_berkeley", "stanford", "uiuc", "google", "intel", "texas_instruments", "bool"] lookup = dict( zip( range(len(names)), names ) ) Now, given you have n entries: S = numpy.zeros( (n, len(names)) ,dtype=numpy.int32) for k in ["uc_berkeley", "google",

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

2012-01-05 Thread John Salvatier
362, in build_msvcr_library generate_def(dll_file, def_file) File "C:\Users\jsalvatier\workspace\numpy\numpy\distutils\mingw32ccompiler.py", line 282, in generate_def raise ValueError("Symbol table not found") ValueError: Symbol table not found Thank you, John ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

[Numpy-discussion] nested_iters does not accept length zero nest (also doesn't have documentation)

2012-01-03 Thread John Salvatier
Hellow, while using the nested_iters function, I've noticed that it does not accept length zero nestings. For example, the following fails: nested_iters([ones(3),ones(3)], [[], [0]]) with "ValueError: If 'op_axes' or 'itershape' is not NULL in theiterator constructor, 'oa_ndim' must be greater th

[Numpy-discussion] Problem with changes to f2py

2011-12-29 Thread John Salvatier
e major changes to f2py in the last two years? I appreciate all clues on this issue. Thank you in advance, John ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] wanted: decent matplotlib alternative

2011-10-13 Thread John Hunter
On Thu, Oct 13, 2011 at 5:36 PM, Eric Firing wrote: >> It would be nice to have a social interface for the mpl gallery like the >> one similar to the R-gallery >> [http://www.r-bloggers.com/the-r-graph-gallery-goes-social/] > > I think that the priority should go towards massive pruning, > organi

Re: [Numpy-discussion] wanted: decent matplotlib alternative

2011-10-13 Thread John Salvatier
Thank you John, those are looking useful. On Thu, Oct 13, 2011 at 2:39 PM, John Hunter wrote: > > > > > On Oct 13, 2011, at 4:21 PM, Zachary Pincus > wrote: > > > I keep meaning to use matplotlib as well, but every time I try I also get > really turned off by

Re: [Numpy-discussion] wanted: decent matplotlib alternative

2011-10-13 Thread John Hunter
On Oct 13, 2011, at 4:21 PM, Zachary Pincus wrote: > I keep meaning to use matplotlib as well, but every time I try I also get > really turned off by the matlabish interface in the examples. I get that it's > a selling point for matlab refugees, but I find it counterintuitive in the > same

Re: [Numpy-discussion] wanted: decent matplotlib alternative

2011-10-13 Thread John Salvatier
I second that request. On Thu, Oct 13, 2011 at 2:21 PM, Zachary Pincus wrote: > I keep meaning to use matplotlib as well, but every time I try I also get > really turned off by the matlabish interface in the examples. I get that > it's a selling point for matlab refugees, but I find it counterint

Re: [Numpy-discussion] nditer: possible to manually handle dimensions with different lengths?

2011-10-06 Thread John Salvatier
im -1) oaxes.insert(axis, out.ndim-1) oaxes = oaxes[:-1] #remove the now reduced original given axis out = np.transpose(out, oaxes) return out On Mon, Oct 3, 2011 at 2:03 PM, John Salvatier wrote: > Some observations and questions about nested_iters. Nested_iters seems to > require that

Re: [Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Samuel John
I just learned two things: 1. np.newaxis 2. Array dimension broadcasting rocks more than you think. The x[:, np.newaxis] might not be the most intuitive solution but it's great and powerful. Intuitive would be to have x.T to transform [0,1,2,4] into [[0],[1],[2],[4]]. Thanks Warren :-) Samuel

Re: [Numpy-discussion] simple vector->matrix question

2011-10-06 Thread Samuel John
import numpy # Say y is y = numpy.array([1,2,3]) Y = numpy.vstack([y,y,y,y]) # Y is array([[1, 2, 3], # [1, 2, 3], # [1, 2, 3], # [1, 2, 3]]) x = numpy.array([[0],[2],[4],[6]]) # a column-vector of your scalars x0, x1... Y - x Hope this is what you meant. cheers, Sa

Re: [Numpy-discussion] nditer: possible to manually handle dimensions with different lengths?

2011-10-03 Thread John Salvatier
do a "grouped" calculation (the group specified by the group argument) on the values along the given axis. I try to use nested_iter to iterate over the specified axis and a new axis (the length of the number of groups) separately so I can do my calculation. On Mon, Oct 3, 2011 at 9:03 AM,

Re: [Numpy-discussion] nditer: possible to manually handle dimensions with different lengths?

2011-10-03 Thread John Salvatier
Thanks mark! I think that's exactly what I'm looking for. We even had a previous discussion about this (oops!) ( http://mail.scipy.org/pipermail/numpy-discussion/2011-January/054421.html). I didn't find any documentation, I will try to add some once I understand how it works better

Re: [Numpy-discussion] nditer: possible to manually handle dimensions with different lengths?

2011-10-01 Thread John Salvatier
nctions that operate on arrays and support broadcasting. Is clearer? On Fri, Sep 30, 2011 at 5:04 PM, Mark Wiebe wrote: > On Fri, Sep 30, 2011 at 8:03 AM, John Salvatier > wrote: > >> Using nditer, is it possible to manually handle dimensions with different >> lengths? >

[Numpy-discussion] nditer: possible to manually handle dimensions with different lengths?

2011-09-30 Thread John Salvatier
Using nditer, is it possible to manually handle dimensions with different lengths? For example, lets say I had an array A[5, 100] and I wanted to sample every 10 along the second axis so I would end up with an array B[5,10]. Is it possible to do this with nditer, handling the iteration over the s

Re: [Numpy-discussion] OS X Lion: llvm: numpy and scipy

2011-09-20 Thread Samuel John
Hi! On 20.09.2011, at 14:41, David Cournapeau wrote: > On Tue, Sep 20, 2011 at 5:13 AM, Samuel John wrote: >> Ralf, thanks for your answer. >> >> However, in short: >> >> I want `pip install numpy; pip install scipy` to work on OS X Lion without >> extr

Re: [Numpy-discussion] OS X Lion: llvm: numpy and scipy

2011-09-20 Thread Samuel John
Ralf, thanks for your answer. However, in short: I want `pip install numpy; pip install scipy` to work on OS X Lion without extra effort :-) On 19.09.2011, at 19:05, Ralf Gommers wrote: > Do you think it's possible to teach numpy to use different CC, CXX? > >> This is possible, but numpy pro

[Numpy-discussion] OS X Lion: llvm: numpy and scipy

2011-09-19 Thread Samuel John
Ahoy numpy gurus :-) Would it be possible to adapt the setup.py and/or numpy/distutils to set the right variables on Mac OS X 10.7? (see below). I have looked a bit into the setup.py and the distutils package of numpy but I am a bit lost. Do you think it's possible to teach numpy to use differe

Re: [Numpy-discussion] [ANN] glumpy 0.2.0

2011-09-16 Thread Samuel John
Hi Nicolas, that looks great. Could you make this available such that `pip install glumpy` would work? cheers, Samuel ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Functions for finding the relative extrema of numeric data

2011-09-15 Thread Samuel John
middle is returned. > > If there are two adjacent elements with the same value, > one of them is returned. > > x[0] and x[-1] are never returned as an index for the > local maximum. > > @Author: Samuel John > @copyright:

Re: [Numpy-discussion] numpy.test() failure

2011-09-14 Thread Samuel John
Hi Nils, which version of numpy, which os? I can infer that you use python 2.6 in 64bit, right? Right after the beginning of the numpy.test() are some crucial information. bests Samuel On 14.09.2011, at 22:09, Nils Wagner wrote: > ERROR: test_polyfit (test_polynomial.TestDocs) > -

Re: [Numpy-discussion] numpy blas running slow: how to check that it is properly linked

2011-09-07 Thread Samuel John
On 06.09.2011, at 22:13, David Cottrell wrote: > Thanks, I didn't realize dot was not just calling dgemm or some > variant which I assume would be reasonably fast. I see dgemm appears > in the numpy code in various places such as the lapack_lite module. > > I ran the svd test on the solaris setu

Re: [Numpy-discussion] segfault on complex array on solaris x86

2011-08-17 Thread John Hunter
On Wed, Apr 13, 2011 at 8:50 AM, John Hunter wrote: > On Sat, Jan 15, 2011 at 7:28 AM, Ralf Gommers > wrote: >> I've opened http://projects.scipy.org/numpy/ticket/1713 so this doesn't get >> lost. > > Just wanted to bump this -- bug still exists in numpy HEAD

Re: [Numpy-discussion] labeled axes

2011-05-26 Thread John Salvatier
I'm glad datarray is still active. :) On Thu, May 26, 2011 at 6:36 PM, Craig Yoshioka wrote: > Thanks, I will. I was just seeing if there was any intention of adding this > to type of support to numpy directly. It would be faster, and I'm sure it > would make projects like dataarray much simple

Re: [Numpy-discussion] Mapping of dtype to C types

2011-05-08 Thread John Salvatier
I want to add a question: is there a function that returns the name of the corresponding C type given the numpy type? On Sun, May 8, 2011 at 2:45 PM, Keith Goodman wrote: > I'm writing a function that accepts four possible dtypes: int32, > int64, float32, float64. The function will call a C exte

Re: [Numpy-discussion] segfault on complex array on solaris x86

2011-04-13 Thread John Hunter
On Sat, Jan 15, 2011 at 7:28 AM, Ralf Gommers wrote: > I've opened http://projects.scipy.org/numpy/ticket/1713 so this doesn't get > lost. Just wanted to bump this -- bug still exists in numpy HEAD 2.0.0.dev-fe3852f ___ NumPy-Discussion mailing list Num

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-21 Thread John
Hey all, just wanted to let you know that this works nicely: stacked = np.vstack(MyDict.values()) So long as the dictionary only cotains the recarrays. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/n

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John
Yes, stacking is fine, and looping per John's suggestion is what I've done, I was just wondering if there was possibly a more 'pythonic' or more importantly efficient way than the loop. Thanks, john On Wed, Mar 16, 2011 at 3:38 PM, John Salvatier wrote: > I think he wa

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John Salvatier
I think he wants to stack them (same widths) so stacking them should be fine. On Wed, Mar 16, 2011 at 7:30 AM, Bruce Southey wrote: > On 03/16/2011 08:56 AM, John Salvatier wrote: > > Loop through to build a list of arrays, then use vstack on the list. > > On Wed, Mar 16, 2011 a

Re: [Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John Salvatier
Loop through to build a list of arrays, then use vstack on the list. On Wed, Mar 16, 2011 at 1:36 AM, John wrote: > Hello, > > I have a dictionary with structured arrays, keyed by integers 0...n. > There are no other keys in the dictionary. > > What is the most efficient

[Numpy-discussion] convert dictionary of arrays into single array

2011-03-16 Thread John
Is there something I can do that would be more efficient than looping through and using np.concatenate (vstack)? --john ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Add New Functionality for Indexing Along an Axis to Numpy?

2011-03-14 Thread John Salvatier
The new iteration functionality will be providing this in the near future (along with many other things). See https://github.com/numpy/numpy/blob/master/doc/neps/new-iterator-ufunc.rst On Mon, Mar 14, 2011 at 6:30 PM, Jonathan Taylor < jonathan.tay...@utoronto.ca> wrote: > Please excuse the doubl

Re: [Numpy-discussion] 1.6: branching and release notes

2011-03-14 Thread John Salvatier
If they return a tuple of indexes I think 'mulitiindex' sounds quite good. That is exactly what a multiindex is ( http://en.wikipedia.org/wiki/Multi-index_notation). On Mon, Mar 14, 2011 at 1:14 AM, Mark Wiebe wrote: > On Sun, Mar 13, 2011 at 11:59 PM, Ralf Gommers < > ralf.gomm...@googlemail.co

Re: [Numpy-discussion] ragged array implimentation

2011-03-07 Thread John Salvatier
@Jeff I need to work with ragged arrays too. Are object arrays of 1d numpy arrays slower than lists of 1d numpy arrays? @ Christopher I'd be interested in hearing if you come up with any better solutions. On Mon, Mar 7, 2011 at 9:37 AM, Jeff Whitaker wrote: > On 3/7/11 10:28 AM, Christopher Bar

  1   2   3   4   >