performance question: dictionary or list, float or string?

bkamrani at gmail.com bkamrani at gmail.com
Tue Dec 2 06:41:29 EST 2008


Hi Python gurus!
I'm going to read in an Ascii file containing float numbers in rows
and columns (say 10 columns 500000 rows) for further numerical
process. Which format is best to save them in, eg, dictionary, list,
or numpy array when it comes to performance?

Will it be beneficial to convert all strings to float directly after
reading or it doesn't matter to save them as string and thereafter
when it comes to calculation convert them to floats?

Thank you!
/Ben



More information about the Python-list mailing list