[python-hpc] about numpy

mamat_pator moh.fajar.88 at gmail.com
Fri Mar 9 21:02:55 CET 2012


How to passing linspace array to mgrid in numpy.?
i Tried  following code:

import numpy as np

t = np.linspace(0, 10, 21)

x = np.linspace(-0.2, 2.2 , 25)

A,B = np.mgrid[t, x]

print A,3*'\n' , B


but i Get error result:
Traceback (most recent call last):
File "D:\python\project\fisika sistem kompleks\quiver_test.py", line 13, 
in <module>
A,B = np.mgrid[t, x]
File "C:\Python27\lib\site-packages\numpy\lib\index_tricks.py", line 
149, in __getitem__
step = key[k].step
AttributeError: 'numpy.ndarray' object has no attribute 'step'


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-hpc/attachments/20120310/7704574b/attachment.html>


More information about the Python-HPC mailing list