Re: [Numpy-discussion] record arrays with char*?

2014-02-11 Thread Christopher Jordan-Squire
Thanks for the answers! My responses are inline. On Tue, Feb 11, 2014 at 8:36 AM, Chris Barker wrote: > On Mon, Feb 10, 2014 at 10:43 PM, Christopher Jordan-Squire > wrote: >> >> I'm trying to wrap some C code using cython. The C code can take >> inputs in two m

[Numpy-discussion] record arrays with char*?

2014-02-10 Thread Christopher Jordan-Squire
I'm trying to wrap some C code using cython. The C code can take inputs in two modes: dense inputs and sparse inputs. For dense inputs the array indexing is naive. I have wrappers for that. In the sparse case the matrix entries are typically indexed via names. So, for example, the library documenta

Re: [Numpy-discussion] experiments with SSE vectorization

2013-05-16 Thread Christopher Jordan-Squire
I'd been under the impression that the easiest way to get SSE support was to have numpy use an optimized blas/lapack. Is that not the case? On Thu, May 16, 2013 at 10:42 AM, Julian Taylor wrote: > Hi, > I have been experimenting a bit with how applicable SSE vectorization is > to NumPy. > In prin

Re: [Numpy-discussion] is there an efficient way to get a random set of subsets/combinations?

2012-02-20 Thread Christopher Jordan-Squire
If you're using numpy 2.0 (the development branch), the function numpy.random.choice might do what you're looking for. -Chris On Mon, Feb 20, 2012 at 8:35 PM, Yaroslav Halchenko wrote: > Hi to all Numeric  Python experts, > > could not think of a mailing list with better fit to my question which

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-20 Thread Christopher Jordan-Squire
On Mon, Feb 20, 2012 at 9:18 AM, Dag Sverre Seljebotn wrote: > On 02/20/2012 08:55 AM, Sturla Molden wrote: >> Den 20.02.2012 17:42, skrev Sturla Molden: >>> There are still other options than C or C++ that are worth considering. >>> One would be to write NumPy in Python. E.g. we could use LLVM as

Re: [Numpy-discussion] How a transition to C++ could work

2012-02-19 Thread Christopher Jordan-Squire
On Sun, Feb 19, 2012 at 2:14 AM, David Cournapeau wrote: > On Sun, Feb 19, 2012 at 9:52 AM, Mark Wiebe wrote: >> On Sun, Feb 19, 2012 at 3:10 AM, Ben Walsh wrote: >>> >>> >>> >>> > Date: Sun, 19 Feb 2012 01:18:20 -0600 >>> > From: Mark Wiebe >>> > Subject: [Numpy-discussion] How a transition to

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-18 Thread Christopher Jordan-Squire
On Fri, Feb 17, 2012 at 11:31 PM, Matthew Brett wrote: > Hi, > > On Fri, Feb 17, 2012 at 10:18 PM, Christopher Jordan-Squire > wrote: >> On Fri, Feb 17, 2012 at 8:30 PM, Sturla Molden wrote: >>> >>> >>> Den 18. feb. 2012 kl. 05:01 skrev Jason Grout

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-18 Thread Christopher Jordan-Squire
On Fri, Feb 17, 2012 at 11:55 PM, David Cournapeau wrote: > > Le 18 févr. 2012 06:18, "Christopher Jordan-Squire" a > écrit : > > >> >> On Fri, Feb 17, 2012 at 8:30 PM, Sturla Molden wrote: >> > >> > >> > Den 18. feb. 2012 kl. 05:0

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-17 Thread Christopher Jordan-Squire
On Fri, Feb 17, 2012 at 8:30 PM, Sturla Molden wrote: > > > Den 18. feb. 2012 kl. 05:01 skrev Jason Grout : > >> On 2/17/12 9:54 PM, Sturla Molden wrote: >>> We would have to write a C++ programming tutorial that is based on Pyton >>> knowledge instead of C knowledge. >> >> I personally would lov

Re: [Numpy-discussion] Proposed Roadmap Overview

2012-02-17 Thread Christopher Jordan-Squire
On Fri, Feb 17, 2012 at 10:21 AM, Mark Wiebe wrote: > On Fri, Feb 17, 2012 at 11:52 AM, Eric Firing wrote: >> >> On 02/17/2012 05:39 AM, Charles R Harris wrote: >> > >> > >> > On Fri, Feb 17, 2012 at 8:01 AM, David Cournapeau > > > wrote: >> > >> >     Hi Travis, >> > >

Re: [Numpy-discussion] Numpy governance update

2012-02-16 Thread Christopher Jordan-Squire
On Thu, Feb 16, 2012 at 12:45 PM, Nathaniel Smith wrote: > On Thu, Feb 16, 2012 at 8:36 PM, Charles R Harris > wrote: >> >> >> On Thu, Feb 16, 2012 at 1:13 PM, Nathaniel Smith wrote: >>> >>> On Thu, Feb 16, 2012 at 5:17 PM, Travis Vaught wrote: >>> > On Feb 16, 2012, at 10:56 AM, Nathaniel Smit

Re: [Numpy-discussion] Numpy governance update

2012-02-16 Thread Christopher Jordan-Squire
On Thu, Feb 16, 2012 at 11:03 AM, Matthew Brett wrote: > Hi, > > On Thu, Feb 16, 2012 at 4:23 AM, Francesc Alted wrote: >> On Feb 16, 2012, at 12:15 PM, Jason Grout wrote: >> >>> On 2/15/12 6:27 PM, Dag Sverre Seljebotn wrote: But in the very end, when agreement can't be reached by othe

Re: [Numpy-discussion] Numpy governance update

2012-02-15 Thread Christopher Jordan-Squire
On Wed, Feb 15, 2012 at 5:26 PM, Mark Wiebe wrote: > On Wed, Feb 15, 2012 at 4:57 PM, wrote: >> >> On Wed, Feb 15, 2012 at 7:27 PM, Dag Sverre Seljebotn >> wrote: >> > On 02/15/2012 02:24 PM, Mark Wiebe wrote: >> >> On Wed, Feb 15, 2012 at 1:36 PM, Matthew Brett > >>

Re: [Numpy-discussion] Numpy governance update - was: Updated differences between 1.5.1 to 1.6.1

2012-02-15 Thread Christopher Jordan-Squire
On Tue, Feb 14, 2012 at 5:17 PM, Travis Oliphant wrote: >>> >>> Your points are well taken.   However, my point is that this has been >>> discussed on an open mailing list.   Things weren't *as* open as they could >>> have been, perhaps, in terms of board selection.  But, there was >>> opportun

Re: [Numpy-discussion] test code for user defined types in numpy

2011-12-20 Thread Christopher Jordan-Squire
On Tue, Dec 20, 2011 at 9:10 PM, Mark Wiebe wrote: > On Tue, Dec 20, 2011 at 6:24 PM, Geoffrey Irving wrote: >> >> Hello, >> >> As a followup to the prior thread on bugs in user defined types in >> numpy, I converted my rational number class from C++ to C and switched >> to 32 bits to remove the

Re: [Numpy-discussion] Problem with importing csv into datetime64

2011-09-28 Thread Christopher Jordan-Squire
On Wed, Sep 28, 2011 at 9:15 AM, Grové wrote: > Hi, > > I am trying out the latest version of numpy 2.0 dev: > > np.__version__ > Out[44]: '2.0.0.dev-aded70c' > > I am trying to import CSV data that looks like this: > > date,system,pumping,rgt,agt,sps,eskom_import,temperature,wind,pressure,weather

Re: [Numpy-discussion] sparse vectors / matrices / tensors

2011-09-20 Thread Christopher Jordan-Squire
On Tue, Sep 20, 2011 at 10:42 AM, Yannick Versley wrote: > Hi all, > I've been working quite a lot with sparse vectors and sparse matrices > (basically > as feature vectors in the context of machine learning), and have noticed > that they > do crop up in a lot of places (e.g. the CVXOPT library, i

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-14 Thread Christopher Jordan-Squire
On Wed, Sep 14, 2011 at 5:30 PM, Christopher Barker wrote: > On 9/14/11 2:41 PM, Benjamin Root wrote: >> Are you sure the f2 code works?  a.resize() takes only a shape tuple.  As >> coded, you should get an exception. > > wow, what an idiot! > > I think I just timed how long it takes to raise that

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-13 Thread Christopher Jordan-Squire
On Tue, Sep 13, 2011 at 3:43 AM, Pierre GM wrote: > > On Sep 13, 2011, at 01:38 , Christopher Jordan-Squire wrote: > >> I did some timings to see what the advantage would be, in the simplest >> case possible, of taking multiple lines from the file to process at a >>

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-13 Thread Christopher Jordan-Squire
On Tue, Sep 13, 2011 at 2:41 PM, Chris.Barker wrote: > On 9/12/11 4:38 PM, Christopher Jordan-Squire wrote: >> I did some timings to see what the advantage would be, in the simplest >> case possible, of taking multiple lines from the file to process at a >> time. > &

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-12 Thread Christopher Jordan-Squire
hings that have been discussed are either performance trade-offs or somewhat large re-engineering of the internals. -Chris JS On Thu, Sep 8, 2011 at 3:57 PM, Chris.Barker wrote: > On 9/8/11 1:43 PM, Christopher Jordan-Squire wrote: >> I just ran a quick test on my machine of this

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-08 Thread Christopher Jordan-Squire
On Wed, Sep 7, 2011 at 2:52 PM, Chris.Barker wrote: > On 9/2/11 2:45 PM, Christopher Jordan-Squire wrote: >> It doesn't have to parse the entire file to determine the dtypes. It >> builds up a regular expression for what it expects to see, in terms of >> dtypes. Then it

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-06 Thread Christopher Jordan-Squire
On Tue, Sep 6, 2011 at 9:32 AM, Derek Homeier wrote: > On 02.09.2011, at 11:45PM, Christopher Jordan-Squire wrote: >>>> >>>> and unfortunately it's for 1D-arrays only). >>> >>> That's not bad for this use -- make a row a struct dtype, and

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-02 Thread Christopher Jordan-Squire
On Fri, Sep 2, 2011 at 3:54 PM, Chris.Barker wrote: > On 9/2/11 9:16 AM, Christopher Jordan-Squire wrote: >>>> I agree it would make a very nice addition, and could complement my >>>> pre-allocation option for loadtxt - however there I've also been made >

Re: [Numpy-discussion] Pull Request Review: R-like sample function

2011-09-02 Thread Christopher Jordan-Squire
On Fri, Sep 2, 2011 at 12:58 PM, Nathaniel Smith wrote: > On Fri, Sep 2, 2011 at 10:14 AM, Christopher Jordan-Squire > wrote: >> I made the changes discussed here and pushed them to pull request. >> >> https://github.com/numpy/numpy/pull/143#issuecomment-1980897 &g

Re: [Numpy-discussion] Pull Request Review: R-like sample function

2011-09-02 Thread Christopher Jordan-Squire
On Thu, Sep 1, 2011 at 10:55 PM, Nathaniel Smith wrote: > On Thu, Sep 1, 2011 at 8:31 PM, Christopher Jordan-Squire > wrote: >> On Thu, Sep 1, 2011 at 11:14 PM, Robert Kern wrote: >>> On Thu, Sep 1, 2011 at 22:07, Christopher Jordan-Squire >>> wrote: >>&

Re: [Numpy-discussion] Pull Request Review: R-like sample function

2011-09-02 Thread Christopher Jordan-Squire
ranf and added them to the reference docs. -Chris JS On Thu, Sep 1, 2011 at 10:55 PM, Nathaniel Smith wrote: > On Thu, Sep 1, 2011 at 8:31 PM, Christopher Jordan-Squire > wrote: >> On Thu, Sep 1, 2011 at 11:14 PM, Robert Kern wrote: >>> On Thu, Sep 1, 2011 at 22:07,

Re: [Numpy-discussion] load from text files Pull Request Review

2011-09-02 Thread Christopher Jordan-Squire
Sorry I'm only now getting around to thinking more about this. Been side-tracked by stats stuff. On Fri, Sep 2, 2011 at 10:50 AM, Chris.Barker wrote: > On 9/2/11 8:22 AM, Derek Homeier wrote: >> I agree it would make a very nice addition, and could complement my >> pre-allocation option for loadt

Re: [Numpy-discussion] Pull Request Review: R-like sample function

2011-09-01 Thread Christopher Jordan-Squire
On Thu, Sep 1, 2011 at 11:14 PM, Robert Kern wrote: > On Thu, Sep 1, 2011 at 22:07, Christopher Jordan-Squire > wrote: > >> So in the mean time, are there any suggestions for what this R sample >> function should be called, since random.sample is apparently taken? > &g

Re: [Numpy-discussion] Pull Request Review: R-like sample function

2011-09-01 Thread Christopher Jordan-Squire
On Thu, Sep 1, 2011 at 10:48 PM, Robert Kern wrote: > On Thu, Sep 1, 2011 at 21:39, Christopher Jordan-Squire > wrote: >> On Thu, Sep 1, 2011 at 10:01 PM,   wrote: > >>> First these functions would need to be deprecated. >> >> I discussed this with a few othe

Re: [Numpy-discussion] Pull Request Review: R-like sample function

2011-09-01 Thread Christopher Jordan-Squire
On Thu, Sep 1, 2011 at 10:01 PM, wrote: > On Thu, Sep 1, 2011 at 6:02 PM, Christopher Jordan-Squire > wrote: >> Hi--I've just submitted a numpy 2.0 pull request for a function sample >> in np.random. It's essentially an implementation of R's sample >> f

[Numpy-discussion] Pull Request Review: R-like sample function

2011-09-01 Thread Christopher Jordan-Squire
Hi--I've just submitted a numpy 2.0 pull request for a function sample in np.random. It's essentially an implementation of R's sample function. It allows possibly non-uniform, possibly without-replacement sampling from a given 1-D array-like. This is very useful for quickly and cleanly creating sam

Re: [Numpy-discussion] non-uniform discrete sampling with given probabilities (w/ and w/o replacement)

2011-08-31 Thread Christopher Jordan-Squire
On Wed, Aug 31, 2011 at 3:34 PM, wrote: > On Wed, Aug 31, 2011 at 3:22 PM, Olivier Delalleau wrote: >> 2011/8/31 Christopher Jordan-Squire >>> >>> On Wed, Aug 31, 2011 at 2:07 PM, Olivier Delalleau wrote: >>> > You can use: >>> > 1 + nump

Re: [Numpy-discussion] non-uniform discrete sampling with given probabilities (w/ and w/o replacement)

2011-08-31 Thread Christopher Jordan-Squire
om.shuffle(z) That look right? -Chris JS > > 2011/8/31 Christopher Jordan-Squire >> >> In numpy, is there a way of generating a random integer in a specified >> range where the integers in that range have given probabilities? So, >> for example, generating a random int

[Numpy-discussion] non-uniform discrete sampling with given probabilities (w/ and w/o replacement)

2011-08-31 Thread Christopher Jordan-Squire
In numpy, is there a way of generating a random integer in a specified range where the integers in that range have given probabilities? So, for example, generating a random integer between 1 and 3 with probabilities [0.1, 0.2, 0.7] for the three integers? I'd like to know how to do this without re

Re: [Numpy-discussion] Question on LinAlg Inverse Algorithm

2011-08-30 Thread Christopher Jordan-Squire
Can you give an example matrix? I'm not a numerical linear algebra expert, but I suspect that if your matrix is singular (or nearly so, in floating point) then any inverse given will look pretty wonky. Huge determinant, eigenvalues, operator norm, etc.. -Chris JS On Tue, Aug 30, 2011 at 5:48 PM,

[Numpy-discussion] load from text files Pull Request Review

2011-08-27 Thread Christopher Jordan-Squire
Hi-- I've submitted a pull request for a new method for loading data from text files into a record array/masked record array. https://github.com/numpy/numpy/pull/143 Click on the link for more info, but the general idea is to create a regular expression for what entries should look like and loop

Re: [Numpy-discussion] NA mask C-API documentation

2011-08-26 Thread Christopher Jordan-Squire
Regarding ufuncs and NA's, all the mechanics of handling NA from a ufunc are in the PyUFunc_FromFuncAndData function, right? So the ufunc creation docs don't have to be updated to include NA's? -Chris JS On Wed, Aug 24, 2011 at 7:08 PM, Mark Wiebe wrote: > I've added C-API documentation to the m

Re: [Numpy-discussion] Statistical distributions on samples

2011-08-15 Thread Christopher Jordan-Squire
On Mon, Aug 15, 2011 at 8:53 AM, Andrea Gavana wrote: > Hi Chris and All, > > On 12 August 2011 16:53, Christopher Jordan-Squire wrote: > > Hi Andrea--An easy way to get something like this would be > > > > import numpy as np > > import scipy.stats as stats

Re: [Numpy-discussion] Statistical distributions on samples

2011-08-12 Thread Christopher Jordan-Squire
Hi Andrea--An easy way to get something like this would be import numpy as np import scipy.stats as stats sigma = #some reasonable standard deviation for your application x = stats.norm.rvs(size=1000, loc=125, scale=sigma) x = x[x>50] x = x[x<200] That will give a roughly normal distribution to

Re: [Numpy-discussion] dtype repr change?

2011-07-27 Thread Christopher Jordan-Squire
On Wed, Jul 27, 2011 at 3:09 PM, Robert Kern wrote: > On Wed, Jul 27, 2011 at 14:47, Mark Wiebe wrote: > > On Wed, Jul 27, 2011 at 2:44 PM, Matthew Brett > > wrote: > >> > >> Hi, > >> > >> On Wed, Jul 27, 2011 at 12:25 PM, Mark Wiebe wrote: > >> > On Wed, Jul 27, 2011 at 1:01 PM, Matthew Brett

Re: [Numpy-discussion] Array vectorization in numpy

2011-07-19 Thread Christopher Jordan-Squire
On Tue, Jul 19, 2011 at 11:19 AM, Charles R Harris < charlesr.har...@gmail.com> wrote: > > > On Tue, Jul 19, 2011 at 9:49 AM, Carlos Becker wrote: > >> I made more tests with the same operation, restricting Matlab to use a >> single processing unit. I got: >> >> - Matlab: 0.0063 sec avg >> - Numpy

Re: [Numpy-discussion] Masking entries in structured arrays

2011-07-14 Thread Christopher Jordan-Squire
On Thu, Jul 14, 2011 at 4:09 AM, Marcin Wlodarczak < mwlodarc...@uni-bielefeld.de> wrote: > > Hi, > > I was wondering whether it is possible to mask specific entries in a > structured array. If I try to do the following: > > x = ma.masked_array([(2, 1.), (8, 2.)], dtype=[('a',int), ('b', float)])

Re: [Numpy-discussion] NA/Missing Data Conference Call Summary

2011-07-06 Thread Christopher Jordan-Squire
On Wed, Jul 6, 2011 at 3:47 PM, wrote: > On Wed, Jul 6, 2011 at 4:38 PM, wrote: > > On Wed, Jul 6, 2011 at 4:22 PM, Christopher Jordan-Squire > > wrote: > >> > >> > >> On Wed, Jul 6, 2011 at 1:08 PM, wrote: > >>> > >>> On W

Re: [Numpy-discussion] using the same vocabulary for missing value ideas

2011-07-06 Thread Christopher Jordan-Squire
On Wed, Jul 6, 2011 at 5:38 PM, Benjamin Root wrote: > On Wednesday, July 6, 2011, Christopher Jordan-Squire > wrote: > > > > > > On Wed, Jul 6, 2011 at 5:03 PM, Benjamin Root wrote: > > > > On Wednesday, July 6, 2011, Dag Sverre Seljebotn > > wrote

Re: [Numpy-discussion] using the same vocabulary for missing value ideas

2011-07-06 Thread Christopher Jordan-Squire
On Wed, Jul 6, 2011 at 5:03 PM, Benjamin Root wrote: > On Wednesday, July 6, 2011, Dag Sverre Seljebotn > wrote: > > On 07/06/2011 08:25 PM, Christopher Barker wrote: > >> Mark Wiebe wrote: > >>> 1) NA vs IGNORE and bitpattern vs mask are completely independent. Any > >>> combination of NA as bi

Re: [Numpy-discussion] NA/Missing Data Conference Call Summary

2011-07-06 Thread Christopher Jordan-Squire
On Wed, Jul 6, 2011 at 1:08 PM, wrote: > On Wed, Jul 6, 2011 at 3:38 PM, Christopher Jordan-Squire > wrote: > > > > > > On Wed, Jul 6, 2011 at 11:38 AM, Christopher Barker < > chris.bar...@noaa.gov> > > wrote: > >> > >> Christopher Jordan

Re: [Numpy-discussion] towards a more productive missing values/masked arrays discussion...

2011-07-06 Thread Christopher Jordan-Squire
It'd be easier to follow if you just made changes/suggestions on github to Mark's NEP directly. (You can checkout Mark's missing data branch to get the NEP.) Then I'll be able to focus on the ways the suggestions differ or compliment the current NEP. -Chris Jordan-Squire On Wed, Jul 6, 2011 at 12

Re: [Numpy-discussion] NA/Missing Data Conference Call Summary

2011-07-06 Thread Christopher Jordan-Squire
On Wed, Jul 6, 2011 at 11:38 AM, Christopher Barker wrote: > Christopher Jordan-Squire wrote: > > If we follow those rules for IGNORE for all computations, we sometimes > > get some weird output. For example: > > [ [1, 2], [3, 4] ] * [ IGNORE, 7] = [ 15, 31 ]. (Where * is ma

Re: [Numpy-discussion] using the same vocabulary for missing value ideas

2011-07-06 Thread Christopher Jordan-Squire
On Wed, Jul 6, 2011 at 10:44 AM, Matthew Brett wrote: > Hi, > > On Wed, Jul 6, 2011 at 6:11 PM, Benjamin Root wrote: > > > > > > On Wed, Jul 6, 2011 at 12:01 PM, Matthew Brett > > wrote: > >> > >> Hi, > >> > >> On Wed, Jul 6, 2011 at 5:48 PM, Peter > >> wrote: > >> > On Wed, Jul 6, 2011 at 5:38

Re: [Numpy-discussion] NA/Missing Data Conference Call Summary

2011-07-06 Thread Christopher Jordan-Squire
st > > I'm mostly relaying stuff I said, although generally (please do > correct me if I am wrong) I am just re-expressing points that > Nathaniel has already made in the alterNEP text and the emails. > > On Wed, Jul 6, 2011 at 12:46 AM, Christopher Jordan-Squire > wrote: >

[Numpy-discussion] NA/Missing Data Conference Call Summary

2011-07-05 Thread Christopher Jordan-Squire
Here's a short-ish summary of the topics discussed in the conference call this afternoon. WARNING: I try to give examples for everything discussed to make it as concrete as possible. However, most of the examples were not explicitly discussed during the conference. I apologize in advance if I misch

Re: [Numpy-discussion] alterNEP - was: missing data discussion round 2

2011-07-01 Thread Christopher Jordan-Squire
This is kind of late to be jumping into the 'long thread of doom', but I've been following most of the posts, so I'd figured I'd throw in my 2 cents. I'm Mark's officemate over the summer, and we've been talking daily about his design. I was skeptical of various details at first, but by now Mark's