Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to use arrays in Cython?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lars Buitinck  
View profile  
 More options Oct 12 2012, 5:07 pm
From: Lars Buitinck <L.J.Buiti...@uva.nl>
Date: Fri, 12 Oct 2012 23:07:04 +0200
Local: Fri, Oct 12 2012 5:07 pm
Subject: Re: How to use arrays in Cython?
2012/9/15 Andreas van Cranenburgh <andr...@unstable.nl>:

>> I've just been trying to replace a dynamically growing Numpy array
>> with a cpython.array one to benefit from its resize_smart
>> capabilities, but I can't seem to figure out how it works. What I have
>> is a Numpy array X that is grown by calling resize(2 * X.size)
>> whenever it's full. I can replace it with an ordinary Python array,
>> calling its append member, but that doesn't get Cythonized properly.

> resize and resize_smart are at the module level and should be called with an
> array instance as first argument.

Just to let you know, I've finally got some time to get back to this
project and it works now. Thanks!

> However, note that using its append and extend methods would trigger the
> same behavior internally.

Yes, but a call to append shows up yellow in cython -a output, so I
want to avoid it. I've yet to do a full benchmark, but the HTML file
is looking ever whiter :)

--
Lars Buitinck
Scientific programmer, ILPS
University of Amsterdam


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.