Re: [Numpy-discussion] performance of numpy.array()

2015-04-30 Thread Ryan Nelson
I have had good luck with Continuum's Miniconda Python distributions on Linux. http://conda.pydata.org/miniconda.html The `conda` command makes it very easy to create specific testing environments for Python 2 and 3 with many different packages. Everything is precompiled, so you won't have to worry

Re: [Numpy-discussion] numpy pickling problem - python 2 vs. python 3

2015-03-06 Thread Ryan Nelson
Arnd, I can see where this is an issue. If you are trying to update your code for Py3, I still think that it would really help to add a version attribute of some sort to your new HDF files. You can then write a little check in your access code that looks for this variable. If it is not present, yo

Re: [Numpy-discussion] numpy pickling problem - python 2 vs. python 3

2015-03-05 Thread Ryan Nelson
This works if run from Py3. Don't know if it will *always* work. From that GH discussion you linked, it sounds like that is a bit of a hack. ## """Illustrate problem with pytables data - python 2 to python 3.""" from __future__ import print_function import sys import numpy as np impor

Re: [Numpy-discussion] Matrix Class

2015-02-11 Thread Ryan Nelson
he Matrix stuff from here to make a separate project with just the Matrix stuff, if you don't want to go through the Sage interface. On Wed, Feb 11, 2015 at 11:54 AM, cjw wrote: > > On 11-Feb-15 10:21 AM, Ryan Nelson wrote: > > So: > > In [2]: np.mat([4,'5&#x

Re: [Numpy-discussion] Matrix Class

2015-02-11 Thread Ryan Nelson
So: In [2]: np.mat([4,'5',6]) Out[2]: matrix([['4', '5', '6']], dtype=' wrote: > It seems to be agreed that there are weaknesses in the existing Numpy > Matrix > Class. > > Some problems are illustrated below. > > I'll try to put some suggestions over the coming weeks and would appreciate > comme

Re: [Numpy-discussion] Characteristic of a Matrix.

2015-01-08 Thread Ryan Nelson
Colin, I'll second the endorsement of Sage; however, for teaching purposes, I would suggest Sage Math Cloud. It is a free, web-based version of Sage, and it does not require you or the students to install any software (besides a new-ish web browser). It also make sharing/collaborative work quite e

Re: [Numpy-discussion] Guidance regarding build and testing

2014-12-22 Thread Ryan Nelson
Maniteja, Ralf's suggestion for Numpy works very well. In a more general case, though, you might want to play around with conda, the package manager for Anaconda's Python distribution (http://continuum.io/downloads). I use the Miniconda package, which is pretty much just conda, to create new "env

Re: [Numpy-discussion] numpy.spacing question

2014-12-05 Thread Ryan Nelson
Alok Singhal edgestreamlp.com> writes: > > On Thu, Dec 4, 2014 at 4:25 PM, Ryan Nelson gmail.com> wrote: > > > > I guess I'm a little confused about how the spacing values are calculated. > > np.spacing(x) is basically the same as np.nextafter(x, np.inf)

[Numpy-discussion] numpy.spacing question

2014-12-04 Thread Ryan Nelson
Hello everyone, I was working through the example usage for the test function `assert_array_almost_equal_nulp`, and it brought up a question regarding the function `spacing`. Here's some example code: import numpy as np from numpy.testing import assert_array_almost_equal_nulp np.set_printopt

Re: [Numpy-discussion] creation of ndarray with dtype=np.object : bug?

2014-12-02 Thread Ryan Nelson
Emanuele Olivetti relativita.com> writes: > > Hi, > > I am using 2D arrays where only one dimension remains constant, e.g.: > --- > import numpy as np > a = np.array([[1, 2, 3], [4, 5, 6]]) # 2 x 3 > b = np.array([[9, 8, 7]]) # 1 x 3 > c = np.array([[1, 3, 5], [7, 9, 8], [6, 4, 2]]) # 3 x 3 > d

Re: [Numpy-discussion] Question about broadcasting vs for loop performance

2014-09-14 Thread Ryan Nelson
much smaller "xs" array (~100 points) and the broadcasting version was much faster. Thanks Ryan Note: The link to the Scipy wiki page above is broken at the bottom of Numpy's broadcasting page, otherwise I would have seen that earlier. Sorry for the noise. On Sun, Sep 14, 2014 at

[Numpy-discussion] Question about broadcasting vs for loop performance

2014-09-14 Thread Ryan Nelson
Hello all, I have a question about the performance of broadcasting versus Python for loops. I have the following sample code that approximates some simulation I'd like to do: ## Test Code ## import numpy as np def lorentz(x, pos, inten, hwhm): return inten*( hwhm**2 / ( (x - pos)**2 + hwh