On Tue, Jul 13, 2010 at 7:50 PM, Joshua Holbrook
wrote:
> This is awesome! I love github. I really wanted to champion for its
> use at the BoF but unfortunately missed it.
Indeed, that's awesome. I should say finally! :)
Ondrej
___
NumPy-Discussion mai
I've deleted the code b/c it was absurdly slow. It was pretty brute-force.
-Looped through each row (r) of y
-check to see where y[r,0] - x[:,0] < eps (call that row r_hit)
-set y[r,1] = x[r_hit,1]
There was kind of a short fuse on this, and I was already reading the data from
a text file. So I j
Perhaps try the following:
1) sort x by x[:,0]
2) sort y by y[:,0]
3) loop through both at the same time building an array of indexes A that
tells you the index of y[i,0] in x or just building a new array z with the
value if you don't need them in order
4) if you do need them in order, unsort A by
How exactly are you looping? That sounds absurdly slow.
What you need is a fast dictionary.
On Wed, Aug 4, 2010 at 6:00 PM, Gökhan Sever wrote:
>
>
> On Wed, Aug 4, 2010 at 6:59 PM, wrote:
>
>> Hey folks,
>>
>> I've one array, x, that you could define as follows:
>> [[1, 2.25],
>> [2, 2.50],
On Wed, Aug 4, 2010 at 8:00 PM, Gökhan Sever wrote:
>
>
> On Wed, Aug 4, 2010 at 6:59 PM, wrote:
>
>> Hey folks,
>>
>> I've one array, x, that you could define as follows:
>> [[1, 2.25],
>> [2, 2.50],
>> [3, 2.25],
>> [4, 0.00],
>> [8, 0.00],
>> [9, 2.75]]
>>
>> Then my second array, y, is:
On Wed, Aug 4, 2010 at 6:59 PM, wrote:
> Hey folks,
>
> I've one array, x, that you could define as follows:
> [[1, 2.25],
> [2, 2.50],
> [3, 2.25],
> [4, 0.00],
> [8, 0.00],
> [9, 2.75]]
>
> Then my second array, y, is:
> [[1, 0.00],
> [2, 0.00],
> [3, 0.00],
> [4, 0.00],
> [5, 0.00],
>
John,
Thanks for the quick reply. Unfortunately, no, they're not indexed like that.
The first columns are actually floating-point date numbers from
matplotlib.dates.date2num. Looks like this is just going to be painful...
Thanks for the tip though. That'll definitely be useful elsewhere.
-paul
> Is there a concise, Numpythonic way to copy the values of x[:,1] over to
> y[:,1] where x[:,0] = y[:,0]? Resulting in, z:
First use
mask = (x[:,0] == y[:,0]) # integers
or
mask = np.abs(x[:,0] - y[:,0]) < eps # floats
and then
y[mask,1] = x[mask,1]
Sturla
__
Are they numbered like that? If so you can index into the first array by the
second one.
x[y[:,0], 1] if you can't get them into an indexable format, I think it's
going to be slow no matter how you do it.
On Wed, Aug 4, 2010 at 4:59 PM, wrote:
> Hey folks,
>
> I've one array, x, that you could d
Hey folks,
I've one array, x, that you could define as follows:
[[1, 2.25],
[2, 2.50],
[3, 2.25],
[4, 0.00],
[8, 0.00],
[9, 2.75]]
Then my second array, y, is:
[[1, 0.00],
[2, 0.00],
[3, 0.00],
[4, 0.00],
[5, 0.00],
[6, 0.00],
[7, 0.00],
[8, 0.00],
[9, 0.00],
[10,0.00]]
Is there a
Wed, 04 Aug 2010 23:34:15 +0800, Ralf Gommers wrote:
[clip]
> I haven't started using py3k yet so I'm still a bit fuzzy about bytes
> vs string. But it's easy to try in the interpreter:
>
import re
RE_VERSION = re.compile('(\d+\.\d+(\.\d+)*)')
In the Python 3.1 version I have, this lin
Oh and PS. Robert's right that there's no general way to do this! What
I have only works because the data existing in the first 25 elements
of A that get clobbered by the copy operation aren't the same data
that are being copied (or where they are, the new copy is identical to
the old one).
> Yes it is, but is there a way to do it in-place?
So you want the first 25 elements of the array (in a flat "contiguous"
view) to contain the 25 elements of A[:5,:5]? This will do that, but
having to do stuff like this (rather than just copying the memory
region) might be indicative that ma
On Wed, Aug 4, 2010 at 10:31, Antoine Dechaume wrote:
> Yes it is, but is there a way to do it in-place?
No.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying t
On Wed, Aug 4, 2010 at 7:03 AM, sam tygier wrote:
> On 01/08/10 17:38, Ralf Gommers wrote:
> > I am pleased to announce the availability of the first beta of NumPy
> > 1.5.0. This will be the first NumPy release to include support for
> > Python 3, as well as for Python 2.7. Please try this beta
On Wed, Aug 4, 2010 at 6:25 AM, Pauli Virtanen wrote:
> Mon, 02 Aug 2010 23:48:52 +0800, Ralf Gommers wrote:
> > I'm trying to get building to work with Python 3.1 under Wine on OS X.
> > The first thing you run into is a python distutils problem, which is
> > fixed by replacing line 379 of cygw
Yes it is, but is there a way to do it in-place?
On Wed, Aug 4, 2010 at 5:20 PM, Zachary Pincus wrote:
> > A[:5,:5] shows the data I want, but it's not contiguous in memory.
> > A.resize(5,5) is contiguous, but do not contains the data I want.
> >
> > How to get both efficiently?
>
> A[:5,:5].cop
> A[:5,:5] shows the data I want, but it's not contiguous in memory.
> A.resize(5,5) is contiguous, but do not contains the data I want.
>
> How to get both efficiently?
A[:5,:5].copy()
will give you a new, contiguous array that has the same contents as
A[5:,5:], but in a new chunk of memory. Is
I forgot to refer to resize, sorry about that.
A[:5,:5] shows the data I want, but it's not contiguous in memory.
A.resize(5,5) is contiguous, but do not contains the data I want.
How to get both efficiently?
On Wed, Aug 4, 2010 at 5:01 PM, Robert Kern wrote:
> On Wed, Aug 4, 2010 at 09:29, A
On Wed, Aug 4, 2010 at 09:29, Antoine Dechaume wrote:
> Hi,
>
> given A=empty([10,10]), I would like to keep A[:5,:5] as a contiguous memory
> segment.
>
> How to do it efficiently?
I'm not sure I understand what you want. Your Subject line and the
body of your email conflict with each other. Can
Hi,
given A=empty([10,10]), I would like to keep A[:5,:5] as a contiguous memory
segment.
How to do it efficiently?
Thanks.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Tue, Aug 3, 2010 at 4:10 PM, Bruce Southey wrote:
> Hi,
> Since I was testing the 1.5 beta, I also tested the alpha release of Python
> 3.2 on Linux 64-bit (gcc version 4.4.4 20100630 (Red Hat 4.4.4-10) (GCC)).
> While my other Python versions passed the tests (once I copied the necessary
> to
22 matches
Mail list logo