diff options
author | Paul Ivanov <paul.ivanov@local> | 2009-12-28 20:49:52 +0000 |
---|---|---|
committer | Paul Ivanov <paul.ivanov@local> | 2009-12-28 20:49:52 +0000 |
commit | e4f233ecfedd2aafa258db2d3ae27e30604cc020 (patch) | |
tree | 6d32fbdd19b8dca00cd7cafd8df076bac55ddfd8 /numpy/doc/constants.py | |
parent | 5ba01996a9ab2fdfb7c120a5afae801f854a781a (diff) | |
download | numpy-e4f233ecfedd2aafa258db2d3ae27e30604cc020.tar.gz |
fixed a whole bunch of doctests
Diffstat (limited to 'numpy/doc/constants.py')
-rw-r--r-- | numpy/doc/constants.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/doc/constants.py b/numpy/doc/constants.py index a4487b72a..adb7c7e02 100644 --- a/numpy/doc/constants.py +++ b/numpy/doc/constants.py @@ -322,20 +322,20 @@ add_newdoc('numpy', 'newaxis', Examples -------- - >>> newaxis is None + >>> np.newaxis is None True >>> x = np.arange(3) >>> x array([0, 1, 2]) - >>> x[:, newaxis] + >>> x[:, np.newaxis] array([[0], [1], [2]]) - >>> x[:, newaxis, newaxis] + >>> x[:, np.newaxis, np.newaxis] array([[[0]], [[1]], [[2]]]) - >>> x[:, newaxis] * x + >>> x[:, np.newaxis] * x array([[0, 0, 0], [0, 1, 2], [0, 2, 4]]) @@ -343,20 +343,20 @@ add_newdoc('numpy', 'newaxis', Outer product, same as ``outer(x, y)``: >>> y = np.arange(3, 6) - >>> x[:, newaxis] * y + >>> x[:, np.newaxis] * y array([[ 0, 0, 0], [ 3, 4, 5], [ 6, 8, 10]]) ``x[newaxis, :]`` is equivalent to ``x[newaxis]`` and ``x[None]``: - >>> x[newaxis, :].shape + >>> x[np.newaxis, :].shape (1, 3) - >>> x[newaxis].shape + >>> x[np.newaxis].shape (1, 3) >>> x[None].shape (1, 3) - >>> x[:, newaxis].shape + >>> x[:, np.newaxis].shape (3, 1) """) |