Skip to content

Commit

Permalink
Merge 8730e8e into 12b5f7e
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Mar 9, 2017
2 parents 12b5f7e + 8730e8e commit 18b4c3f
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions xnumpy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ def expand(new_array,
tiling in various dimension.
Examples:
>>> numpy.arange(6).reshape(2,3)
>>> a= numpy.arange(6).reshape(2,3)
>>> a
array([[0, 1, 2],
[3, 4, 5]])
>>> expand(numpy.arange(6).reshape(2,3))
>>> expand(a)
array([[0, 1, 2],
[3, 4, 5]])
>>> a = numpy.arange(6).reshape(2,3); a is expand(a)
>>> a is expand(a)
False
>>> expand(numpy.arange(6).reshape(2,3), 1)
>>> expand(a, 1)
array([[[0],
[1],
[2]],
Expand All @@ -58,7 +59,7 @@ def expand(new_array,
[4],
[5]]])
>>> expand(numpy.arange(6).reshape(2,3), (1,))
>>> expand(a, (1,))
array([[[0],
[1],
[2]],
Expand All @@ -67,7 +68,7 @@ def expand(new_array,
[4],
[5]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_after=1)
>>> expand(a, shape_after=1)
array([[[0],
[1],
[2]],
Expand All @@ -76,7 +77,7 @@ def expand(new_array,
[4],
[5]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_after=(1,))
>>> expand(a, shape_after=(1,))
array([[[0],
[1],
[2]],
Expand All @@ -85,15 +86,15 @@ def expand(new_array,
[4],
[5]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_before=1)
>>> expand(a, shape_before=1)
array([[[0, 1, 2],
[3, 4, 5]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_before=(1,))
>>> expand(a, shape_before=(1,))
array([[[0, 1, 2],
[3, 4, 5]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_before=(3,))
>>> expand(a, shape_before=(3,))
array([[[0, 1, 2],
[3, 4, 5]],
<BLANKLINE>
Expand All @@ -103,7 +104,7 @@ def expand(new_array,
[[0, 1, 2],
[3, 4, 5]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_after=(4,))
>>> expand(a, shape_after=(4,))
array([[[0, 0, 0, 0],
[1, 1, 1, 1],
[2, 2, 2, 2]],
Expand All @@ -113,7 +114,7 @@ def expand(new_array,
[5, 5, 5, 5]]])
>>> expand(
... numpy.arange(6).reshape((2,3)),
... a,
... shape_before=(3,),
... shape_after=(4,)
... )
Expand Down Expand Up @@ -143,7 +144,7 @@ def expand(new_array,
[4, 4, 4, 4],
[5, 5, 5, 5]]]])
>>> expand(numpy.arange(6).reshape((2,3)), shape_after=(4,3))
>>> expand(a, shape_after=(4,3))
array([[[[0, 0, 0],
[0, 0, 0],
[0, 0, 0],
Expand Down Expand Up @@ -176,7 +177,7 @@ def expand(new_array,
[5, 5, 5]]]])
>>> expand(
... numpy.arange(6).reshape((2,3)),
... a,
... shape_before=(4,3),
... )
array([[[[0, 1, 2],
Expand Down

0 comments on commit 18b4c3f

Please sign in to comment.