On 29 May 2012, at 15:42, Nathaniel Smith wrote:
>> I note the fine distinction between np.isscalar( ('hello') ) and
>> np.isscalar( ('hello'), )...
>
> NB you mean np.isscalar( ('hello',) ), which creates a single-element
> tuple. A trailing comma attached to a value in Python normally creates
On Tue, May 29, 2012 at 2:31 PM, Derek Homeier
wrote:
> On 29 May 2012, at 15:00, Mark Bakker wrote:
>
>> Why does isscalar('hello') return True?
>>
>> I thought it would check for a number?
>
> No, it checks for something that is of 'scalar type', which probably can be
> translated as 'not equiva
On 29 May 2012, at 15:00, Mark Bakker wrote:
> Why does isscalar('hello') return True?
>
> I thought it would check for a number?
No, it checks for something that is of 'scalar type', which probably can be
translated as 'not equivalent to an array'. Since strings can form numpy
arrays,
I gues
On Tue, May 29, 2012 at 2:00 PM, Mark Bakker wrote:
> Why does isscalar('hello') return True?
>
> I thought it would check for a number?
>
> Numpy 1.6.1
>
> Silly question?
Nope, but you're thinking of a different sense of "scalar" :-).
In numpy, "scalar" means something like "anything that you
Why does isscalar('hello') return True?
I thought it would check for a number?
Numpy 1.6.1
Silly question?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion