[Numpy-discussion] converting scalar to array with dimension 1
Fri Mar 30 07:56:13 CDT 2007
Hello list -
I have a function that normally accepts an array as input, but sometimes a
I figured the easiest way to make sure the input is an array, is to make it
But if I make a float an array, it has 0 dimension, and I can still not do
array manipulation on it.
>>> a = 3
>>> a = array(a)
Traceback (most recent call last):
File "<pyshell#121>", line 1, in ?
IndexError: 0-d arrays can't be indexed
What would be the best (and easiest, this is for an intro class I am
to convert a to an array (recall, most of the time a is already an array).
Thanks for your help, Mark
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion