Array creation routines¶
Ones and zeros¶
|
Return a 2-D array with ones on the diagonal and zeros elsewhere. |
|
Return a new array of given shape and type, without initializing entries. |
|
Return a new array of given shape and type, filled with fill_value. |
|
Return the identity array. |
|
Return a new array of given shape and type, filled with ones. |
|
Return an array of ones with the same shape and type as a given array. |
|
Return a new array of given shape and type, filled with zeros. |
|
Return an array of zeros with the same shape and type as a given array. |
full_like
empty_like
From existing data¶
|
Create an array. |
|
Return an array copy of the given object. |
frombuffer
fromfunction
fromiter
fromstring
loadtxt
Creating record arrays (np.rec
)¶
Note
np.rec
is the preferred alias for
np.core.records
.
core.records.array
core.records.fromarrays
core.records.fromrecords
core.records.fromstring
core.records.fromfile
Creating character arrays (np.char
)¶
Note
np.char
is the preferred alias for
np.core.defchararray
.
core.defchararray.array
core.defchararray.asarray
Numerical ranges¶
|
Return evenly spaced values within a given interval. |
|
Return evenly spaced numbers over a specified interval. |
|
Return numbers spaced evenly on a log scale. |
|
Return coordinate matrices from coordinate vectors. |
geomspace
mgrid
ogrid