On Fri, Jul 18, 2014 at 3:37 AM, Nathaniel Smith n...@pobox.com wrote:
On Thu, Jul 17, 2014 at 11:10 PM, Charles G. Waldman char...@crunch.io
wrote:
-1 on the 'arr' name. I think if we're going to support this function
at all (which I'm not convinced is a good idea), it should be
I'd love to see something like a count_unique function included. The
numpy.unique function is handy, but it can be a little awkward to
efficiently go back and get counts of each unique value after the
fact.
-Mark
On Wed, Jun 1, 2011 at 8:17 AM, Keith Goodman kwgood...@gmail.com wrote:
On Tue,
...@gmail.com wrote:
On Wed, Jun 1, 2011 at 11:31 AM, Mark Miller markperrymil...@gmail.com
wrote:
I'd love to see something like a count_unique function included. The
numpy.unique function is handy, but it can be a little awkward to
efficiently go back and get counts of each unique value
Not pretty, but it works:
idx
array([[4, 2],
[3, 1]])
times
array([100, 101, 102, 103, 104])
numpy.reshape(times[idx.flatten()],idx.shape)
array([[104, 102],
[103, 101]])
On Tue, Jun 8, 2010 at 10:09 AM, Gökhan Sever gokhanse...@gmail.com wrote:
On Tue, Jun 8,
You're just trying to do this...correct?
import numpy
items = numpy.array([0,3,2,1,4,2],dtype=int)
unique = numpy.unique(items)
unique
array([0, 1, 2, 3, 4])
counts=numpy.histogram(items,unique)
counts
(array([1, 1, 2, 1, 1]), array([0, 1, 2, 3, 4]))
counts[0]
array([1, 1, 2, 1, 1])
On
To anyone who can help:
I recently got around to installing numpy 1.04 over an older version (numpy
1.04dev3982) on a Windows Vista machine. Since then, I have been unable to
compile some of my extensions using f2py. I also tested a fresh install of
numpy 1.04 on a new XP machine that has never
To anyone who can help:
I recently got around to installing numpy 1.04 over an older version (numpy
1.04dev3982) on a Windows Vista machine. Since then, I have been unable to
compile some of my extensions using f2py. I also tested a fresh install of
numpy 1.04 on a new XP machine that has never
Super...I'll give it a try. Or should I just wait for the numpy 1.1
release?
thanks,
-Mark
On Fri, May 23, 2008 at 2:45 PM, Robert Kern [EMAIL PROTECTED] wrote:
On Fri, May 23, 2008 at 4:00 PM, Mark Miller [EMAIL PROTECTED] wrote:
File C:\Python25\lib\site-packages\numpy\f2py\rules.py
up, I rarely need to fiddle with them
again. So I don't have a specific feel for what might be happening here.
thanks,
-Mark
On Fri, May 23, 2008 at 3:01 PM, Robert Kern [EMAIL PROTECTED] wrote:
On Fri, May 23, 2008 at 4:48 PM, Mark Miller [EMAIL PROTECTED]
wrote:
Super...I'll give
Ignore last message: I seem to have figured out the next environmental
variable that needed to be set. Still some lingering issues, but I'll work
on them some more before pestering here again.
thanks,
-Mark
On Fri, May 23, 2008 at 3:48 PM, Mark Miller [EMAIL PROTECTED]
wrote:
Thank you
It appears to be there: dllcrt2.o in g95\lib.
I'll re-install g95 to see if it helps. I'll also give gfortran in the
meantime too.
-Mark
On Fri, May 23, 2008 at 4:05 PM, Robert Kern [EMAIL PROTECTED] wrote:
On Fri, May 23, 2008 at 5:59 PM, Mark Miller [EMAIL PROTECTED]
wrote
gfortran is doing the trick. Must be a g95 misconfiguration or some other
thing that I have no ability to comprehend.
Thanks for the tip about the buggy numpy 1.04. That seemed to be the most
serious hurdle.
-Mark
On Fri, May 23, 2008 at 4:12 PM, Mark Miller [EMAIL PROTECTED]
wrote
On Thu, Jul 17, 2008 at 3:18 PM, Pierre GM [EMAIL PROTECTED] wrote:
Dang, forgot about that. Having a dictionary of options would be cool, but
we
can't store it inside a regular ndarray. If we write to a file, we may want
to write a header first that would store all the metadata we need.
Just for my own benefit, I am curious about this.
I am running into problems because I need to archive the result (tuple)
returned by a numpy.where statement. Pickle does not seem to like to deal
with numpy scalars, and numpy's archiving functions (memmap) can't work on
the tuple that gets
If numpy is installed, then f2py will be too. On the windows environment,
there is a file called f2py.py that you can call from the command line. It
should be in the 'scripts' directory of your Python installation.
Try something like this:
python c:\python25\scripts\f2py.py
(of course change
Warning, errors, and failures here on XP Pro (numpy installed with the
python 2.5 superpack).
Just passing it along, and apologies if these have already been caught.
import numpy
numpy.__version__
'1.2.0rc2'
numpy.test()
Running unit tests for numpy
NumPy version 1.2.0rc2
NumPy is installed
OK..thanks. That did the trick. All clear now, save for 3 known failures.
Again, thanks for letting me know about this.
-Mark
On Mon, Sep 15, 2008 at 11:03 AM, Jarrod Millman [EMAIL PROTECTED]wrote:
On Mon, Sep 15, 2008 at 10:49 AM, Mark Miller [EMAIL PROTECTED]
wrote:
Warning, errors
Out of curiosity, why wouldn't numpy.apply_along_axis be a reasonable
approach here. Even more curious: why is it slower than the original
explicit loop?
Learning,
-Mark
import numpy as np
import timeit
def baseshuffle(nx, ny):
x = np.arange(nx)
res = np.zeros((nx,ny),int)
for
Got it. Thanks!
On Tue, Feb 10, 2009 at 1:50 PM, Keith Goodman kwgood...@gmail.com wrote:
On Tue, Feb 10, 2009 at 1:41 PM, Mark Miller markperrymil...@gmail.com
wrote:
Out of curiosity, why wouldn't numpy.apply_along_axis be a reasonable
approach here. Even more curious: why is it slower
I'm not 100% sure that I get the question, but does this help at all?
>>> a = numpy.array([3,2,8,7])
>>> b = numpy.array([1,3,2,4,5,7,6,8,9])
>>> c = set(a) & set(b)
>>> c #contains elements of a that are in b (and vice versa)
set([8, 2, 3, 7])
>>> indices = numpy.where([x in c for x in b])[0]
, Nicolas P. Rougier <
nicolas.roug...@inria.fr> wrote:
>
> Yes, it is the expected result. Thanks.
> Maybe the set(a) & set(b) can be replaced by np.where[np.in1d(a,b)], no ?
>
> > On 30 Dec 2015, at 18:42, Mark Miller <markperrymil...@gmail.com> wrote:
> &
21 matches
Mail list logo