[Numpy-discussion] Syntax equivalent for np.array()
Wed Feb 10 10:33:11 CST 2010
On Wed, Feb 10, 2010 at 8:24 AM, Gökhan Sever <firstname.lastname@example.org> wrote:
> It works correctly in IPython-dev as well.
> And further in Python 2.6.2:
>>>> p = ()
> <type 'tuple'>
> <type 'numpy.ndarray'>
> ( ) doesn't only works as a tuple operator. It also has its original
> parenthesis functionality :)
I think this is the rule: When empty it is a tuple; when containing
one item it is parentheses unless there is a comma.
>> p = (9)
>> p = (9,)
More information about the NumPy-Discussion