Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd02611a

Browse files
authored
Doc: use different data in stacked arrays (#29390)
Improve docstring examples for dstack and column_stack
1 parentb5d6eb4 commitd02611a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

‎numpy/lib/_shape_base_impl.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -653,11 +653,11 @@ def column_stack(tup):
653653
--------
654654
>>> import numpy as np
655655
>>> a = np.array((1,2,3))
656-
>>> b = np.array((2,3,4))
656+
>>> b = np.array((4,5,6))
657657
>>> np.column_stack((a,b))
658-
array([[1,2],
659-
[2,3],
660-
[3,4]])
658+
array([[1,4],
659+
[2,5],
660+
[3,6]])
661661
662662
"""
663663
arrays= []
@@ -713,18 +713,18 @@ def dstack(tup):
713713
--------
714714
>>> import numpy as np
715715
>>> a = np.array((1,2,3))
716-
>>> b = np.array((2,3,4))
716+
>>> b = np.array((4,5,6))
717717
>>> np.dstack((a,b))
718-
array([[[1,2],
719-
[2,3],
720-
[3,4]]])
718+
array([[[1,4],
719+
[2,5],
720+
[3,6]]])
721721
722722
>>> a = np.array([[1],[2],[3]])
723-
>>> b = np.array([[2],[3],[4]])
723+
>>> b = np.array([[4],[5],[6]])
724724
>>> np.dstack((a,b))
725-
array([[[1,2]],
726-
[[2,3]],
727-
[[3,4]]])
725+
array([[[1,4]],
726+
[[2,5]],
727+
[[3,6]]])
728728
729729
"""
730730
arrs=atleast_3d(*tup)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp