[Numpy-discussion] numpy type mismatch

Benjamin Root ben.root at ou.edu
Fri Jun 10 22:59:11 EDT 2011


On Fri, Jun 10, 2011 at 9:03 PM, Pauli Virtanen <pav at iki.fi> wrote:

> On Fri, 10 Jun 2011 18:51:14 -0700, Keith Goodman wrote:
> [clip]
> > Maybe this is the same question, but are you maybe yes, maybe no on this
> > too:
> >
> >     >>> type(np.sum([1, 2, 3], dtype=np.int32)) == np.int32
> >     False
>
> Note that this is a comparison between two Python types...
>
> > Ben, what happens if you put an axis in there? Like
> >
> >     >>> np.sum([[1, 2, 3], [4,5,6]], axis=0).dtype == np.int32
> >
> > Just wondering if this is another different-dtype-for-different-axis
> > case.
>
> ... and this between Numpy dtypes (the RHS operand is cast to a dtype).
>
>
And just to note for my previous response, I did compare the python types,
not the dtypes.

Ben Root
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20110610/d567b9ec/attachment.html>


More information about the NumPy-Discussion mailing list