numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
array(object, dtype=None, *, copy=True, order='K', subok=False, ndmin=0, like=None)

Notes

When order is 'A' and :None:None:`object` is an array in neither 'C' nor 'F' order, and a copy is forced by a change in dtype, then the order of the result is not necessarily 'C' as expected. This is likely a bug.

Parameters

object : array_like

An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. If object is a scalar, a 0-dimensional array containing object is returned.

dtype : data-type, optional

The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence.

copy : bool, optional

If true (default), then the object is copied. Otherwise, a copy will only be made if __array__ returns a copy, if obj is a nested sequence, or if a copy is needed to satisfy any of the other requirements (dtype , :None:None:`order`, etc.).

order : {'K', 'A', 'C', 'F'}, optional

Specify the memory layout of the array. If object is not an array, the newly created array will be in C order (row major) unless 'F' is specified, in which case it will be in Fortran order (column major). If object is an array the following holds.

===== ========= =================================================== order no copy copy=True ===== ========= =================================================== 'K' unchanged F & C order preserved, otherwise most similar order 'A' unchanged F order if input is F and not C, otherwise C order 'C' C order C order 'F' F order F order ===== ========= ===================================================

When copy=False and a copy is made for other reasons, the result is the same as if copy=True , with some exceptions for 'A', see the Notes section. The default order is 'K'.

subok : bool, optional

If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default).

ndmin : int, optional

Specifies the minimum number of dimensions that the resulting array should have. Ones will be pre-pended to the shape as needed to meet this requirement.

like : array_like

Reference object to allow the creation of arrays which are not NumPy arrays. If an array-like passed in as like supports the __array_function__ protocol, the result will be defined by it. In this case, it ensures the creation of an array object compatible with that passed in via this argument.

versionadded

Returns

out : ndarray

An array object satisfying the specified requirements.

Create an array.

See Also

empty

Return a new uninitialized array.

empty_like

Return an empty array with shape and type of input.

full

Return a new array of given shape filled with value.

full_like

Return a new array with shape of input filled with value.

ones

Return a new array setting values to one.

ones_like

Return an array of ones with shape and type of input.

zeros

Return a new array setting values to zero.

zeros_like

Return an array of zeros with shape and type of input.

Examples

>>> np.array([1, 2, 3])
array([1, 2, 3])

Upcasting:

>>> np.array([1, 2, 3.0])
array([ 1.,  2.,  3.])

More than one dimension:

>>> np.array([[1, 2], [3, 4]])
array([[1, 2],
       [3, 4]])

Minimum dimensions 2:

>>> np.array([1, 2, 3], ndmin=2)
array([[1, 2, 3]])

Type provided:

>>> np.array([1, 2, 3], dtype=complex)
array([ 1.+0.j,  2.+0.j,  3.+0.j])

Data-type consisting of more than one element:

>>> x = np.array([(1,2),(3,4)],dtype=[('a','<i4'),('b','<i4')])
... x['a'] array([1, 3])

Creating an array from sub-classes:

>>> np.array(np.mat('1 2; 3 4'))
array([[1, 2],
       [3, 4]])
>>> np.array(np.mat('1 2; 3 4'), subok=True)
matrix([[1, 2],
        [3, 4]])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy

157 Elements
scipy.linalg._solvers.solve_continuous_are
scipy.spatial._qhull.ConvexHull
scipy.linalg._matfuncs_sqrtm.sqrtm
scipy.special._basic.factorial
scipy.linalg._matfuncs.tanm
scipy.spatial.transform._rotation.Rotation
scipy.linalg._decomp.eig
scipy.linalg._decomp.eigvalsh
scipy.linalg._matfuncs.sinhm
scipy.linalg._solvers.solve_discrete_lyapunov
scipy.linalg._decomp_svd.null_space
scipy.sparse.linalg._dsolve.linsolve.splu
scipy.linalg._basic.solve_banded
scipy.signal._ltisys.StateSpaceContinuous
scipy.linalg._decomp.eigh
scipy.linalg._decomp_qr.qr_multiply
scipy.linalg._basic.solve_toeplitz
scipy.linalg._matfuncs.cosm
scipy.linalg._matfuncs.khatri_rao
scipy.fft._realtransforms.dct
scipy.linalg._matfuncs.sinm
scipy.linalg._basic.lstsq
scipy.optimize._numdiff.approx_derivative
scipy.signal._ltisys.StateSpace
scipy.interpolate._interpolate.RegularGridInterpolator
scipy.sparse.linalg._isolve.tfqmr.tfqmr
scipy.signal._filter_design.zpk2sos
scipy.linalg._procrustes.orthogonal_procrustes
scipy.linalg._matfuncs.expm
scipy.linalg._decomp_lu.lu_solve
scipy.sparse._arrays.csr_array
scipy.optimize._numdiff.check_derivative
scipy.linalg._decomp_lu.lu
scipy.linalg._decomp_qz.ordqz
scipy.signal._peak_finding.peak_prominences
scipy.linalg._matfuncs.tanhm
scipy.sparse._coo.coo_matrix.tocsr
scipy.linalg._decomp_svd.svdvals
scipy.sparse._matrix_io.load_npz
scipy.optimize._basinhopping.basinhopping
scipy.sparse._csc.csc_matrix
scipy.sparse._arrays.dia_array
scipy.linalg._solvers.solve_sylvester
scipy.interpolate._interpolate.PPoly.solve
scipy.linalg._basic.inv
scipy.linalg._matfuncs.logm
scipy.linalg._decomp.eigvals
scipy.linalg._expm_frechet.expm_cond
scipy.linalg._decomp.hessenberg
scipy.optimize._nnls.nnls
scipy.linalg._decomp_update.qr_update
scipy.linalg._decomp_ldl.ldl
scipy.optimize._differentialevolution.differential_evolution
scipy.sparse.linalg._isolve.lgmres.lgmres
scipy.linalg._basic.matrix_balance
scipy.linalg._solvers.solve_continuous_lyapunov
scipy.special._orthogonal.chebyu
scipy.signal._ltisys.StateSpaceDiscrete
scipy.spatial._geometric_slerp.geometric_slerp
scipy.interpolate._interpolate.interpn
scipy.optimize._root.root
scipy.signal._ltisys.place_poles
scipy.linalg._basic.solve_triangular
scipy.linalg._decomp_polar.polar
scipy.sparse.linalg._dsolve.linsolve.factorized
scipy.integrate._bvp.solve_bvp
scipy.signal._arraytools.const_ext
scipy.signal._signaltools.convolve2d
scipy.linalg._decomp_update.qr_insert
scipy._lib._util._lazywhere
scipy.signal._peak_finding.argrelextrema
scipy.linalg._decomp_cholesky.cholesky_banded
scipy.signal._ltisys.lsim2
scipy.spatial.distance.directed_hausdorff
scipy.sparse.linalg._isolve.minres.minres
scipy.linalg._basic.solve_circulant
scipy.sparse.linalg._isolve.lsmr.lsmr
scipy.interpolate._bsplines.make_interp_spline
scipy.signal._bsplines.gauss_spline
scipy.sparse._arrays.coo_array
scipy.optimize._optimize.fmin_bfgs
scipy.linalg._matfuncs.fractional_matrix_power
scipy.linalg._special_matrices.dft
scipy.sparse.linalg._dsolve.linsolve.spilu
scipy.linalg._decomp_schur.rsf2csf
scipy.sparse.linalg._expm_multiply.expm_multiply
scipy.linalg._basic.solve
scipy.interpolate._interpolate.lagrange
scipy.linalg._decomp.eigvals_banded
scipy.signal._filter_design.bilinear
scipy.signal._peak_finding._boolrelextrema
scipy.linalg._basic.det
scipy.linalg._solvers.solve_discrete_are
scipy.sparse._construct.kron
scipy.fft._basic.ihfft
scipy.linalg._matfuncs.funm
scipy.spatial.distance.jensenshannon
scipy.sparse._csr.csr_matrix
scipy.linalg._decomp.eig_banded
scipy.sparse.linalg._interface.LinearOperator
scipy.sparse.linalg._interface.aslinearoperator
scipy.linalg._basic.solveh_banded
scipy.signal._arraytools.odd_ext
scipy.signal._arraytools.zero_ext
scipy.special._basic.comb
scipy.sparse._coo.coo_matrix
scipy.signal._savitzky_golay.savgol_coeffs
scipy.signal._peak_finding.argrelmax
scipy.signal._signaltools.lfilter_zi
scipy.optimize._linesearch.line_search_wolfe2
scipy.signal._peak_finding.argrelmin
scipy.sparse._coo.coo_matrix.tocsc
scipy.sparse._matrix_io.save_npz
scipy.linalg._decomp_svd.orth
scipy.spatial._procrustes.procrustes
scipy.signal._arraytools.axis_slice
scipy.sparse.linalg._isolve.iterative.gmres
scipy.sparse._bsr.bsr_matrix
scipy.linalg._decomp_cholesky.cho_factor
scipy.signal._arraytools.even_ext
scipy.sparse._construct.spdiags
scipy.linalg._decomp_update.qr_delete
scipy.special._logsumexp.softmax
scipy.optimize._minpack_py.fixed_point
scipy.special._basic.perm
scipy.spatial.distance.cdist
scipy.signal._lti_conversion.cont2discrete
scipy.sparse._dia.dia_matrix
scipy.sparse._arrays.bsr_array
scipy.sparse.csgraph._tools.reconstruct_path
scipy.linalg._matfuncs.coshm
scipy.signal._ltisys.lsim
scipy.signal._savitzky_golay.savgol_filter
scipy.spatial._qhull.Voronoi
scipy.signal._filter_design.freqz
scipy.special._orthogonal.chebyt
scipy.sparse.linalg._isolve.lsqr.lsqr
scipy.linalg._decomp_cholesky.cho_solve_banded
scipy.optimize._qap.quadratic_assignment
scipy.spatial._qhull.Delaunay
scipy.linalg._decomp_cholesky.cho_solve
scipy.linalg._basic.matmul_toeplitz
scipy.sparse.linalg._isolve.iterative.qmr
scipy.optimize._lsap.linear_sum_assignment
scipy.sparse._arrays.csc_array
scipy.linalg._decomp_svd.diagsvd
scipy.spatial._qhull.HalfspaceIntersection
scipy.linalg._decomp_lu.lu_factor
scipy.sparse._base.spmatrix.dot
scipy.linalg._decomp_schur.schur
scipy.linalg._decomp_cholesky.cholesky
scipy.linalg._special_matrices.convolution_matrix
scipy.linalg._special_matrices.kron
scipy.sparse.linalg._dsolve.linsolve.spsolve_triangular
scipy.fft._realtransforms.idct
scipy.signal._filter_design.bilinear_zpk
scipy.sparse.csgraph._tools.construct_dist_matrix

dask

104 Elements
dask.array.reductions.any
dask.array.core.from_array
dask.array.ufunc.isfinite
dask.array.routines.bincount
dask.array.routines.insert
dask.array.slicing.setitem
dask.array.routines.choose
dask.array.ufunc.negative
dask.array.ufunc.power
dask.array.reductions.nanvar
dask.array.ufunc.arcsinh
dask.array.ma.masked_values
dask.array.reductions.cumsum
dask.array.ufunc.ufunc.outer
dask.array.reductions.nanmax
dask.array.overlap.map_overlap
dask.array.routines.squeeze
dask.array.routines.take
dask.array.reductions.argtopk
dask.array.routines.cov
dask.array.reductions.var
dask.array.routines.shape
dask.array.linalg.norm
dask.array.ufunc.less
dask.array.routines.compress
dask.array.reductions.all
dask.array.ufunc.floor
dask.array.reductions.nanmedian
dask.array.chunk.coarsen
dask.array.fft.rfftfreq
dask.array.ufunc.cos
dask.array.routines.apply_along_axis
dask.array.ufunc.frompyfunc
dask.array.ufunc.tan
dask.array.routines.nonzero
dask.array.ufunc.trunc
dask.array.reductions.prod
dask.array.routines.count_nonzero
dask.array.slicing.normalize_index
dask.array.ufunc.log2
dask.array.reductions.mean
dask.array.routines.digitize
dask.array.ufunc.floor_divide
dask.array.ufunc.isinf
dask.array.fft.fftfreq
dask.array.reductions.nanprod
dask.array.core.Array.transpose
dask.array.random.RandomState.lognormal
dask.array.gufunc.gufunc
dask.array.ufunc.ceil
dask.array.ufunc.bitwise_and
dask.array.reductions.cumprod
dask.array.ufunc.tanh
dask.array.routines.delete
dask.array.routines.ptp
dask.array.ufunc.invert
dask.array.routines.swapaxes
dask.array.ufunc.arctan2
dask.array.reductions.make_arg_reduction.<locals>.wrapped
dask.array.ufunc.less_equal
dask.array.reductions.nansum
dask.array.routines.where
dask.array.creation.repeat
dask.array.reductions.nanmin
dask.array.ufunc.float_power
dask.array.slicing.make_block_sorted_slices
dask.array.ufunc.sinh
dask.array.reductions.median
dask.array.reductions.nancumprod
dask.array.routines.ediff1d
dask.array.creation.tile
dask.array.core.map_blocks
dask.array.ufunc.sin
dask.array.ufunc.bitwise_xor
dask.array.ufunc.greater
dask.array.core.broadcast_arrays
dask.array.ufunc.absolute
dask.array.routines.vdot
dask.array.routines.ravel
dask.array.routines.gradient
dask.array.ufunc.signbit
dask.array.ufunc.rint
dask.array.ufunc.bitwise_or
dask.array.ufunc.greater_equal
dask.array.ufunc.logical_and
dask.array.ufunc.not_equal
dask.array.reductions.std
dask.array.routines.hstack
dask.array.routines.outer
dask.array.routines.array
dask.array.routines.vstack
dask.array.random.RandomState.standard_t
dask.array.ufunc.logical_or
dask.array.ufunc.equal
dask.array.core.Array.map_overlap
dask.array.reductions.nanstd
dask.array.routines.diff
dask.array.reductions.nanmean
dask.array.core.from_func
dask.array.routines.histogram
dask.array.reductions.topk
dask.array.reductions.nancumsum
dask.array.routines.dstack
dask.array.overlap.overlap

skimage

39 Elements
skimage.segmentation._join.join_segmentations
skimage.morphology.grey.closing
skimage.morphology.grey.opening
skimage.measure._moments.moments_coords
skimage.segmentation._join.relabel_sequential
skimage.graph.mcp.route_through_array
skimage.filters.rank.generic.sum
skimage.transform._geometric.estimate_transform
skimage.util._invert.invert
skimage.filters.rank.generic.threshold
skimage.draw.draw.polygon
skimage.segmentation.boundaries.find_boundaries
skimage.restoration.uft.laplacian
skimage.filters.thresholding.apply_hysteresis_threshold
skimage.morphology.grey.erosion
skimage.measure.profile.profile_line
skimage.morphology.grey.dilation
skimage.draw.draw_nd._round_safe
skimage.measure.fit.LineModelND
skimage.transform._warps.warp_coords
skimage.draw._polygon2mask.polygon2mask
skimage.measure._moments.moments_coords_central
skimage.restoration.uft.ir2tf
skimage.filters.rank.generic.pop
skimage.morphology.max_tree.max_tree
skimage.morphology.grey.black_tophat
skimage.measure._label.label
skimage.exposure.exposure.rescale_intensity
skimage.morphology.grey.white_tophat
skimage.feature.texture.greycomatrix
skimage.filters._rank_order.rank_order
skimage.util.unique.unique_rows
skimage.morphology.misc.remove_small_objects
skimage.morphology.misc.remove_small_holes
skimage.transform._warps.warp
skimage.morphology.grey._invert_selem
skimage.filters.rank.bilateral.pop_bilateral
skimage.segmentation.active_contour_model.active_contour
skimage.segmentation._clear_border.clear_border

pandas

53 Elements
pandas.core.dtypes.common.is_int64_dtype
pandas._libs.tslibs.parsing.concat_date_cols
pandas.core.reshape.merge._factorize_keys
pandas.core.series.Series
pandas.core.dtypes.common.is_datetime_or_timedelta_dtype
pandas.core.dtypes.common.is_complex_dtype
pandas.core.frame.DataFrame.quantile
pandas.core.series.Series.reset_index
pandas.core.nanops.nanargmin
pandas.core.series.Series.sort_index
pandas.core.algorithms.take
pandas.core.indexers.utils.validate_indices
pandas.core.dtypes.common.is_extension_array_dtype
pandas.core.indexes.datetimes.DatetimeIndex.tz_localize
pandas.core.reshape.reshape._reorder_for_extension_array_stack
pandas.core.dtypes.common.is_any_int_dtype
pandas.core.dtypes.common.is_signed_integer_dtype
pandas.core.dtypes.inference.is_array_like
pandas.core.ops.missing.mask_zero_div_zero
pandas.core.series.Series.dot
pandas.core.construction.array
pandas.core.indexers.utils.check_array_indexer
pandas.core.dtypes.common.is_integer_dtype
pandas.core.dtypes.missing.array_equivalent
pandas.core.dtypes.common.is_datetime64_any_dtype
pandas.core.window.rolling.Rolling.corr
pandas.core.dtypes.missing.isna
pandas.core.dtypes.common.is_timedelta64_ns_dtype
pandas.core.dtypes.common.is_numeric_v_string_like
pandas.core.arrays.datetimes.DatetimeArray.tz_localize
pandas.core.dtypes.common.is_bool_dtype
pandas.core.dtypes.common.is_unsigned_integer_dtype
pandas._libs.lib.item_from_zerodim
pandas.core.arrays.categorical.recode_for_categories
pandas.core.nanops.nanargmax
pandas._libs.lib.is_list_like
pandas.core.frame.DataFrame
pandas.core.generic.NDFrame.tz_localize
pandas.core.reshape.tile.cut
pandas.core.dtypes.common.is_object_dtype
pandas.core.dtypes.common.is_datetime64_ns_dtype
pandas.core.dtypes.common.is_string_dtype
pandas.core.reshape.pivot.crosstab
pandas.core.dtypes.common.is_numeric_dtype
pandas.core.generic.NDFrame.filter
pandas.core.dtypes.common.needs_i8_conversion
pandas.core.frame.DataFrame.dot
pandas.core.dtypes.common.is_datetime64_dtype
pandas.core.dtypes.common.is_sparse
pandas.core.dtypes.common.is_extension_type
pandas.core.dtypes.common.is_float_dtype
pandas.core.dtypes.missing.notna
pandas.core.dtypes.common.is_datetimelike_v_numeric

networkx

networkx.drawing.layout.rescale_layout_dict
networkx.convert_matrix.from_numpy_matrix
networkx.algorithms.similarity.simrank_similarity
networkx.convert_matrix.from_numpy_array

numpy

numpy.lib.arraypad._view_roi
numpy.pad
numpy.lib.arraypad._pad_simple
numpy.matrix
numpy.ndarray
numpy.isin

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : None#None
type: <class 'builtin_function_or_method'>
Commit: