Re: [Numpy-discussion] FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.

2015-04-08 Thread Andreas Hilboll
On 08.04.2015 20:30, Nathaniel Smith wrote: > On Apr 8, 2015 2:16 PM, "Andreas Hilboll" <mailto:li...@hilboll.de>> wrote: >> >> Hi all, >> >> I'm commonly using function signatures like >> >>def myfunc(a, b

[Numpy-discussion] FutureWarning: comparison to `None` will result in an elementwise object comparison in the future.

2015-04-08 Thread Andreas Hilboll
Hi all, I'm commonly using function signatures like def myfunc(a, b, c=None): if c is None: # do something ... ... where c is an optional array argument. For some time now, I'm getting a FutureWarning: comparison to `None` will result in an elementwise object

Re: [Numpy-discussion] Dates and times and Datetime64 (again)

2014-04-28 Thread Andreas Hilboll
On 19.04.2014 09:03, Andreas Hilboll wrote: > On 14.04.2014 20:59, Chris Barker wrote: >> On Fri, Apr 11, 2014 at 4:58 PM, Stephan Hoyer > <mailto:sho...@gmail.com>> wrote: >> >> On Fri, Apr 11, 2014 at 3:56 PM, Charles R Harris >> m

Re: [Numpy-discussion] Dates and times and Datetime64 (again)

2014-04-19 Thread Andreas Hilboll
On 14.04.2014 20:59, Chris Barker wrote: > On Fri, Apr 11, 2014 at 4:58 PM, Stephan Hoyer > wrote: > > On Fri, Apr 11, 2014 at 3:56 PM, Charles R Harris > mailto:charlesr.har...@gmail.com>> wrote: > > Are we in a position to start looking at implementatio

Re: [Numpy-discussion] Suggestion: Port Theano RNG implementation to NumPy

2014-02-18 Thread Andreas Hilboll
On 18.02.2014 17:47, Sturla Molden wrote: > Matthieu Brucher wrote: >> Hi, >> >> The main issue with PRNG and MT is that you don't know how to >> initialize all MT generators properly. A hash-based PRNG is much more >> efficient in that regard (see Random123 for a more detailed >> explanation). >>

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Andreas Hilboll
On 11.02.2014 14:47, Daniele Nicolodi wrote: > On 11/02/2014 14:41, Andreas Hilboll wrote: >> On 11.02.2014 14:22, Daniele Nicolodi wrote: >>> On 11/02/2014 14:10, Andreas Hilboll wrote: >>>> On 11.02.2014 14:08, Daniele Nicolodi wrote: >>>>> H

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Andreas Hilboll
On 11.02.2014 14:22, Daniele Nicolodi wrote: > On 11/02/2014 14:10, Andreas Hilboll wrote: >> On 11.02.2014 14:08, Daniele Nicolodi wrote: >>> Hello, >>> >>> I have two time series (2xN dimensional arrays) recorded on the same >>> time basis, but eac

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Andreas Hilboll
On 11.02.2014 14:08, Daniele Nicolodi wrote: > Hello, > > I have two time series (2xN dimensional arrays) recorded on the same > time basis, but each with it's own dead times (and start and end > recording times). I would like to obtain two time series containing > only the time overlapping segme

[Numpy-discussion] Why do weights in np.polyfit have to be 1D?

2014-01-10 Thread Andreas Hilboll
Hi, in using np.polyfit (in version 1.7.1), I ran accross TypeError: expected a 1-d array for weights when trying to fit k polynomials at once (x.shape = (4, ), y.shape = (4, 136), w.shape = (4, 136)). Is there any specific reason why this is not supported? -- Andreas. __

Re: [Numpy-discussion] Reading from binary file with memmap, with offset

2013-10-10 Thread Andreas Hilboll
On 10.10.2013 15:07, Joe Kington wrote: > You just need to supply the "offset" kwarg to "memmap". > > for example: > > with open(localfile, "r") as fd: > # read offset from first line of file > offset = int(next(fd).split()[-2]) > np.memmap(fd, dtype="float32", mode="r", offset=offset) > >

Re: [Numpy-discussion] Reading from binary file with memmap, with offset

2013-10-10 Thread Andreas Hilboll
On 10.10.2013 14:57, Julian Taylor wrote: > you have to use the offset keyword argument of np.memmap, else it will > always start from the beginning of the file > np.memmap(fd, dtype="float32", mode="r", offset=offset) Thanks for that! I just proposed an update to the memmap docstring to bet

[Numpy-discussion] Reading from binary file with memmap, with offset

2013-10-10 Thread Andreas Hilboll
Hi, I have a problem using memmap correctly. I need to read a data file which consists of an ASCII header and appended binary single precision floating point values. memmap complains that the "Size of available data is not a multiple of the data-type size." But as far as I can tell, the size *doas

Re: [Numpy-discussion] 2-D Histogram

2013-09-10 Thread Andreas Hilboll
On 10.09.2013 15:52, David Reed wrote: > Hi there, > > Is there a faster way to perform a 2D Histogram from a 2D matrix than > what I have below: > > def spatial_histogram(frame, n_bins): > shape = frame.shape > > h_len = shape[0]/n_bins > w_len = shape[1]/n_bins > > h_ind = range(0, shape[0],

Re: [Numpy-discussion] Splitting numpydoc to a separate repo

2013-07-24 Thread Andreas Hilboll
On 24.07.2013 17:33, Pauli Virtanen wrote: > Hi, > > How about splitting doc/sphinxext out from the main Numpy repository to > a separate `numpydoc` repo under Numpy project? +1 -- Andreas ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org h

Re: [Numpy-discussion] flip array on axis

2013-07-12 Thread Andreas Hilboll
Am 10.07.2013 17:06, schrieb Matthew Brett: > Hi, > > On Wed, Jul 10, 2013 at 11:02 AM, Andreas Hilboll wrote: >> Hi, >> >> there are np.flipud and np.fliplr methods to flip 2d arrays on the first >> and second dimension, respectively. What can I do to flip an

Re: [Numpy-discussion] flip array on axis

2013-07-10 Thread Andreas Hilboll
On 10.07.2013 17:06, Matthew Brett wrote: > Hi, > > On Wed, Jul 10, 2013 at 11:02 AM, Andreas Hilboll wrote: >> Hi, >> >> there are np.flipud and np.fliplr methods to flip 2d arrays on the first >> and second dimension, respectively. What can I do to flip an

[Numpy-discussion] flip array on axis

2013-07-10 Thread Andreas Hilboll
Hi, there are np.flipud and np.fliplr methods to flip 2d arrays on the first and second dimension, respectively. What can I do to flip an array on an axis which I don't know before runtime? I'd really like to see a np.flip(arr, axis) method which lets me specify which axis to flip on. Any ideas?

Re: [Numpy-discussion] pyhdf packaging

2013-05-23 Thread Andreas Hilboll
ckage on my PPA: https://launchpad.net/~andreas-h/+archive/scicomp-stable Cheers, Andreas. > --- > *Arnaldo D'Amaral Pereira Granja Russo* > Lab. de Estudos dos Oceanos e Clima > Instituto de Oceanografia - FURG > > > > > 2012/11/6 Andreas Hilboll mailto:l

Re: [Numpy-discussion] numpy.scipy.org page 404s

2013-04-26 Thread Andreas Hilboll
>>> Unfortunately, Github can only deal with one CNAME, www.numpy.org. The >>> documentation recommends that one "redirect" the other domains, but >>> it's not clear exactly what it is referring to. Having an HTTP server >>> with an A record for numpy.scipy.org that just issues HTTP 301 >>> redirec

Re: [Numpy-discussion] numpy.scipy.org page 404s

2013-04-26 Thread Andreas Hilboll
> Unfortunately, Github can only deal with one CNAME, www.numpy.org. The > documentation recommends that one "redirect" the other domains, but > it's not clear exactly what it is referring to. Having an HTTP server > with an A record for numpy.scipy.org that just issues HTTP 301 > redirects for eve

Re: [Numpy-discussion] Impossible to draw a direction of arrows in Python???

2013-04-12 Thread Andreas Hilboll
> Hi, > I have encountered some problem while I was drawing a direction of > arrow. I have point (x,y) coordinates and angle of them. What I want to > do is that to draw arrow according to the given angle (just to show the > point direction as an arrow in each point coordinate). Here, we should > a

Re: [Numpy-discussion] timezones and datetime64

2013-04-02 Thread Andreas Hilboll
>> As I poke at this a bit, I"m noticing that maybe time zones aren't >> handles at all internally -- rather, the conversion is done to UTC >> when creating a datetime64, and conversion is then done to the locale >> when creating a strng representation -- maybe nothing inside at all. >> >> Does t

Re: [Numpy-discussion] how to efficiently select multiple slices from an array?

2013-03-20 Thread Andreas Hilboll
> Hey, > > On Wed, 2013-03-20 at 16:31 +0100, Andreas Hilboll wrote: >> Cross-posting a question I asked on SO >> (http://stackoverflow.com/q/15527666/152439): >> >> >> Given an array >> >> d = np.random.randn(100) >> >> and an

[Numpy-discussion] how to efficiently select multiple slices from an array?

2013-03-20 Thread Andreas Hilboll
Cross-posting a question I asked on SO (http://stackoverflow.com/q/15527666/152439): Given an array d = np.random.randn(100) and an index array i = np.random.random_integers(low=3, high=d.size - 5, size=20) how can I efficiently create a 2d array r with r.shape = (20, 8) such th

[Numpy-discussion] np.percentile docstring

2013-02-17 Thread Andreas Hilboll
In my numpy 1.6.1 (from Ubuntu 12.04LTS repository), the docstring of np.percentile is wrong. I'm not just submitting a PR because I don't understand something. in the "Notes" and "Examples" sections, there seems to be some confusion if ``q`` should be in the range [0,1] or in [0,100]. The paramet

[Numpy-discussion] savez documentation flaw

2013-02-05 Thread Andreas Hilboll
Hi, I noticed that on http://docs.scipy.org/doc/numpy/reference/generated/numpy.savez.html there's a "see also" to a function numpy.savez_compressed, which doesn't seem to exist (neither on my system nor in the online documentation). What would be the easiest way to find out where to fix this? Fo

[Numpy-discussion] pyhdf packaging

2012-11-06 Thread Andreas Hilboll
Hi, I would like to package pyhdf for Ubuntu and make the package publicly available. Since the license is not totally clear to me (I cannot find any information in the sources, and the cheeseshop says "public", which doesn't mean anything to me), I tried to contact the maintainer, Andre Gosselin,

Re: [Numpy-discussion] variable number of columns in loadtxt/genfromtxt

2012-09-25 Thread Andreas Hilboll
> On Tue, Sep 25, 2012 at 2:31 AM, Andreas Hilboll wrote: >> I commonly have to deal with legacy ASCII files, which don't have a >> constant number of columns. The standard is 10 values per row, but >> sometimes, there are less columns. loadtxt doesn't support t

[Numpy-discussion] variable number of columns in loadtxt/genfromtxt

2012-09-25 Thread Andreas Hilboll
Hi, I commonly have to deal with legacy ASCII files, which don't have a constant number of columns. The standard is 10 values per row, but sometimes, there are less columns. loadtxt doesn't support this, and in genfromtext, the rows which have less than 10 values are excluded from the resulting ar

Re: [Numpy-discussion] specifying numpy as dependency in your project, install_requires

2012-09-21 Thread Andreas Hilboll
Am Fr 21 Sep 2012 22:37:13 CEST schrieb Benjamin Root: > > > On Fri, Sep 21, 2012 at 4:19 PM, Travis Oliphant > wrote: > > > On Sep 21, 2012, at 3:13 PM, Ralf Gommers wrote: > >> Hi, >> >> An issue I keep running into is that packages use: >> install

Re: [Numpy-discussion] Fwd: np.unique for one bi-dimensional array

2012-07-25 Thread Andreas Hilboll
> Hi, > > would like to identify unique pairs of numbers in two arrays o in one > bi-dimensional array, and count the observation > > a_clean=array([4,4,5,4,4,4]) > b_clean=array([3,5,4,4,3,4]) > > and obtain > (4,3,2) > (4,5,1) > (5,4,1) > (4,4,2) > > I solved with tow loops but off course there w

[Numpy-discussion] Problems understanding histogram2d

2012-07-20 Thread Andreas Hilboll
Hi, I have a problem using histogram2d: from numpy import linspace, histogram2d bins_x = linspace(-180., 180., 360) bins_y = linspace(-90., 90., 180) data_x = linspace(-179.96875, 179.96875, 5760) data_y = linspace(-89.96875, 89.96875, 2880) histogram2d(data_x, data_y, (bins_x,

Re: [Numpy-discussion] [SciPy-Dev] ANN: SciPy 0.11.0 release candidate 1

2012-07-20 Thread Andreas Hilboll
> Hi, > > I am pleased to announce the availability of the first release candidate > of > SciPy 0.11.0. For this release many new features have been added, and over > 120 tickets and pull requests have been closed. Also noteworthy is that > the > number of contributors for this release has risen to

Re: [Numpy-discussion] f2py with allocatable arrays

2012-07-03 Thread Andreas Hilboll
> Hi numpy. > > Does anyone know if f2py supports allocatable arrays, allocated inside > fortran subroutines? The old f2py docs seem to indicate that the > allocatable array must be created with numpy, and dropped in the module. > Here's more background to explain... > > I have a fortran subroutine

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

2012-06-28 Thread Andreas Hilboll
> Hi Travis, > > On Thu, Jun 28, 2012 at 1:25 PM, 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? > > I think it would depend on 1.7 state. I am unwilling to drop support >

Re: [Numpy-discussion] Ubuntu PPA for NumPy / SciPy / ...

2012-06-07 Thread Andreas Hilboll
>> Hi, >> >> I just noticed that there's a PPA for NumPy/SciPy on Launchpad: >> >> >> https://launchpad.net/~scipy/+archive/ppa >> >> However, it's painfully outdated. Does anyone know of its status? Is it >> 'official'? Are there any plans in revital

[Numpy-discussion] Ubuntu PPA for NumPy / SciPy / ...

2012-06-07 Thread Andreas Hilboll
Hi, I just noticed that there's a PPA for NumPy/SciPy on Launchpad: https://launchpad.net/~scipy/+archive/ppa However, it's painfully outdated. Does anyone know of its status? Is it 'official'? Are there any plans in revitalizing it, possibly with adding other projects from the "scipy univers

Re: [Numpy-discussion] why two versions of polyfit?

2012-05-20 Thread Andreas Hilboll
> On Sun, May 20, 2012 at 9:37 AM, Charles R Harris > mailto:charlesr.har...@gmail.com>> wrote: > > > > On Sun, May 20, 2012 at 9:09 AM, Andreas Hilboll <mailto:li...@hilboll.de>> wrote: > > Hi, > > I just notic

[Numpy-discussion] why two versions of polyfit?

2012-05-20 Thread Andreas Hilboll
Hi, I just noticed that there's two polyfit functions, one in numpy.lib.polynomial, and one in numpy.polynomial. What's the reason for this? The calling signatures aren't identical (the numpy.polynomial version supports weights), and I couldn't find a notice on why two versions exist. Puzzled gre

Re: [Numpy-discussion] np.choose() question

2010-06-08 Thread Andreas Hilboll
Hi, > newtimes = [times[idx[x][y]] for x in range(2) for y in range(2)] > np.array(newtimes).reshape(2,2) > array([[104, 102], >[103, 101]]) Great, thanks a lot! Cheers, Andreas. ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.or

[Numpy-discussion] np.choose() question

2010-06-08 Thread Andreas Hilboll
Hi there, I have a problem, which I'm sure can somehow be solved using np.choose() - but I cannot figure out how :( I have an array idx, which holds int values and has a 2d shape. All values inside idx are 0 <= idx < n. And I have a second array times, which is 1d, with times.shape = (n,). Ou

[Numpy-discussion] 2d binning on regular grid

2010-06-02 Thread Andreas Hilboll
Hi there, I'm interested in the solution to a special case of the parallel thread '2D binning', which is going on at the moment. My data is on a fine global grid, say .125x.125 degrees. I'm looking for a way to do calculations on coarser grids, e.g. * calculate means() * calculate std() * ... on

Re: [Numpy-discussion] Speeding up loadtxt / savetxt

2010-04-28 Thread Andreas Hilboll
Hi Stéfan, > Do you specifically need to store text files? NumPy's binary storage > functions (numpy.load and save) are faster. Yes, I know. But the files I create must be readable by an application developed in-house at our institude, and that only supports a) ASCII files or b) some home-grown

[Numpy-discussion] trim_zeros in more than one dimension?

2010-04-20 Thread Andreas Hilboll
Hi there, is there an easy way to do something like trim_zeros() does, but for a n-dimensional array? I have a 2d array with only zeros in the first and last rows and columns, and would like to trim this array to only the non-zero part ... Thanks, Andreas. __