Convert numpy.ndarray into "normal" array

Aahz aahz at pythoncraft.com
Fri Apr 24 19:37:45 CEST 2009


In article <75dgm1F16hqntU1 at mid.dfncis.de>,
Johannes Bauer  <dfnsonfsduifb at gmx.de> wrote:
>
>So now I want to copy the fits_pixels -> pb_pixels. Doing
>
>pb_pixels = fits_pixels
>
>works and is insanely fast, however the picture looks all screwed-up
>(looks like a RGB picture of unititialized memory, huge chunks of 0s
>interleaved with lots of white noise).
>
>Doing the loop:
>
>for x in range(width):
>	for y in range(height):
>		pb_pixels[y, x] = fits_pixels[y, x]
>
>works as expected, but is horribly slow (around 3 seconds for a 640x480
>picture).
>
>So now I've been trying to somehow convert the array in a fast manner,
>but just couldn't do it. What exactly is "array" anyways? I know
>"array.array", but that's something completely different, right? Does
>anyone have hints on how to go do this?

http://scipy.org/Mailing_Lists
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair



More information about the Python-list mailing list