ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Most efficient way to "pre-grow" a list?
by Paul Rudin other posts by this author
Nov 7 2009 11:10PM messages near this date
Re: Most efficient way to "pre-grow" a list? | Re: Most efficient way to "pre-grow" a list?
kj <no.email@[...].post>  writes:

>  The best I can come up with is this:
> 
>  arr = [None] * 1000000
> 
>  Is this the most efficient way to achieve this result?
> 

Depends on what you take as given. You can do it with ctypes more
efficiently, but you can also shoot yourself in the foot.

Another possibility is to use a numpy array.

-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Kj
Andre Engels
Steven D'Aprano
Francis Carr
Gil_johnson
Gabriel Genellina
Gb345
Gil_johnson
Gil_johnson
Paul Rudin
Carl Banks
Emile van Sebille
exarkun
Sturlamolden
Sturlamolden
Sturlamolden
Kj
Ivan Illarionov
Steven D'Aprano
Terry Reedy
R
Gil_johnson
Kj
Bruno Desthuilliers
Luis Alberto Zarrabeitia Gomez
Andre Engels
Luis Alberto Zarrabeitia Gomez
Emily Rodgers
Raymond Hettinger
Brian Curtin
Paul Rubin
Jon Clements

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved