[SciPy-Dev] (no subject)

Johnny Chan johnnychan0302 at gmail.com
Thu May 7 10:24:30 EDT 2015


Hello SciPy-Dev community,

Regarding the Tentative NumPy Tutorial (Array Creation)
<http://wiki.scipy.org/Tentative_NumPy_Tutorial#head-d3f8e5fe9b903f3c3b2a5c0dfceb60d71602cf93>,
I have noticed that there might have been a potential typo in one of the
code snippet. i.e.

I believe...

```
np.ones( (2,3,4), dtype = int16)
```

should be corrected to:

```
np.ones( (2,3,4), dtype = "int16")
```

(Note the double quotes around the int16.

Here is my console log to illustrate this:

```
np.ones( (2,3,4), dtype = int16)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-10-6606a1d2e14b> in <module>()
----> 1 np.ones( (2,3,4), dtype = int16)

NameError: name 'int16' is not defined

np.ones( (2,3,4), dtype = "int16")
Out[11]:
array([[[1, 1, 1, 1],
        [1, 1, 1, 1],
        [1, 1, 1, 1]],

       [[1, 1, 1, 1],
        [1, 1, 1, 1],
        [1, 1, 1, 1]]], dtype=int16)
```

If this makes sense please could we correct the tutorial documentation?

Thanks!
Johnny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20150507/c45f4f39/attachment.html>


More information about the SciPy-Dev mailing list