Re: [Numpy-discussion] GSoC?

2016-02-17 Thread Andy Ray Terrel
On Wed, Feb 17, 2016 at 12:57 PM, Chris Barker 
wrote:

> Apparetnly, NumFocus is applyign to be a GSoC Umbrella org as well:
>
> https://github.com/numfocus/gsoc
>
> Not sure why one might choose NumFocus vs PSF...
>
>
No reason to choose, you can get students from both orgs.


> -Chris
>
>
> On Wed, Feb 17, 2016 at 6:05 AM, Bryan Van de Ven 
> wrote:
>
>> [This is a complete tangent, and so I apologize in advance.]
>>
>> We are considering applying to GSOC for Bokeh. However, I have zero
>> experience with GSOC, but non-zero questions (e.g. go it alone, vs apply
>> through PSF... I think?) If anyone with experience from the mentoring
>> organization side of things wouldn't mind a quick chat (or a few emails) to
>> answer questions, share your experience, or offer advice, please drop me a
>> line directly.
>>
>> Thanks,
>>
>> Bryan
>>
>>
>>
>> > On Feb 17, 2016, at 1:14 AM, Stephan Hoyer  wrote:
>> >
>> > On Wed, Feb 10, 2016 at 4:22 PM, Chris Barker 
>> wrote:
>> > We might consider adding "improve duck typing for numpy arrays"
>> >
>> > care to elaborate on that one?
>> >
>> > I know it come up on here that it would be good to have some code in
>> numpy itself that made it easier to make array-like objects (I.e. do
>> indexing the same way) Is that what you mean?
>> >
>> > I was thinking particularly of improving the compatibility of numpy
>> functions (e.g., concatenate) with non-numpy array-like objects, but now
>> that you mention it utilities to make it easier to make array-like objects
>> could also be a good thing.
>> >
>> > In any case, I've now elaborated on my thought into a full project idea
>> on the Wiki:
>> >
>> https://github.com/scipy/scipy/wiki/GSoC-2016-project-ideas#improved-duck-typing-support-for-n-dimensional-arrays
>> >
>> > Arguably, this might be too difficult for most GSoC students -- the API
>> design questions here are quite contentious. But given that "Pythonic
>> dtypes" is up there as a GSoC proposal still it's in good company.
>> >
>> > Cheers,
>> > Stephan
>> >
>> > ___
>> > NumPy-Discussion mailing list
>> > NumPy-Discussion@scipy.org
>> > https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>> ___
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> chris.bar...@noaa.gov
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] How to find indices of values in an array (indirect in1d) ?

2015-12-30 Thread Andy Ray Terrel
Using pandas one can do:

>>> A = np.array([2,0,1,4])
>>> B = np.array([1,2,0])
>>> s = pd.Series(range(len(B)), index=B)
>>> s[A].values
array([  1.,   2.,   0.,  nan])



On Wed, Dec 30, 2015 at 8:45 AM, Nicolas P. Rougier <
nicolas.roug...@inria.fr> wrote:

>
> I’m scratching my head around a small problem but I can’t find a
> vectorized solution.
> I have 2 arrays A and B and I would like to get the indices (relative to
> B) of elements of A that are in B:
>
> >>> A = np.array([2,0,1,4])
> >>> B = np.array([1,2,0])
> >>> print (some_function(A,B))
> [1,2,0]
>
> # A[0] == 2 is in B and 2 == B[1] -> 1
> # A[1] == 0 is in B and 0 == B[2] -> 2
> # A[2] == 1 is in B and 1 == B[0] -> 0
>
> Any idea ? I tried numpy.in1d with no luck.
>
>
> Nicolas
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] numpy.power -> numpy.random.choice Probabilities don't sum to 1

2015-12-19 Thread Andy Ray Terrel
A simple fix would certainly by pass the check in random.choice, but I
don't know how to get that. So let's focus on the summation.

I believe you are hitting an instability in summing small numbers as a
power to 10th order would produce. Here is an example:

mymatrix = np.random.rand(1024,1024).astype('float16')*1e-7
row_normalized = mymatrix / np.sum(mymatrix, axis=1, keepdims=True)
sums = row_normalized.sum(axis=1)
len(sums[sums != 1]) # ->  108

One can use things like Kahan summation and you will need to collect the
size of the error and truncate all numbers in mymatrix under that error.
I'm not quite sure how to quickly implement such a thing in numpy without a
loop.

On Fri, Dec 18, 2015 at 7:00 PM, Nathaniel Smith  wrote:

> On Fri, Dec 18, 2015 at 1:25 PM, Ryan R. Rosario 
> wrote:
> > Hi,
> >
> > I have a matrix whose entries I must raise to a certain power and then
> normalize by row. After I do that, when I pass some rows to
> numpy.random.choice, I get a ValueError: probabilities do not sum to 1.
> >
> > I understand that floating point is not perfect, and my matrix is so
> large that I cannot use np.longdouble because I will run out of RAM.
> >
> > As an example on a smaller matrix:
> >
> > np.power(mymatrix, 10, out=mymatrix)
> > row_normalized = np.apply_along_axis(lambda x: x / np.sum(x), 1,
> mymatrix)
>
> I'm sorry I don't have a solution to your actual problem off the top
> of my head, but it's probably helpful in general to know that a better
> way to write this would be just
>
>   row_normalized = mymatrix / np.sum(mymatrix, axis=1, keepdims=True)
>
> apply_along_axis is slow and can almost always be replaced by a
> broadcasting expression like this.
>
> > sums = row_normalized.sum(axis=1)
> > sums[np.where(sums != 1)]
>
> And here you can just write
>
>   sums[sums != 1]
>
> i.e. the call to where() isn't doing anything useful.
>
> -n
>
> --
> Nathaniel J. Smith -- http://vorpus.org
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] performance solving system of equations in numpy and MATLAB

2015-12-17 Thread Andy Ray Terrel
On Thu, Dec 17, 2015 at 5:52 AM, Sturla Molden 
wrote:

> On 17/12/15 12:06, Francesc Alted wrote:
>
> Pretty good.  I did not know that OpenBLAS was so close in performance
>> to MKL.
>>
>
> MKL, OpenBLAS and Accelerate are very close in performance, except for
> level-1 BLAS where Accelerate and MKL are better than OpenBLAS.
>
> MKL requires the number of threads to be a multiple of four to achieve
> good performance, OpenBLAS and Accelerate do not. It e.g. matters if you
> have an online data acquisition and DSP system and want to dedicate one
> processor to take care of i/o tasks. In this case OpenBLAS and Accelerate
> are likely to perform better than MKL.
>
>
The last time I benchmarked them MKL was much better at tall skinny
matrices.


>
> Sturla
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Should dtypes have an ndim attribute?

2015-12-10 Thread Andy Ray Terrel
That's essentially what datashape did over in the blaze ecosystem. It gets
a bit fancier to support ragged arrays and optional types.

http://datashape.readthedocs.org/en/latest/
On Dec 10, 2015 5:14 AM, "Gerrit Holl"  wrote:

> Hi,
>
> I have made a modest proposal in issue #6752
> .  Basically, the proposal
> is to add an `ndim` attribute to dtypes.  Currently, arrays have a
> shape and an ndim attribute, where ndim equals len(shape).  dtype
> objects have a shape attribute, but no corresponding ndim.
>
> An ndim attribute would help in immediately determining whether a
> field in a structured dtype is multidimensional or not.
>
> Thoughts?
>
> Gerrit.
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] problems with mailing list ?

2014-07-18 Thread Andy Ray Terrel
The Enthought support tells me this is fixed now. Please let me know
if otherwise.

On Fri, Jul 18, 2014 at 8:09 AM, Derek Homeier
 wrote:
> On 18 Jul 2014, at 01:07 pm, josef.p...@gmail.com wrote:
>
>> Are the problems with sending out the messages with the mailing lists?
>>
>> I'm getting some replies without original messages, and in some threads I 
>> don't get replies, missing part of the discussions.
>>
> There seem to be problems with the Scipy list server; my last mails to 
> astr...@scipy.org have taken
> 12-18 hours before they made it to the list, and some people here reported 
> messages staying in the
> void for several days. But I think it’s been reported to Enthought already.
>
> Derek
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Mailing list slowdown (was Re: __numpy_ufunc__)

2014-07-18 Thread Andy Ray Terrel
We think this is fixed now. Let me know if it is otherwise.

On Thu, Jul 17, 2014 at 7:04 AM, Nathaniel Smith  wrote:
> On 17 Jul 2014 11:51, "Sebastian Berg"  wrote:
>>
>> On Mi, 2014-07-16 at 09:07 +0100, Nathaniel Smith wrote:
>> > Weirdly, I never received Chuck's original email in this thread.
>> > Should some list admin be informed?
>> >
>>
>> I send some mails yesterday and they never arrived... Not sure if it is
>> a problem on my side or not.
>
> I did eventually get Chuck's original message, but not until several days
> later.
>
> CC'ing postmas...@enthought.com in case they have some insight into what's
> going on!
>
> -n
>
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] problems with mailing list ?

2014-07-18 Thread Andy Ray Terrel
Yes I've filed a ticket with Enthought.

On Fri, Jul 18, 2014 at 7:07 AM,   wrote:
> Are the problems with sending out the messages with the mailing lists?
>
> I'm getting some replies without original messages, and in some threads I
> don't get replies, missing part of the discussions.
>
>
> Josef
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Python parallel programming on Mac OS X Maverick

2013-10-28 Thread Andy Ray Terrel
Hi Siegfried,

Parallel programs, just like serial programs, will consume as much (or
as little) memory as they are required to do so.  The Python
interpreter and Numpy libraries all fit under 20 MB. So even a haswell
with its 4 cores is going to be insignificant overhead for running
Python in parallel.

-- Andy

On Mon, Oct 28, 2013 at 11:34 AM, Siegfried Gonzi
 wrote:
> Hi all
>
> Quick question: What is the minimum RAM requirement for doing parallel 
> programming with Python/Numpy on Mac OS X Maverick?
>
> I am about to buy a Macbook Pro 15" and I'd like to know if 8GB RAM (with SSD 
> flash storage) for the Haswell quad core will be enough. I have never done 
> any parallel programming with Python/Numpy but plan to get to grips with it 
> on my new Macbook Pro where memory from now on is being soldered on and 
> non-replaceable.
>
> Apple has a 14 days no quibbles refund policy but I am not sure if I can work 
> out what I need within 14 days.
>
>
> Thanks,
> Siegfried
> --
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> ___
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion