using split function

Gabriel Genellina gagsl-py at
Tue Nov 7 07:50:44 CET 2006

> > I have to write a code in python to read a matrix from a text file and
> > for that i am using following code. But it gives an error saying
> > "NameError: name 'split' is not defined". Can anyone help me with this.

A few hints:
- don't use "file" as a name - it shadows the builtin "file" type
- matrix.close() won't work, perhaps you meant file.close()?

> > -----------------------------------------------------
> > Also, i want to initialize the matrix A by zeros, but using A=zeros([4,
> > 4]) was giving a similar error "NameError: name 'zeros' is not
> > defined".

Oh, so *that's* why you build it using standard_normal and then 
overwrite the contents!

Gabriel Genellina
Softlab SRL 

Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! -

More information about the Python-list mailing list