Re: [Numpy-discussion] reorganizing numpy internal extensions (was: Re: Should we drop support for "one file" compilation mode?)

2015-10-08 Thread Daniele Nicolodi
Hello, sorry for replying in the wrong thread, but I don't find an appropriate message to reply to in the original one. On 08/10/15 09:10, Nathaniel Smith wrote: > Hiding symbols is the only advantage that I'm aware of, and as noted > in the other thread there do exist other solutions. Indeed, a

Re: [Numpy-discussion] Removal of Deprecated Keywords/functionality

2015-06-21 Thread Daniele Nicolodi
On 21/06/15 01:07, Charles R Harris wrote: > > > On Sat, Jun 20, 2015 at 3:32 PM, Nathaniel Smith > wrote: > > On Jun 20, 2015 1:43 PM, "Charles R Harris" > mailto:charlesr.har...@gmail.com>> wrote: > > > > Hi All, > > > > There are three long ago

Re: [Numpy-discussion] FFTS for numpy's FFTs (was: Re: Choosing between NumPy and SciPy functions)

2014-10-28 Thread Daniele Nicolodi
On 28/10/14 18:44, Stefan van der Walt wrote: > On 2014-10-28 19:37:17, Daniele Nicolodi wrote: >> On 28/10/14 16:50, David Cournapeau wrote: >>> Nothing impossible (looks like Sony at least uses this code on windows: >>> https://github.com/anthonix/ffts/issues/27#

Re: [Numpy-discussion] FFTS for numpy's FFTs (was: Re: Choosing between NumPy and SciPy functions)

2014-10-28 Thread Daniele Nicolodi
On 28/10/14 16:50, David Cournapeau wrote: > Nothing impossible (looks like Sony at least uses this code on windows: > https://github.com/anthonix/ffts/issues/27#issuecomment-40204403), but > not a 2 hours thing either. One of the downsides of the BSD license :) Cheers, Daniele

Re: [Numpy-discussion] Memory efficient alternative for np.loadtxt and np.genfromtxt

2014-10-26 Thread Daniele Nicolodi
On 26/10/14 09:46, Saullo Castro wrote: > I would like to start working on a memory efficient alternative for > np.loadtxt and np.genfromtxt that uses arrays instead of lists to store > the data while the file iterator is exhausted. ... > I would be glad if you could share your experience on this

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

2014-10-14 Thread Daniele Nicolodi
On 14/10/14 14:11, Daniele Nicolodi wrote: > On 14/10/14 13:39, Nathaniel Smith wrote: >> If the goal is to have something that works kind of like the new buffer >> protocol but with a wider variety of python versions, then you might >> find the old array interface useful: >

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

2014-10-14 Thread Daniele Nicolodi
On 14/10/14 13:39, Nathaniel Smith wrote: > If the goal is to have something that works kind of like the new buffer > protocol but with a wider variety of python versions, then you might > find the old array interface useful: > http://docs.scipy.org/doc/numpy/reference/arrays.interface.html > > I

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

2014-10-14 Thread Daniele Nicolodi
On 14/10/14 04:39, Charles R Harris wrote: > On Mon, Oct 13, 2014 at 12:54 PM, Sebastian Berg > mailto:sebast...@sipsolutions.net>> wrote: > > On Mo, 2014-10-13 at 13:35 +0200, Daniele Nicolodi wrote: > > Hello, > > > > I have a C++ application

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

2014-10-13 Thread Daniele Nicolodi
Hello, I have a C++ application that collects float, int or complex data in a possibly quite large std::vector. The application has some SWIG generated python wrappers that expose this vector to python. However, the standard way in which SWIG exposes the data is to create a touple and pass this to

Re: [Numpy-discussion] Help Understanding Indexing Behavior

2014-02-25 Thread Daniele Nicolodi
On 26/02/2014 00:04, JB wrote: > At the risk of igniting a flame war...can someone please help me understand > the indexing behavior of NumPy? I will readily I admit I come from a Matlab > background, but I appreciate the power of Python and am trying to learn more. > >>From a Matlab user's persp

Re: [Numpy-discussion] Custom floating point representation to IEEE 754 double

2014-02-25 Thread Daniele Nicolodi
On 26/02/2014 00:12, Oscar Benjamin wrote: > On 25 February 2014 11:08, Daniele Nicolodi wrote: >> Hello, >> >> I'm dealing with an instrument that transfers numerical values through >> an RS232 port in a custom (?) floating point representation (56 bits

Re: [Numpy-discussion] shortcut nonzero?

2014-02-25 Thread Daniele Nicolodi
> On Tue, Feb 25, 2014 at 2:20 PM, Alan G Isaac > wrote: > > Is there a shortcut version for finding the first (k) instance(s) of > nonzero entries? > I'm thinking of Matlab's `find(X,k)`: > http://www.mathworks.com/help/matlab/ref/find.html > Easy

[Numpy-discussion] Custom floating point representation to IEEE 754 double

2014-02-25 Thread Daniele Nicolodi
Hello, I'm dealing with an instrument that transfers numerical values through an RS232 port in a custom (?) floating point representation (56 bits, 4 bits exponent and 52 bits significand). Of course I need to convert this format to a standard IEEE 754 double to be able to do anything useful with

[Numpy-discussion] np.savetxt() default format

2014-02-24 Thread Daniele Nicolodi
Hello, I've noticed that numpy default format for saving data in ascii representation with np.savetxt() is "%.18e". Given that the default data type for numpy is double and that the resolution of doubles is 15 decimal digits, what's the reason of the the additional three digits? The three additi

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 18:18, Sturla Molden wrote: > Daniele Nicolodi wrote: > >> That's more or less my current approach (except that I use the fact that >> the data is evenly samples to use np.where(np.diff(t1) != dt) to detect >> the regions of continuous data, to av

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 15:38, Sturla Molden wrote: > Daniele Nicolodi wrote: > >> I was probably not that clear: I have two 2xN arrays, one for each data >> recording, one column for time (taken from the same clock for both >> measurements) and one with data values. Each array ha

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 14:56, Sturla Molden wrote: > Daniele Nicolodi wrote: > >> Correct me if I'm wrong, but this assumes that missing data points are >> represented with Nan. In my case missing data points are just missing. > > Then your data cannot be stored in a 2 x

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
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: >>>> Hello, >>>> >>>> I have two time series (2xN dimensi

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
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 each with it's own dead times (and start and end >> recording ti

[Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
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 segments of the data. Does numpy or scipy offer something tha

Re: [Numpy-discussion] striding through arbitrarily large files

2014-02-04 Thread Daniele Nicolodi
On 04/02/2014 16:01, RayS wrote: > I was struggling with methods of reading large disk files into numpy > efficiently (not FITS or .npy, just raw files of IEEE floats from > numpy.tostring()). When loading arbitrarily large files it would be nice > to not bother reading more than the plot can disp

[Numpy-discussion] math.fsum() like ufunc for numpy

2013-12-02 Thread Daniele Nicolodi
Hello, there would be interest in adding a floating point accurate summation function like Python's math.fsum() in the form of an ufunc to NumPy? I had a look at the algorithm (http://code.activestate.com/recipes/393090-binary-floating-point-summation-accurate-to-full-p/) and it looks quite strai

Re: [Numpy-discussion] Robust Sorting of Points

2013-10-27 Thread Daniele Nicolodi
On 27/10/2013 19:42, Freddie Witherden wrote: > On 27/10/13 18:35, Nathaniel Smith wrote: >> On Sun, Oct 27, 2013 at 6:28 PM, Freddie Witherden >> wrote: >>> Hi all, >>> >>> This is a question which has been bugging me for a while. I have an (N, >>> 3) array where N ~ 16 of points. These points

Re: [Numpy-discussion] OT: How are SVG data converted into curves

2013-10-16 Thread Daniele Nicolodi
On 17/10/2013 01:06, David Goldsmith wrote: > Does anyone on this list know how Scalable Vector Graphics C, S, etc. > command data are translated into curves (i.e., pixel maps) and might you > be willing to answer some questions off-list? Thanks! Hello, the format is quite clearly documented. Fo

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-03 Thread Daniele Nicolodi
On 03/10/2013 20:59, Charles R Harris wrote: > Here is what I have currently implemented. First, define an AllNanError > > class AllNanError(ValueError): > def __init__(self, msg, result): > ValueError.__init__(self, msg) > self.result = result > > For nanmax/nanmin/nanargmax

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-03 Thread Daniele Nicolodi
On 03/10/2013 13:56, Charles R Harris wrote: > On Thu, Oct 3, 2013 at 4:06 AM, Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: > > Hello, > > sorry, I don't know where exactly jump in in the thread, it is getting > quite long and articulated

Re: [Numpy-discussion] Behavior of nan{max, min} and nanarg{max, min} for all-nan slices.

2013-10-03 Thread Daniele Nicolodi
Hello, sorry, I don't know where exactly jump in in the thread, it is getting quite long and articulated... On 02/10/2013 21:19, Charles R Harris wrote: > The main problem I had was deciding what arg{max, min} should return as > the return value is an integer. I like your suggestion of returning

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Daniele Nicolodi
On 12/06/2013 14:29, Robert Kern wrote: > On Wed, Jun 12, 2013 at 1:26 PM, Daniele Nicolodi wrote: > >> There where the additional proposal (mostly neglected on the original >> thread) to add the 'fill' optional parameter to the array constructor: >> >> np

Re: [Numpy-discussion] numpy.filled, again

2013-06-12 Thread Daniele Nicolodi
On 12/06/2013 14:10, Nathaniel Smith wrote: > It looks like we've gotten a bit confused and need to untangle > something. There's a PR to add new functions 'np.filled' and > 'np.filled_like': > https://github.com/numpy/numpy/pull/2875 > And there was a discussion about this on the list back in Ja

Re: [Numpy-discussion] multivariate_normal issue with 'size' argument

2013-05-24 Thread Daniele Nicolodi
On 24/05/2013 15:11, Daniele Nicolodi wrote: > Hello Emanuele, > > it works for me with numpy 1.6.2 (python 2.7.3 on mac os x 10.6 via > macports but is should not matter). 64-bit build Cheers, Daniele ___ NumPy-Discussion mailin

Re: [Numpy-discussion] multivariate_normal issue with 'size' argument

2013-05-24 Thread Daniele Nicolodi
On 24/05/2013 14:02, Emanuele Olivetti wrote: > Hi, > > I'm using NumPy v1.6.1 shipped with Ubuntu 12.04 (Python 2.7.3). I observed an > odd behavior of the multivariate_normal function, which does not like int64 > for > the 'size' argument. > Short example: > """ > import numpy as np > print np.

Re: [Numpy-discussion] printing array in tabular form

2013-05-10 Thread Daniele Nicolodi
On 10/05/2013 13:20, Sudheer Joseph wrote: > Hi, > I am trying to learn Python after feeling its utility in coding and > also reading a bit aboutits potential only, please do not put words > in to my mouth like below. I didn't put words in your mouth, I simply quoted emails you sent to the list a

Re: [Numpy-discussion] printing array in tabular form

2013-05-10 Thread Daniele Nicolodi
On 10/05/2013 11:14, Sudheer Joseph wrote: > However writing a formatted out put looks to be bit tricky with > python relative to other programing languages. ... > I was looking for a format statement likw write(*,"(A,5F8.3)") Before denigrating a programming language I would make sure to have

Re: [Numpy-discussion] numpy ring buffer

2013-05-06 Thread Daniele Nicolodi
On 06/05/2013 11:39, Daniele Nicolodi wrote: > On 06/05/2013 11:01, Robert Kern wrote: >> np.roll() copies all of the data every time. It does not return a >> view. > > Are you sure about that? Either I'm missing something, or it returns a > view in my testing (wi

Re: [Numpy-discussion] numpy ring buffer

2013-05-06 Thread Daniele Nicolodi
On 06/05/2013 11:01, Robert Kern wrote: > np.roll() copies all of the data every time. It does not return a > view. Are you sure about that? Either I'm missing something, or it returns a view in my testing (with a fairly old numpy, though): In [209]: np.__version__ Out[209]: '1.6.2' In [210]: v

[Numpy-discussion] numpy ring buffer

2013-05-06 Thread Daniele Nicolodi
Hello, numpy arrays are great for interfacing python with libraries that expect continuous memory buffers for data passing. However, libraries interfacing to data acquisition hardware often use those buffers as ring buffers where, once the buffer has been filled with data, new data will be writte

Re: [Numpy-discussion] int to binary

2013-04-29 Thread Daniele Nicolodi
On 29/04/2013 17:15, josef.p...@gmail.com wrote: > Is there a available function to convert an int to binary > representation as sequence of 0 and 1? ... > That's the best I could come up with in a few minutes: ... > def int2bin(x, width, roll=True): > x = np.atleast_1d(x) > res = np.z

Re: [Numpy-discussion] Time Zones and datetime64

2013-04-10 Thread Daniele Nicolodi
On 10/04/2013 18:55, Riccardo De Maria wrote: > The library should handle correctly leap seconds, otherwise using unix time > as a floating point number is already sufficient for many applications. Please define what you mean by "handle correctly leap seconds". As leap seconds are not predictable

Re: [Numpy-discussion] timezones and datetime64

2013-04-05 Thread Daniele Nicolodi
On 04/04/2013 15:34, Jonathan T. Niehof wrote: > Keeping a leap second database up to date is annoying but not as bad as > it could be: they're not arbitrary. Although they can occur monthly, > they've only ever happened at June 30 and Dec 31, announced in January > and July, respectively. So it

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Daniele Nicolodi
On 04/04/2013 03:02, Mark Wiebe wrote: > I think it's most straightforward to leave it wrong for Posix-format > datetimes, but add a TAI timezone where it will produce correct results. Strictly speaking, TAI is not a timezone but a different time base. Cheers, Daniele ___

Re: [Numpy-discussion] timezones and datetime64

2013-04-04 Thread Daniele Nicolodi
On 04/04/2013 01:27, Pauli Virtanen wrote: > > Probably also TAI and UTC/Posix. > > Converting from one format to the other is problematic since > all of them (except TAI afaik) require looking things up in > regularly updated databases. Not only restricted to conversions, > but also arithmetic, `

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Daniele Nicolodi
On 21/03/2013 10:16, Valentin Haenel wrote: > Dear Daniele > > * Daniele Nicolodi [2013-03-21]: >> On 21/03/2013 09:45, Valentin Haenel wrote: >>> if you are new to interfacing python/numpy with C/C++, you may want to >>> check out: >>> >

Re: [Numpy-discussion] numpy array to C API

2013-03-21 Thread Daniele Nicolodi
On 21/03/2013 09:45, Valentin Haenel wrote: > if you are new to interfacing python/numpy with C/C++, you may want to > check out: > > http://scipy-lectures.github.com/advanced/interfacing_with_c/interfacing_with_c.html > > Disclaimer: I am the author of this chapter, so this response is a bit > o

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Daniele Nicolodi
On 18/01/2013 17:46, Benjamin Root wrote: > > > On Fri, Jan 18, 2013 at 11:36 AM, Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: > > On 18/01/2013 15:19, Benjamin Root wrote: > > > > > > On Fri, Jan 18, 2013 at 3:44 AM, Daniel

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Daniele Nicolodi
On 18/01/2013 15:19, Benjamin Root wrote: > > > On Fri, Jan 18, 2013 at 3:44 AM, Daniele Nicolodi <mailto:dani...@grinta.net>> wrote: > > On 17/01/2013 23:27, Mark Wiebe wrote: > > Would it be too weird or clumsy to extend the empty and empty_like >

Re: [Numpy-discussion] New numpy functions: filled, filled_like

2013-01-18 Thread Daniele Nicolodi
On 17/01/2013 23:27, Mark Wiebe wrote: > Would it be too weird or clumsy to extend the empty and empty_like > functions to do the filling? > > np.empty((10, 10), fill=np.nan) > np.empty_like(my_arr, fill=np.nan) Wouldn't it be more natural to extend the ndarray constructor? np.ndarray((10, 10),

Re: [Numpy-discussion] Use OpenBLAS for the binary releases?

2012-11-19 Thread Daniele Nicolodi
On 19/11/2012 18:12, Sturla Molden wrote: > I think NumPy and SciPy should consider to use OpenBLAS (a fork of > GotoBLAS2) instead of ATLAS or f2c'd Netlib BLAS for the binary releases. ... > * Funded and developed for use in major Chinese HPC projects. Actively > maintained. (GotoBLAS2 is aband

Re: [Numpy-discussion] use slicing as argument values?

2012-07-13 Thread Daniele Nicolodi
On 12/07/2012 23:32, Chao YUE wrote: > Thanks all for the discussion. Actually I am trying to use something > like numpy ndarray indexing in the function. Like when I call: > > func(a,'1:3,:,2:4'), it knows I want to retrieve a[1:3,:,2:4], and > func(a,'1:3,:,4') for a[1:3,:,4] ect. > I am very clo

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-20 Thread Daniele Nicolodi
On 18/02/12 04:54, Sturla Molden wrote: > This is not true. C++ can be much easier, particularly for those who > already know Python. The problem: C++ textbooks teach C++ as a subset > of C. Writing C in C++ just adds the complexity of C++ on top of C, > for no good reason. I can write FORTRAN in a

Re: [Numpy-discussion] Negative indexing.

2012-01-15 Thread Daniele Nicolodi
On 15/01/12 00:53, Nathan Faggian wrote: > Hi, > > I am finding it less than useful to have the negative index wrapping > on nd-arrays. Here is a short example: > > import numpy as np > a = np.zeros((3, 3)) > a[:,2] = 1000 > print a[0,-1] > print a[0,-1] > print a[-1,-1] > > In all cases 1000 is

Re: [Numpy-discussion] abs for max negative integers - desired behavior?

2011-10-12 Thread Daniele Nicolodi
On 11/10/11 21:16, Charles R Harris wrote: > IIRC, matlab was said to return > +127 as abs(-128), which, if true, is quite curious. I just checked and this is indeed the case in Matlab 7.10.0 R2010a: >> abs(int8(-128)) ans = 127 Cheers, -- Daniele ___

Re: [Numpy-discussion] Wiener filter / decorrelation

2011-01-25 Thread Daniele Nicolodi
On 25/01/11 22:20, Pauli Virtanen wrote: >> However I'm encountering some problems that are beyond my knowledge of >> the matter. Can someone suggest me a reference text book, or other >> resource? > > Scipy-user list would be more appropriate for queries not directly > involving Numpy. Sorry. I

Re: [Numpy-discussion] Wiener filter / decorrelation

2011-01-25 Thread Daniele Nicolodi
On 25/01/11 22:12, Jonathan Rocher wrote: > I would recommend the Numerical recipes in Fortran 77, obviously not for > the language but for its mathematical sections and its discussions of > coding algorithms efficiently. Section 13.3 is about wiener filtering > with FFT. Thank you, Jonathan. I t

[Numpy-discussion] Wiener filter / decorrelation

2011-01-25 Thread Daniele Nicolodi
Hello, I'm trying to write a numerical implementation of Wiener filtering / decorrelation (extraction of a signal from noisy time series). What I'm trying to do is the construction of the time domain filter from a measurement of the power spectrum of the noise and the shape of the signal. However

[Numpy-discussion] Mapping of a ring buffer to a numpy array

2010-10-14 Thread Daniele Nicolodi
Hello, I would like to write (in cython) python bindings for a library that interfaces with data acquisition hardware trough a kernel driver. Data can be exchanged with the kernel driver trough a memory mapped ring buffer. I would like to expose this ring buffer as a numpy array, however I would

[Numpy-discussion] Greater common divisor

2010-06-07 Thread Daniele Nicolodi
Hello. There is a method in numpy to compute the greater common divisor of the elements of an array? Searching through the documentation I didn't find it. Thanks. Cheers, -- Daniele ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mai

Re: [Numpy-discussion] Extending documentation to c code

2010-05-25 Thread Daniele Nicolodi
On 25/05/10 09:04, Sebastien Binet wrote: > note that llvm/clang is versatile enough to easily provide indices into > the source code, which of course includes the comments... I am actually > working on improving the python bindings to clang (which are already > quite useful for this thread's top