int(1e6))
timeit np.sum(np.square(x- 2.))
10 loops, best of 3: 23 ms per loop
y= x- 2.
timeit np.dot(y, y)
The slowest run took 18.60 times longer than the fastest. This could mean
that an intermediate result is being cached.
1000 loops, best of 3: 1.78 ms per loop
timeit np.dot(y, y)
1000 loops, b
*.[2]
http://en.wikipedia.org/wiki/Matrix_%28mathematics%29#cite_note-2[3]
http://en.wikipedia.org/wiki/Matrix_%28mathematics%29#cite_note-3
(and in this context also python objects).
-eat
The individual items in a matrix are called its *elements* or *entries*.
An example of a matrix with 2
there
it doesn't look like np.array's handling of non-conformable lists has
any defenders.)
+1 for 'object array [and matrix] construction should require explicitly
specifying dtype= object'
-eat
--
Nathaniel J. Smith
Postdoctoral researcher - Informatics - University of Edinburgh
http
. Thus the diagonal of such hat matrix would be (u[:, :r]** 2).sum(1).
Regards,
-eat
Sorry for off-topic...
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Mon, Feb 10, 2014 at 9:08 PM, alex argri...@ncsu.edu wrote:
On Mon, Feb 10, 2014 at 2:03 PM, eat e.antero.ta...@gmail.com wrote:
Rhetorical or not, but FWIW I'll prefer to take singular value
decomposition
(u, s, vt= svd(x)) and then based on the singular values s I'll estimate
, 25],
[ 6, 36],
[ 7, 49],
[ 8, 64],
[ 9, 81]])
My 2 cents,
-eat
Creating two 1-dimensional arrays first is costly as one has to
iterate twice over the data. So the only way I see is creating an
empty [10,2] array and filling it row by row. This is memory-efficient
', 'f4', (4, 4))])
My 2 cents,
-eat
Nicolas
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy
uninitiated?
Regards,
-eat
Josef
Ben Root
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
Hi,
On Fri, Jan 18, 2013 at 12:13 AM, Thouis (Ray) Jones tho...@gmail.comwrote:
On Thu, Jan 17, 2013 at 10:27 AM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Wed, Jan 16, 2013 at 5:11 PM, eat e.antero.ta...@gmail.com wrote:
Hi,
In a recent thread
http
.
What do you think?
-eat
P.S. FWIW, if this idea really gains momentum obviously I'm volunteering to
create a PR of it.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
],
[11, 9],
[23, 12]])
-eat
Best regards,
Mads
--
+-+
| Mads Ipsen |
+--+--+
| Gåsebæksvej 7, 4. tv | |
| DK-2500
Hi,
On Mon, Oct 29, 2012 at 11:01 AM, Larry Paltrow larry.palt...@gmail.comwrote:
np.isnan(data) is True
False
Check with:
np.all(~np.isnan(x))
My 2 cents,
-eat
On Mon, Oct 29, 2012 at 1:50 AM, Pauli Virtanen p...@iki.fi wrote:
Larry Paltrow larry.paltrow at gmail.com writes:
I'm
)
generator object genexpr at 0x062BDA08
In []: print np.prod([(arg 0) for arg in args])
1
In []: print np.prod( (arg 0) for arg in args).next()
True
In []: sys.version
Out[]: '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]'
In []: np.version.version
Out[]: '1.6.0'
My 2 cents,
-eat
]])
In []: # second largest
In []: a[a.argsort(0), ndx[1], ndx[2]][-2]
Out[]:
array([[4, 2, 4, 4],
[5, 4, 4, 4]])
My 2 cents,
-eat
Angus.
--
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
___
NumPy-Discussion
[b_indices[::-1]]
new_b = b_matrix[len(b_matrix)-1]
Is there an easy way to reorder it? Or is there at least a complicated
way which produces the right output?
I hope you can help me! Thanks!
My 2 cents,
-eat
Best regards,
Nicole
___
NumPy
Hi,
On Tue, Jul 31, 2012 at 10:23 AM, Vlastimil Brom
vlastimil.b...@gmail.comwrote:
2012/7/30 eat e.antero.ta...@gmail.com:
Hi,
A partial answer to your questions:
On Mon, Jul 30, 2012 at 10:33 PM, Vlastimil Brom
vlastimil.b...@gmail.com
wrote:
Hi all,
I'd like to ask
Hi,
On Tue, Jul 31, 2012 at 5:01 PM, Vlastimil Brom vlastimil.b...@gmail.comwrote:
2012/7/31 eat e.antero.ta...@gmail.com:
Hi,
On Tue, Jul 31, 2012 at 10:23 AM, Vlastimil Brom
vlastimil.b...@gmail.com
wrote:
2012/7/30 eat e.antero.ta...@gmail.com:
Hi,
A partial answer
Hi,
On Tue, Jul 31, 2012 at 6:43 PM, Nathaniel Smith n...@pobox.com wrote:
On Tue, Jul 31, 2012 at 2:23 PM, eat e.antero.ta...@gmail.com wrote:
Apparently ast(.) does not return a view of the original matches rather a
copy of size (n* (2* distance+ 1)), thus you may run out of memory
Hi,
On Tue, Jul 31, 2012 at 7:30 PM, Nathaniel Smith n...@pobox.com wrote:
On Tue, Jul 31, 2012 at 4:57 PM, eat e.antero.ta...@gmail.com wrote:
Hi,
On Tue, Jul 31, 2012 at 6:43 PM, Nathaniel Smith n...@pobox.com wrote:
On Tue, Jul 31, 2012 at 2:23 PM, eat e.antero.ta...@gmail.com
Hi,
On Tue, Jul 31, 2012 at 7:20 PM, Vlastimil Brom vlastimil.b...@gmail.comwrote:
2012/7/31 eat e.antero.ta...@gmail.com:
Hi,
On Tue, Jul 31, 2012 at 5:01 PM, Vlastimil Brom
vlastimil.b...@gmail.com
wrote:
2012/7/31 eat e.antero.ta...@gmail.com:
Hi,
On Tue, Jul 31, 2012
?)
And of course, are there maybe other things, which should be made
better/differently?
(using Numpy 1.6.2, python 2.7.3, win XP)
My 2 cents,
-eat
Thanks in advance for any hints or suggestions,
regards,
Vlastimil Brom
___
NumPy
array.
However, perhaps something like the following lines will help you:
In []: lot= zip(a_clean, b_clean)
In []: lot
Out[]: [(4, 3), (4, 5), (5, 4), (4, 4), (4, 3), (4, 4)]
In []: [[x, lot.count(x)] for x in set(lot)]
Out[]: [[(4, 5), 1], [(5, 4), 1], [(4, 4), 2], [(4, 3), 2]]
My 2 cents,
-eat
state that x and y must be
one dimensional and they must be equal length.
My 2 cents,
-eat
On Fri, Jul 20, 2012 at 5:11 PM, Andreas Hilboll li...@hilboll.de wrote:
Hi,
I have a problem using histogram2d:
from numpy import linspace, histogram2d
bins_x = linspace(-180., 180., 360
exists into python list of lists? If all my processing before
the munkres step is using NumPy, converting it into python lists has a
cost. Also, your timings indicate only ~2x slowdown, while the timing
tests done by eat show an order-of-magnitude difference. I suspect there
is great room
for example at
http://www.assignmentproblems.com/).
How the assignment algorithms are (typically) described, it actually may be
quite a tedious job to create more performance ones utilizing numpy arrays
instead of lists of lists.
My 2 cents,
-eat
http://pypi.python.org/pypi/munkres
, 0.54991376, 0.78182313],
[ 0.42980812, 0.59622975, 0.29315485, 0.3828001 ],
[ 0., 0., 0., 0.],
[ 0., 0., 0., 0.]])
will help you.
My 2 cents,
-eat
___
NumPy
0.2 0.3 0.4 0.17 0.33 0.5 ]
Fast enough:
In []: data, lengths= gen([5, 15, 5e4])
In []: data.size
Out[]: 476028
In []: %timeit normalize(data, lengths)
10 loops, best of 3: 29.4 ms per loop
My 2 cents,
-eat
-- srean
On Thu, May 31, 2012 at 12:36 AM, Wolfgang Kerzendorf
wkerzend
encountered in divide
My 2 cents,
-eat
Chao
--
***
Chao YUE
Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
UMR 1572 CEA-CNRS-UVSQ
Batiment 712 - Pe 119
91191 GIF Sur YVETTE Cedex
Tel: (33
]],
[[ 1, 2, 15, 28],
[17, 18, 9, 20],
[-1, 2, 23, 4]]])
My 2 cents,
-eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
loop
In []: timeit s1(y, u)
100 loops, best of 3: 2.16 ms per loop
In []: 122/ 2.16
Out[]: 56.48148148148148
My 2 cents,
-eat
will accumulate and give y = [1,7,14,22]
Sameer
Am I missing something?
Regards,
Francesco
Sameer Grover wrote:
On Saturday 07 April 2012 12:14 AM
= np.random.randn(5, 3)
print np.corrcoef(data).round(3)
print
c= Correlations(data)
print np.array([p for p in c.obs_iterate()]).round(3)
My 2 cents,
-eat
Best regards,
Nicole Stoffels
--
Dipl.-Met. Nicole Stoffels
Wind Power Forecasting and Simulation
ForWind - Center for Wind
, 1, 1, 48, 68, 1, 75, 1, 1, 115, 1, 95, 1,
1, 1, 1, 1, 1, 1, 28, 1, 68, 1, 1, 28])
My 2 cents,
-eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman
this issue is raised also earlier, but wouldn't it be more consistent
to let arange operate only with integers (like Python's range) and let
linspace handle the floats as well?
My 2 cents,
eat
Eric
___
NumPy-Discussion mailing list
NumPy
= t2)
x = cond(data).reshape((m//4, 4, n//4, 4))
found = np.any(np.any(x, axis=1), axis=2)
Regards,
eat
Sturla
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
= np.where((excerpt= t1) (excerpt= t2), True, False)
return mask.sum(2).sum(2).astype(np.bool)
if __name__ == '__main__':
from numpy.random import randint
r= randint(777, size= (64, 288)); print r
print np.allclose(ds_0(r), ds_1(r))
My 2 cents,
eat
153 ..., 316 613 570]]
True
and compared in performance wise:
In []: %timeit ds_0(r)
10 loops, best of 3: 56.3 ms per loop
In []: %timeit ds_1(r)
100 loops, best of 3: 2.17 ms per loop
My 2 cents,
eat
Catherine
___
NumPy-Discussion mailing list
On Sat, Jan 28, 2012 at 11:14 PM, Charles R Harris
charlesr.har...@gmail.com wrote:
On Sat, Jan 28, 2012 at 11:15 AM, eat e.antero.ta...@gmail.com wrote:
Hi,
Short demonstration of the issue:
In []: sys.version
Out[]: '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit
(Intel
not face this issue)
or
- it's just the 'nature' of computations with float values (if so, probably
I should be able to tackle this regardless of the polynomial order)
or
- it's a nasty bug in class Polynomial
Regards,
eat
___
NumPy-Discussion mailing list
[]: 3045.74724
Or does the results of calculations depend more on the platform?
My 2 cents,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
of whether it is a version or
platform related problem.
-eat
On Tue, 2012-01-24 at 17:12 -0600, eat wrote:
Hi,
Oddly, but numpy 1.6 seems to behave more consistent manner:
In []: sys.version
Out[]: '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit
(Intel
over complicated unless I'm not able to request
a stable sorting order from np.unique(.) (like np.unique(., return_index=
True, kind= 'mergesort').
(FWIW, I apparently do have a working local hack for this kind of
functionality, but without extensive testing of 'all' corner cases).
Thanks,
eat
Hi,
On Tue, Dec 20, 2011 at 2:33 AM, josef.p...@gmail.com wrote:
On Mon, Dec 19, 2011 at 6:27 PM, eat e.antero.ta...@gmail.com wrote:
Hi,
Especially when the keyword return_index of np.unique(.) is specified to
be
True, would it in general also be reasonable to be able to specify
Hi,
On Tue, Dec 20, 2011 at 3:41 AM, josef.p...@gmail.com wrote:
On Mon, Dec 19, 2011 at 8:16 PM, eat e.antero.ta...@gmail.com wrote:
Hi,
On Tue, Dec 20, 2011 at 2:33 AM, josef.p...@gmail.com wrote:
On Mon, Dec 19, 2011 at 6:27 PM, eat e.antero.ta...@gmail.com wrote:
Hi
]
[1,2,1,2]
[3,4,3,4]]
i tried different things on numpy which didn't work
any ideas ?
Perhaps something like this:
In []: a= np.array([[1, 2], [3, 4]])
In []: np.c_[[a, a], [a, a]]
Out[]:
array([[[1, 2, 1, 2],
[3, 4, 3, 4]],
[[1, 2, 1, 2],
[3, 4, 3, 4]]])
Regards,
eat
., 3., 4., 4.],
[ 3., 3., 4., 4.]])
But, of'course this is way more generic (and preferable) approach to
utilize.
eat
Josef
Cheers!
Ben Root
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org
],
[6, 7, 8, 9, 0],
[7, 8, 9, 0, 1]])
Regards,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion
Hi
On Mon, Aug 1, 2011 at 3:14 PM, Jeffrey Spencer jeffspenc...@gmail.comwrote:
Depends where it is contained but another option is and I find it to
typically be faster:
B = zeros(A.shape)
maximum(A,B,A)
Since maximum(.) can handle broadcasting
maximum(A, 0, A)
will be even faster.
-eat
[]:
C_CONTIGUOUS : True
F_CONTIGUOUS : False
OWNDATA : False
WRITEABLE : True
ALIGNED : True
UPDATEIFCOPY : False
Seems to be slightly inconsistent, but does it really matter?
-eat
This on Linux 64 with latest master.
Chuck
___
NumPy
))
0.058299207687377931
More like:
In []: %timeit m =- .5
1000 loops, best of 3: 35 ns per loop
-eat
t=timeit.Timer('m -= 0.5', setup='import numpy as np;m =
np.ones([8092,8092],float)')
np.mean(t.repeat(repeat=10, number=1))
0.28192551136016847
t=timeit.Timer('np.subtract(m, 0.5, m
on a
square 5x5 matrix? Something like:
A_pinv= dot(A, pinv(dot(A.T, A))).T
Instead of a 380x380 based matrix:
A_pinv= dot(pinv(dot(A, A.T)), A).T
My two cents
- eat
-- Lou Pecora, my views are my own.
___
NumPy-Discussion mailing list
NumPy
cause of NaNs. But
I believe there exists plenty other much more sophisticated situations where
this kind of simple treatment is not sufficient, at all. Anyway, even in
the future it should still be possible to play nicely with these kind of
simple scenarios.
- eat
Thanks,
Jason
'missing data' is not doable.
Thanks,
- eat
-Mark
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
On Mon, Jun 27, 2011 at 8:53 PM, Mark Wiebe mwwi...@gmail.com wrote:
On Mon, Jun 27, 2011 at 12:44 PM, eat e.antero.ta...@gmail.com wrote:
Hi,
On Mon, Jun 27, 2011 at 6:55 PM, Mark Wiebe mwwi...@gmail.com wrote:
First I'd like to thank everyone for all the feedback you're providing
cents,
eat
___
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
://docs.scipy.org/doc/scipy/reference/odr.html
My 2 cents,
eat
Regards, Christian K.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
[]: True
In [1061]: [3, 1, 4] in A
Out[1061]: True
But
In []: [1, 2, 3] in A
Out[]: False
In []: [3, 2, 1] in A
Out[]: True
So, obviously the logic behind __contains__ is not so very straightforward.
Perhaps just a bug?
Regards,
eat
The docstring is not helpful:
In [58]: np.ndarray
, -1)
U= np.r_[u0, u1, u2, np.ones((1, n** 3))]
f= (np.dot(E, U)* U).sum(0).reshape(n, n, n)
Regards,eat
Thanks Eleanor
--
View this message in context:
http://old.nabble.com/Need-to-eliminate-a-nested-loop-tp31591457p31591457.html
Sent from the Numpy-discussion mailing list archive
()
bbins= (bins[:-1]+ d).ravel()
bbins= r_[bbins, bbins[-1]+ 1]
counts, _= histogram(b, bbins)
return counts.reshape(-1, nob), bins
It has two disadvantages 1) needs more memory and 2) global bins
(which although should be quite straightforward to enhance if needed).
Regards,
eat
on. Just wondering if this kind
massive histogramming could be somehow avoided totally.
Regards,
eat
Éric.
So it seems that you give your array directly to histogramdd (asking a
4000D histogram!). Surely that's not what you are trying to achieve. Can
you elaborate more on your objectives
with probability q=1-p?
Would it be sufficient to:
In []: bs= ones(1e6, dtype= int)
In []: bs[randint(0, 1e6, 1e5)]= 0
In []: bs.sum()/ 1e6
Out[]: 0.904706
Regards,
eat
thanks
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http
On Tue, Mar 29, 2011 at 1:29 PM, eat e.antero.ta...@gmail.com wrote:
Hi,
On Tue, Mar 29, 2011 at 12:00 PM, Alex Ter-Sarkissov
ater1...@gmail.comwrote:
If I want to generate a string of random bits with equal probability I run
random.randint(0,2,size).
What if I want a specific
parameters using np.histogram.
FWIW, have you considered to use
http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogramdd.html#numpy.histogramdd
Regards,
eat
Thanks.
Éric.
Un clavier azerty en vaut deux
--
Éric Depagne
Hi,
On Tue, Mar 29, 2011 at 5:13 PM, Éric Depagne e...@depagne.org wrote:
FWIW, have you considered to use
http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogramdd.html#
numpy.histogramdd
Regards,
eat
I tried, but I get a
/usr/lib/pymodules/python2.6/numpy/lib
.
Would old= seterr(invalid= 'ignore') be sufficient for you?
Regards,
eat
from numpy import __version__
__version__
'2.0.0.dev-1fe8136'
D.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy
-manager, but that's really create!
(Perhaps documents could reflect that.)
Regards,
eat
In [3]: np.array(np.inf)*0.
Warning: invalid value encountered in multiply
Out[3]: nan
In [4]: with np.errstate(all='ignore'):
...: np.array(np.inf)*0.
...:
...:
Out[4]: nan
In [5]: np.array
).
Regards,
eat
--
DILEEPKUMAR. R
J R F, IIT DELHI
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing
with minimal norm.
Is there more efficient way to do this than
argmin(array([sqrt(dot(x,x)) for x in vec_array]))?
Try
argmin(sum(vec_array** 2, 0)** 0.5)
Regards,
eat
Thanks in advance.
Andrey.
___
NumPy-Discussion mailing list
NumPy-Discussion
6]
# [ 3 4 5 6 0] # last item garbage
# [ 4 5 6 0 34]] # 2 last items garbage
My two cents,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
, 0.19113117, 1.37267133, 0.74219888, 1.55296562,
0.15264303, 0.72039922])
In [493]: dot(x[:, 0].T, y[:, 0])
Out[493]: 1.2540468282421895
Regards,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org
based full matrix calculations can be done less than 5
ms.
My two cents,
eat
I'm using gcc on Linux.
Now I'm wondering if I could go even faster !?
My hope that the compiler might automagically do some SSE2
optimization got disappointed.
Since I have a 4 core CPU I thought OpenMP might
Hi Sturla,
On Sat, Feb 12, 2011 at 5:38 PM, Sturla Molden stu...@molden.no wrote:
Den 10.02.2011 16:29, skrev eat:
One would expect sum to outperform dot with a clear marginal. Does
there exixts any 'tricks' to increase the performance of sum?
First of all, thanks for you still replying
, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit
(Intel)]'
# installed binaries from http://python.org/
In []: np.version.version
Out[]: '1.5.1'
# installed binaries from http://scipy.org/
Regards,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion
, you'll reach to spend more
time ;-).
Regards,
eat
On Thu, Feb 10, 2011 at 7:10 PM, Charles R Harris charlesr.har...@gmail.com
wrote:
On Thu, Feb 10, 2011 at 8:29 AM, eat e.antero.ta...@gmail.com wrote:
Hi,
Observing following performance:
In []: m= 1e5
In []: n= 1e2
In []: o= ones(n
Hi Robert,
On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Feb 10, 2011 at 11:53, eat e.antero.ta...@gmail.com wrote:
Thanks Chuck,
for replying. But don't you still feel very odd that dot outperforms sum
in
your machine? Just to get it simply; why sum
).
Thanks,
eat
--
Pauli Virtanen
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
___
NumPy-Discussion mailing list
NumPy-Discussion
Hi Robert,
On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Feb 10, 2011 at 14:29, eat e.antero.ta...@gmail.com wrote:
Hi Robert,
On Thu, Feb 10, 2011 at 8:16 PM, Robert Kern robert.k...@gmail.com
wrote:
On Thu, Feb 10, 2011 at 11:53, eat e.antero.ta
Hi,
On Fri, Feb 11, 2011 at 12:08 AM, Robert Kern robert.k...@gmail.com wrote:
On Thu, Feb 10, 2011 at 15:32, eat e.antero.ta...@gmail.com wrote:
Hi Robert,
On Thu, Feb 10, 2011 at 10:58 PM, Robert Kern robert.k...@gmail.com
wrote:
On Thu, Feb 10, 2011 at 14:29, eat e.antero.ta
the coefficient arrays reasonable (perhaps some kind of lightweigt
'database' for them ;-).
Please feel free to provide any more information.
Regards,
eat
On Tue, Feb 1, 2011 at 10:20 PM, dpar...@chromalloy.com wrote:
I'm not sure I need to dive into cython or C for this - performance
= air_gamma_1(t)
ag[np.logical_or(t 379., t 4731.)]= NAN
return ag
elif far 0.069:
ag= air_gamma_2(t, far)
ag[np.logical_or(t 699., t 4731.)]= NAN
return ag
else:
return NAN
Rest of the code is in the attachment.
My two cents,
eat
NAN = float
. It still involves Python looping but that's
not so much overhead.
My 2 cents
eat
For instance I could use broadcasting by using a dot product
%timeit dot(Ms.T,w)
1 loops, best of 3: 1.77 s per loop
But this is i) slower ii) takes too much memory
(btw, I'd really need an inplace dot-product in numpy
'fix' incase someone is interested.
Regards,
eat
twodim_base_fix.py
Description: Binary data
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
Hi,
On Wed, Jan 26, 2011 at 2:35 PM, josef.p...@gmail.com wrote:
On Wed, Jan 26, 2011 at 7:22 AM, eat e.antero.ta...@gmail.com wrote:
Hi,
I just noticed a document/ implementation conflict with tril and triu.
According tril documentation it should return of same shape and data-type
?
Regards,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
)), np.int)
for i in xrange(len(c1)):
tmp= d2[c1[i]== d1]
for j in xrange(len(c2)):
xtab[i, j]= np.sum(c2[j]== tmp)
print xtab, np.sum(xtab)== np.prod(d1.shape)
Anyway it's straightforward to extend it to nd x-tabulations ;-).
My 2 cents,
eat
, 2], [2, 3, 3], [3, 4, 1]])
n= 3
# between
print [np.unravel_index(ind, a.shape) for ind in np.argsort(a.ravel())[-n:]]
# and
print [np.where(val== a) for val in np.sort(a.ravel())[-n:]]
Regards,
eat
Best,
-Nikolaus
___
NumPy-Discussion
,
-Niko
Hi,
Just
a= np.asarray([[1, 8, 2], [2, 1, 3]])
print np.where((a.T== a.max(axis= 1)).T)
However, if any row contains more than 1 max entity, above will fail. Please
let me to know if that's relevant for you.
-eat
___
NumPy-Discussion mailing
is x[cond].max()?
Just my 2 cents.
Regards,
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
this current thread relate anyway to the earlier one 'Match two
arrays'? If so, would you like to elaborate more about your 'real' problem?
Regards,
eat
Thanks,
Shailendra
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http
not be used. I can think of only C style code to
achieve this. Can any one suggest pythonic way of doing this?
Thanks,
Shailendra
This is straightforward implementation as a starting point.
eat
code
import numpy as np
def dist(p1, p2):
return np.sqrt(np.sum((p1- p2)** 2, 0))
def cdist(p1
Oops.
Wrongly timed.
t= np.array(timeit.repeat(perf, repeat= rep, number= 1))/ rep
should be
t= np.array(timeit.repeat(perf, repeat= rep, number= 1))
eat
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org
90 matches
Mail list logo