[Numpy-discussion] Need **working** code example of 2-D arrays

Linda Seltzer lseltzer at alumni.caltech.edu
Sun Oct 12 02:39:03 EDT 2008


I received several pieces of advice concerning my previous question on the
use of 2-D arrays.  However, none of these pieces of advice resulted in
code that works.

The latest suggestion
>> In numpy it's
>>    import numpy as npy
>>    a = npy.zeros((256,256))
produced this error message:
> NameError: global name 'npy' is not defined
These are the import statements I used:
import numpy as npy
from numpy.oldnumeric import *

I would appreciate it if someone could post a **working** example that
creates a 2-D array of a large size, such as 256x256, with the initial
elements all zero.  This file shouold include the import statements and
the lines of code to create the array.
Please, no demeaning statements like "you forgot a parenthesis" or "you
were using someone else's code" - just the lines of code for a file that
actually *works.*




More information about the NumPy-Discussion mailing list