[Numpy-discussion] Casting scalars

Nathan Goldbaum nathan12343 at gmail.com
Thu May 10 22:51:14 EDT 2018


In [1]: import numpy as np

In [2]: np.float64(12)
Out[2]: 12.0

In [3]: np.float64(12).dtype
Out[3]: dtype('float64')

On Thu, May 10, 2018 at 9:49 PM Hameer Abbasi <einstein.edison at gmail.com>
wrote:

> Hello, everyone!
>
> I might be missing something and this might be a very stupid and redundant
> question, but is there a way to cast a scalar to a given dtype?
>
> Hameer
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180510/cb72da11/attachment.html>


More information about the NumPy-Discussion mailing list