diff options
Diffstat (limited to 'numpy/doc/creation.py')
-rw-r--r-- | numpy/doc/creation.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/numpy/doc/creation.py b/numpy/doc/creation.py index 7de1c197c..dfcde585f 100644 --- a/numpy/doc/creation.py +++ b/numpy/doc/creation.py @@ -9,8 +9,7 @@ Introduction There are 5 general mechanisms for creating arrays: 1) Conversion from other Python structures (e.g., lists, tuples) -2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, - etc.) +2) Intrinsic numpy array creation objects (e.g., arange, ones, zeros, etc.) 3) Reading arrays from disk, either from standard or custom formats 4) Creating arrays from raw bytes through the use of strings or buffers 5) Use of special library functions (e.g., random) @@ -44,10 +43,10 @@ Intrinsic NumPy Array Creation NumPy has built-in functions for creating arrays from scratch: zeros(shape) will create an array filled with 0 values with the specified -shape. The default dtype is float64. +shape. The default dtype is float64. :: -``>>> np.zeros((2, 3)) -array([[ 0., 0., 0.], [ 0., 0., 0.]])`` + >>> np.zeros((2, 3)) + array([[ 0., 0., 0.], [ 0., 0., 0.]]) ones(shape) will create an array filled with 1 values. It is identical to zeros in all other respects. |