summaryrefslogtreecommitdiff
path: root/doc/source/reference
diff options
context:
space:
mode:
authorMark Harfouche <mark.harfouche@gmail.com>2018-06-02 18:47:54 -0700
committerMark Harfouche <mark.harfouche@gmail.com>2018-06-02 18:47:54 -0700
commit5959bb640cf8bd42fc1033b09755d33743814b93 (patch)
tree8152a2b453ffec924e69beac079eef82f0a8964a /doc/source/reference
parent64b8ccc35cdf719f624d81e531b66127dd1926fa (diff)
downloadnumpy-5959bb640cf8bd42fc1033b09755d33743814b93.tar.gz
Updated with correct end
Diffstat (limited to 'doc/source/reference')
-rw-r--r--doc/source/reference/arrays.nditer.rst38
1 files changed, 19 insertions, 19 deletions
diff --git a/doc/source/reference/arrays.nditer.rst b/doc/source/reference/arrays.nditer.rst
index 83ff06c3e..fa8183f75 100644
--- a/doc/source/reference/arrays.nditer.rst
+++ b/doc/source/reference/arrays.nditer.rst
@@ -26,7 +26,7 @@ using the standard Python iterator interface.
>>> a = np.arange(6).reshape(2,3)
>>> for x in np.nditer(a):
- ... print(x)
+ ... print(x, end=' ')
...
0 1 2 3 4 5
@@ -42,12 +42,12 @@ of that transpose in C order.
>>> a = np.arange(6).reshape(2,3)
>>> for x in np.nditer(a.T):
- ... print(x)
+ ... print(x, end=' ')
...
0 1 2 3 4 5
>>> for x in np.nditer(a.T.copy(order='C')):
- ... print(x)
+ ... print(x, end=' ')
...
0 3 1 4 2 5
@@ -70,11 +70,11 @@ order='C' for C order and order='F' for Fortran order.
>>> a = np.arange(6).reshape(2,3)
>>> for x in np.nditer(a, order='F'):
- ... print(x)
+ ... print(x, end=' ')
...
0 3 1 4 2 5
>>> for x in np.nditer(a.T, order='C'):
- ... print(x)
+ ... print(x, end=' ')
...
0 3 1 4 2 5
@@ -139,12 +139,12 @@ elements each.
>>> a = np.arange(6).reshape(2,3)
>>> for x in np.nditer(a, flags=['external_loop']):
- ... print(x)
+ ... print(x, end=' ')
...
[0 1 2 3 4 5]
>>> for x in np.nditer(a, flags=['external_loop'], order='F'):
- ... print(x)
+ ... print(x, end=' ')
...
[0 3] [1 4] [2 5]
@@ -174,14 +174,14 @@ construct in order to be more readable.
>>> a = np.arange(6).reshape(2,3)
>>> it = np.nditer(a, flags=['f_index'])
>>> while not it.finished:
- ... print()"%d <%d>" % (it[0], it.index))
+ ... print("%d <%d>" % (it[0], it.index), end=' ')
... it.iternext()
...
0 <0> 1 <2> 2 <4> 3 <1> 4 <3> 5 <5>
>>> it = np.nditer(a, flags=['multi_index'])
>>> while not it.finished:
- ... print()"%d <%s>" % (it[0], it.multi_index))
+ ... print("%d <%s>" % (it[0], it.multi_index), end=' ')
... it.iternext()
...
0 <(0, 0)> 1 <(0, 1)> 2 <(0, 2)> 3 <(1, 0)> 4 <(1, 1)> 5 <(1, 2)>
@@ -228,12 +228,12 @@ is enabled.
>>> a = np.arange(6).reshape(2,3)
>>> for x in np.nditer(a, flags=['external_loop'], order='F'):
- ... print(x)
+ ... print(x, end=' ')
...
[0 3] [1 4] [2 5]
>>> for x in np.nditer(a, flags=['external_loop','buffered'], order='F'):
- ... print(x)
+ ... print(x, end=' ')
...
[0 3 1 4 2 5]
@@ -270,7 +270,7 @@ data type doesn't match precisely.
>>> a = np.arange(6).reshape(2,3) - 3
>>> for x in np.nditer(a, op_dtypes=['complex128']):
- ... print(np.sqrt(x))
+ ... print(np.sqrt(x), end=' ')
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
@@ -285,12 +285,12 @@ specified as an iterator flag.
>>> a = np.arange(6).reshape(2,3) - 3
>>> for x in np.nditer(a, op_flags=['readonly','copy'],
... op_dtypes=['complex128']):
- ... print(np.sqrt(x))
+ ... print(np.sqrt(x), end=' ')
...
1.73205080757j 1.41421356237j 1j 0j (1+0j) (1.41421356237+0j)
>>> for x in np.nditer(a, flags=['buffered'], op_dtypes=['complex128']):
- ... print(np.sqrt(x))
+ ... print(np.sqrt(x), end=' ')
...
1.73205080757j 1.41421356237j 1j 0j (1+0j) (1.41421356237+0j)
@@ -306,7 +306,7 @@ complex to float.
>>> a = np.arange(6.)
>>> for x in np.nditer(a, flags=['buffered'], op_dtypes=['float32']):
- ... print(x)
+ ... print(x, end=' ')
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
@@ -314,12 +314,12 @@ complex to float.
>>> for x in np.nditer(a, flags=['buffered'], op_dtypes=['float32'],
... casting='same_kind'):
- ... print(x)
+ ... print(x, end=' ')
...
0.0 1.0 2.0 3.0 4.0 5.0
>>> for x in np.nditer(a, flags=['buffered'], op_dtypes=['int32'], casting='same_kind'):
- ... print(x)
+ ... print(x, end=' ')
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
@@ -361,7 +361,7 @@ a two dimensional array together.
>>> a = np.arange(3)
>>> b = np.arange(6).reshape(2,3)
>>> for x, y in np.nditer([a,b]):
- ... print("%d:%d" % (x,y))
+ ... print("%d:%d" % (x,y), end=' ')
...
0:0 1:1 2:2 0:3 1:4 2:5
@@ -373,7 +373,7 @@ which includes the input shapes to help diagnose the problem.
>>> a = np.arange(2)
>>> b = np.arange(6).reshape(2,3)
>>> for x, y in np.nditer([a,b]):
- ... print("%d:%d" % (x,y))
+ ... print("%d:%d" % (x,y), end=' ')
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>