You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Universal Functions (ufunc)

Math operations

opdescriptionstatusnote
numpy.addAdds two arrays elementwise.1
numpy.subtractSubtracts arguments elementwise.1
numpy.multiplyMultiplies two arrays elementwise.1
numpy.divideElementwise true division (i.e.1
numpy.logaddexpComputes log(exp(x1)` `+` `exp(x2)) elementwise.1PR15495
numpy.logaddexp2Computes log2(exp2(x1)` `+` `exp2(x2)) elementwise.1PR15494
numpy.true_divideElementwise true division (i.e.1Need a frontend interface called np.true_divide
numpy.floor_divideElementwise floor division (i.e.1
numpy.negativeTakes numerical negative elementwise.1
numpy.powerComputes x1` `**` `x2 elementwise.1
numpy.remainderComputes the remainder of Python division elementwise.1PR16080
numpy.modComputes the remainder of Python division elementwise.1
numpy.fmodComputes the remainder of C division elementwise.
numpy.absoluteElementwise absolute value function.1abs
numpy.rintRounds each element of an array to the nearest integer.1
numpy.signElementwise sign function.1
numpy.expElementwise exponential function.1
numpy.exp2Elementwise exponentiation with base 2.1PR15973
numpy.logElementwise natural logarithm function.1
numpy.log2Elementwise binary logarithm function.1
numpy.log10Elementwise common logarithm function.1
numpy.expm1Computes exp(x)` `-` `1 elementwise.1
numpy.log1pComputes log(1` `+` `x) elementwise.1
numpy.sqrtElementwise square root function.1
numpy.squareElementwise square function.1
numpy.reciprocalComputes 1` `/` `x elementwise.1

Trigonometric functions

opdescriptionstatusnote
numpy.sinElementwise sine function.1
numpy.cosElementwise cosine function.1
numpy.tanElementwise tangent function.1
numpy.arcsinElementwise inverse-sine function (a.k.a.1
numpy.arccosElementwise inverse-cosine function (a.k.a.1
numpy.arctanElementwise inverse-tangent function (a.k.a.1
numpy.arctan2Elementwise inverse-tangent of the ratio of two arrays.1PR15519
numpy.hypotComputes the hypoteneous of orthogonal vectors of given length.PR15901
numpy.sinhElementwise hyperbolic sine function.1
numpy.coshElementwise hyperbolic cosine function.1
numpy.tanhElementwise hyperbolic tangent function.1
numpy.arcsinhElementwise inverse of hyperbolic sine function.1
numpy.arccoshElementwise inverse of hyperbolic cosine function.1
numpy.arctanhElementwise inverse of hyperbolic tangent function.1
numpy.deg2radConverts angles from degrees to radians elementwise.WIP(tvm): tinying@
numpy.rad2degConverts angles from radians to degrees elementwise.WIP(tvm): tinying@

Bit-twiddling functions

opdescriptionstatusnote
numpy.bitwise_andComputes the bitwise AND of two arrays elementwise.
numpy.bitwise_orComputes the bitwise OR of two arrays elementwise.PR15293
numpy.bitwise_xorComputes the bitwise XOR of two arrays elementwise.PR15312
numpy.invertComputes the bitwise NOT of an array elementwise.
numpy.left_shiftShifts the bits of each integer element to the left.
numpy.right_shiftShifts the bits of each integer element to the right.

Comparison functions

opdescriptionstatusnote
numpy.greaterTests elementwise if x1` `>` `x2.1https://github.com/apache/incubator-mxnet/pull/15940
numpy.greater_equalTests elementwise if x1` `>=` `x2.1
numpy.lessTests elementwise if x1` `<` `x2.1
numpy.less_equalTests elementwise if x1` `<=` `x2.1
numpy.not_equalTests elementwise if x1` `!=` `x2.1
numpy.equalTests elementwise if x1` `==` `x2.1
numpy.logical_andComputes the logical AND of two arrays.
numpy.logical_orComputes the logical OR of two arrays.
numpy.logical_xorComputes the logical XOR of two arrays.
numpy.logical_notComputes the logical NOT of an array.1
numpy.maximumTakes the maximum of two arrays elementwise.1
numpy.minimumTakes the minimum of two arrays elementwise.1
numpy.fmaxTakes the maximum of two arrays elementwise.1WIP(tvm) guangtai@ #15800
numpy.fminTakes the minimum of two arrays elementwise.1

Floating functions

opdescriptionstatusnote
numpy.isfiniteTests finiteness elementwise.
numpy.isinfTests if each element is the positive or negative infinity.
numpy.isnanTests if each element is a NaN.
numpy.signbitTests elementwise if the sign bit is set (i.e.
numpy.copysignReturns the first argument with the sign bit of the second elementwise.1
numpy.nextafterComputes the nearest neighbor float values towards the second argument.
numpy.modfExtracts the fractional and integral parts of an array elementwise.
numpy.ldexpComputes x1` `*` `2` `**` `x2 elementwise.TODO: guangtai@
numpy.frexpDecomposes each element to mantissa and two’s exponent.TODO: guangtai@
numpy.fmodComputes the remainder of C division elementwise.
numpy.floorRounds each element of an array to its floor integer.1
numpy.ceilRounds each element of an array to its ceiling integer.1
numpy.truncRounds each element of an array towards zero.1

ufunc.at

Currently, CuPy does not support at for ufuncs in general. However, [``cupyx.scatter_add()

Array Creation Routines

Basic creation routines

opdescriptionstatusnote
numpy.emptyReturns an array without initializing the elements.1
numpy.empty_likeReturns a new array with same shape and dtype of a given array.
numpy.eyeReturns a 2-D array with ones on the diagonals and zeros elsewhere.1
numpy.identityReturns a 2-D identity array.1PR15698
numpy.onesReturns a new array of given shape and dtype, filled with ones.1
numpy.ones_likeReturns an array of ones with same shape and dtype as a given array.1
numpy.zerosReturns a new array of given shape and dtype, filled with zeros.1
numpy.zeros_likeReturns an array of zeros with same shape and dtype as a given array.1
numpy.fullReturns a new array of given shape and dtype, filled with a given value.1PR15763
numpy.full_likeReturns a full array with same shape and dtype as a given array.

Creation from other data

opdescriptionstatusnote
numpy.arrayCreates an array on the current device.1
numpy.asarrayConverts an object to array.
numpy.asanyarrayConverts an object to array.
numpy.ascontiguousarrayReturns a C-contiguous array.
numpy.copyCreates a copy of a given array on the current device.1

Numerical ranges

opdescriptionstatusnote
numpy.arangeReturns an array with evenly spaced values within a given interval.1
numpy.linspaceReturns an array with evenly-spaced values within a given interval.1
numpy.logspaceReturns an array with evenly-spaced values on a log-scale.1PR15825
numpy.meshgridReturn coordinate matrices from coordinate vectors.1
numpy.mgridConstruct a multi-dimensional “meshgrid”.1PR15562
numpy.ogridConstruct a multi-dimensional “meshgrid”.1PR15562

Matrix creation

opdescriptionstatusnote
numpy.diagReturns a diagonal or a diagonal array.
numpy.diagflatCreates a diagonal array from the flattened input.
numpy.triCreates an array with ones at and below the given diagonal.
numpy.trilReturns a lower triangle of an array.1PR15696
numpy.triuReturns an upper triangle of an array.

Array Manipulation Routines

Basic operations

opdescriptionstatusnote
numpy.copytoCopies values from one array to another with broadcasting.1only convenient mode

Changing array shape

opdescriptionstatusnote
numpy.reshapeReturns an array with new shape and same elements.1
numpy.ravelReturns a flattened array.

Transpose-like operations

opdescriptionstatusnote
numpy.moveaxisMoves axes of an array to new positions.1PR15826
numpy.rollaxisMoves the specified axis backwards to the given place.
numpy.swapaxesSwaps the two axes.1
numpy.transposePermutes the dimensions of an array.1

Changing number of dimensions

opdescriptionstatusnote
numpy.atleast_1dConverts arrays to arrays with dimensions >= 1.
numpy.atleast_2dConverts arrays to arrays with dimensions >= 2.
numpy.atleast_3dConverts arrays to arrays with dimensions >= 3.
numpy.broadcastObject that performs broadcasting.
numpy.broadcast_toBroadcast an array to a given shape.1
numpy.broadcast_arraysBroadcasts given arrays.1
numpy.expand_dimsExpands given arrays.1
numpy.squeezeRemoves size-one axes from the shape of an array.1

Changing kind of array

opdescriptionstatusnote
numpy.asarrayConverts an object to array.
numpy.asanyarrayConverts an object to array.
numpy.asfortranarrayReturn an array laid out in Fortran order in memory.
numpy.ascontiguousarrayReturns a C-contiguous array.

Joining arrays

opdescriptionstatusnote
numpy.concatenateJoins arrays along an axis.1
numpy.stackStacks arrays along a new axis.1
numpy.column_stackStacks 1-D and 2-D arrays as columns into a 2-D array.
numpy.dstackStacks arrays along the third axis.1PR15314
numpy.hstackStacks arrays horizontally.1PR15302
numpy.vstackStacks arrays vertically.1PR15325

Splitting arrays

opdescriptionstatusnote
numpy.splitSplits an array into multiple sub arrays along a given axis.1
numpy.array_splitSplits an array into multiple sub arrays along a given axis.
numpy.dsplitSplits an array into multiple sub arrays along the third axis.1PR15371
numpy.hsplitSplits an array into multiple sub arrays horizontally.1PR15358
numpy.vsplitSplits an array into multiple sub arrays along the first axis.1PR15346

Tiling arrays

opdescriptionstatusnote
numpy.tileConstruct an array by repeating A the number of times given by reps.1
numpy.repeatRepeat arrays along an axis.1

Adding and removing elements

opdescriptionstatusnote
numpy.uniqueFind the unique elements of an array.1PR15733

Rearranging elements

opdescriptionstatusnote
numpy.flipReverse the order of elements in an array along the given axis.1PR15586
numpy.fliplrFlip array in the left/right direction.
numpy.flipudFlip array in the up/down direction.
numpy.reshapeReturns an array with new shape and same elements.1
numpy.rollRoll array elements along a given axis.1PR15902
numpy.rot90Rotate an array by 90 degrees in the plane specified by axes.1PR15987

Binary OperationsElementwise bit operations

opdescriptionstatusnote
numpy.bitwise_andComputes the bitwise AND of two arrays elementwise.
numpy.bitwise_orComputes the bitwise OR of two arrays elementwise.
numpy.bitwise_xorComputes the bitwise XOR of two arrays elementwise.
numpy.invertComputes the bitwise NOT of an array elementwise.
numpy.left_shiftShifts the bits of each integer element to the left.
numpy.right_shiftShifts the bits of each integer element to the right.

Bit packing

opdescriptionstatusnote
numpy.packbitsPacks the elements of a binary-valued array into bits in a uint8 array.
numpy.unpackbitsUnpacks elements of a uint8 array into a binary-valued output array.

Output formatting

opdescriptionstatusnote
numpy.binary_reprReturn the binary representation of the input number as a string.

FFT Functions

Standard FFTs

opdescriptionstatusnote
numpy.fft.fftCompute the one-dimensional FFT.
numpy.fft.ifftCompute the one-dimensional inverse FFT.
numpy.fft.fft2Compute the two-dimensional FFT.
numpy.fft.ifft2Compute the two-dimensional inverse FFT.
numpy.fft.fftnCompute the N-dimensional FFT.
numpy.fft.ifftnCompute the N-dimensional inverse FFT.

Real FFTs

opdescriptionstatusnote
numpy.fft.rfftCompute the one-dimensional FFT for real input.
numpy.fft.irfftCompute the one-dimensional inverse FFT for real input.
numpy.fft.rfft2Compute the two-dimensional FFT for real input.
numpy.fft.irfft2Compute the two-dimensional inverse FFT for real input.
numpy.fft.rfftnCompute the N-dimensional FFT for real input.
numpy.fft.irfftnCompute the N-dimensional inverse FFT for real input.

Hermitian FFTs

opdescriptionstatusnote
numpy.fft.hfftCompute the FFT of a signal that has Hermitian symmetry.
numpy.fft.ihfftCompute the FFT of a signal that has Hermitian symmetry.

Helper routines

opdescriptionstatusnote
numpy.fft.fftfreqReturn the FFT sample frequencies.
numpy.fft.rfftfreqReturn the FFT sample frequencies for real input.
numpy.fft.fftshiftShift the zero-frequency component to the center of the spectrum.
numpy.fft.ifftshiftThe inverse of [``fftshift()

Indexing Routines

opdescriptionstatusnote
numpy.c_
numpy.r_
numpy.nonzeroReturn the indices of the elements that are non-zero.
numpy.whereReturn elements, either from x or y, depending on condition.
numpy.indicesReturns an array representing the indices of a grid.
numpy.ix_i
numpy.unravel_indexConverts array of flat indices into a tuple of coordinate arrays.
numpy.takeTakes elements of an array at specified indices along an axis.1
numpy.choose
numpy.diagReturns a diagonal or a diagonal array.
numpy.diagonalReturns specified diagonals.
numpy.lib.stride_tricks.as_stridedCreate a view into the array with the given shape and strides.
numpy.placeChange elements of an array based on conditional and input values.
numpy.putReplaces specified elements of an array with given values.
numpy.fill_diagonalFills the main diagonal of the given array of any dimensionality.

Input and Output

NumPy binary files (NPY, NPZ)

opdescriptionstatusnote
numpy.loadLoads arrays or pickled objects from .npy, .npz or pickled file.1
numpy.saveSaves an array to a binary file in .npy format.1
numpy.savezSaves one or more arrays into a file in uncompressed .npz format.
numpy.savez_compressedSaves one or more arrays into a file in compressed .npz format.

String formatting

opdescriptionstatusnote
numpy.array_reprReturns the string representation of an array.
numpy.array_strReturns the string representation of the content of an array.

Base-n representations

opdescriptionstatusnote
numpy.binary_reprReturn the binary representation of the input number as a string.
numpy.base_reprReturn a string representation of a number in the given base system.

Linear Algebra

Matrix and vector products

opdescriptionstatusnote
numpy.dotReturns a dot product of two arrays.1
numpy.vdotReturns the dot product of two vectors.1PR in progress
numpy.innerReturns the inner product of two arrays.1PR in progress
numpy.outerReturns the outer product of two vectors.1PR in progress
numpy.matmulReturns the matrix product of two arrays and is the implementation of the @ operator introduced in Python 3.5 following PEP465.dep: einsum
numpy.tensordotReturns the tensor dot product of two arrays along specified axes.1PR15349
numpy.einsumEvaluates the Einstein summation convention on the operands.1PR15493
numpy.linalg.matrix_powerRaise a square matrix to the (integer) power n.dep: matmul
numpy.kronReturns the kronecker product of two arrays.1PR15893

Decompositions

opdescriptionstatusnote
numpy.linalg.choleskyCholesky decomposition.
numpy.linalg.qrQR decomposition.
numpy.linalg.svdSingular Value Decomposition.wip

Matrix eigenvalues

opdescriptionstatusnote
numpy.linalg.eighEigenvalues and eigenvectors of a symmetric matrix.
numpy.linalg.eigvalshCalculates eigenvalues of a symmetric matrix.

Norms etc.

opdescriptionstatusnote
numpy.linalg.detRetruns the deteminant of an array.1
numpy.linalg.normReturns one of matrix norms specified by ord parameter.1
numpy.linalg.matrix_rankReturn matrix rank of array using SVD method
numpy.linalg.slogdetReturns sign and logarithm of the determinant of an array.1
numpy.traceReturns the sum along the diagonals of an array.1PR15258

Solving linear equations

opdescriptionstatusnote
numpy.linalg.solveSolves a linear matrix equation.
numpy.linalg.tensorsolveSolves tensor equations denoted by ax` `=` `b.
numpy.linalg.invComputes the inverse of a matrix.
numpy.linalg.pinvCompute the Moore-Penrose pseudoinverse of a matrix.
numpy.linalg.tensorinvComputes the inverse of a tensor.
cupyx.scipy.linalg.lu_factorLU decomposition.
cupyx.scipy.linalg.lu_solveSolve an equation system, a` `*` `x` `=` `b, given the LU factorization of a
cupyx.scipy.linalg.solve_triangularSolve the equation a x = b for x, assuming a is a triangular matrix.

Logic Functions

Truth value testing

opdescriptionstatusnote
numpy.allTests whether all array elements along a given axis evaluate to True.
numpy.anyTests whether any array elements along a given axis evaluate to True.

Infinities and NaNs

opdescriptionstatusnote
numpy.isfiniteTests finiteness elementwise.
numpy.isinfTests if each element is the positive or negative infinity.
numpy.isnanTests if each element is a NaN.

Array type testing

opdescriptionstatusnote
numpy.iscomplexReturns a bool array, where True if input element is complex.
numpy.iscomplexobjCheck for a complex type or an array of complex numbers.
numpy.isfortranReturns True if the array is Fortran contiguous but not C contiguous.
numpy.isrealReturns a bool array, where True if input element is real.
numpy.isrealobjReturn True if x is a not complex type or an array of complex numbers.
numpy.isscalarReturns True if the type of num is a scalar type.

Logic operations

opdescriptionstatusnote
numpy.logical_andComputes the logical AND of two arrays.
numpy.logical_orComputes the logical OR of two arrays.
numpy.logical_notComputes the logical NOT of an array.1
numpy.logical_xorComputes the logical XOR of two arrays.

Comparison

opdescriptionstatusnote
numpy.allcloseReturns True if two arrays are element-wise equal within a tolerance.
numpy.iscloseReturns a boolean array where two arrays are equal within a tolerance.
numpy.greaterTests elementwise if x1` `>` `x2.1Re-implement to return boolean ndarray
numpy.greater_equalTests elementwise if x1` `>=` `x2.1
numpy.lessTests elementwise if x1` `<` `x2.1
numpy.less_equalTests elementwise if x1` `<=` `x2.1
numpy.equalTests elementwise if x1` `==` `x2.1
numpy.not_equalTests elementwise if x1` `!=` `x2.1

Mathematical Functions

Trigonometric functions

opdescriptionstatusnote
numpy.sinElementwise sine function.1
numpy.cosElementwise cosine function.1
numpy.tanElementwise tangent function.1
numpy.arcsinElementwise inverse-sine function (a.k.a.1
numpy.arccosElementwise inverse-cosine function (a.k.a.1
numpy.arctanElementwise inverse-tangent function (a.k.a.1
numpy.hypotComputes the hypoteneous of orthogonal vectors of given length.PR15901
numpy.arctan2Elementwise inverse-tangent of the ratio of two arrays.1PR15890
numpy.degreesConverts angles from radians to degrees elementwise.1
numpy.radiansConverts angles from degrees to radians elementwise.1
numpy.unwrapUnwrap by changing deltas between values to 2*pi complement.
numpy.deg2radConverts angles from degrees to radians elementwise.1PR16015
numpy.rad2degConverts angles from radians to degrees elementwise.1

Hyperbolic functions

opdescriptionstatusnote
numpy.sinhElementwise hyperbolic sine function.1
numpy.coshElementwise hyperbolic cosine function.1
numpy.tanhElementwise hyperbolic tangent function.1
numpy.arcsinhElementwise inverse of hyperbolic sine function.1
numpy.arccoshElementwise inverse of hyperbolic cosine function.1
numpy.arctanhElementwise inverse of hyperbolic tangent function.1

Rounding

opdescriptionstatusnote
numpy.aroundRounds to the given number of decimals.
numpy.round_
numpy.rintRounds each element of an array to the nearest integer.1
numpy.fixIf given value x is positive, it return floor(x).1
numpy.floorRounds each element of an array to its floor integer.1
numpy.ceilRounds each element of an array to its ceiling integer.1
numpy.truncRounds each element of an array towards zero.1

Sums, products, differences

opdescriptionstatusnote
numpy.prodReturns the product of an array along given axes.1
numpy.sumReturns the sum of an array along given axes.1
numpy.cumprodReturns the cumulative product of an array along a given axis.1PR15855
numpy.cumsumReturns the cumulative sum of an array along a given axis.1PR15309
numpy.diffCalculate the n-th discrete difference along the given axis.1PR15906

Exponents and logarithms

opdescriptionstatusnote
numpy.expElementwise exponential function.1
numpy.expm1Computes exp(x)` `-` `1 elementwise.1
numpy.exp2Elementwise exponentiation with base 2.WIP sguangyo@
numpy.logElementwise natural logarithm function.1
numpy.log10Elementwise common logarithm function.1
numpy.log2Elementwise binary logarithm function.1
numpy.log1pComputes log(1` `+` `x) elementwise.1
numpy.logaddexpComputes log(exp(x1)` `+` `exp(x2)) elementwise.1
numpy.logaddexp2Computes log2(exp2(x1)` `+` `exp2(x2)) elementwise.1

Other special functions

opdescriptionstatusnote
numpy.i0Modified Bessel function of the first kind, order 0.
numpy.sincElementwise sinc function.

Floating point routines

opdescriptionstatusnote
numpy.signbitTests elementwise if the sign bit is set (i.e.
numpy.copysignReturns the first argument with the sign bit of the second elementwise.
numpy.frexpDecomposes each element to mantissa and two’s exponent.
numpy.ldexpComputes x1` `*` `2` `**` `x2 elementwise.
numpy.nextafterComputes the nearest neighbor float values towards the second argument.

Arithmetic operations

opdescriptionstatusnote
numpy.addAdds two arrays elementwise.1
numpy.reciprocalComputes 1` `/` `x elementwise.1
numpy.negativeTakes numerical negative elementwise.1
numpy.multiplyMultiplies two arrays elementwise.1
numpy.divideElementwise true division (i.e.1
numpy.powerComputes x1` `**` `x2 elementwise.1
numpy.subtractSubtracts arguments elementwise.1
numpy.true_divideElementwise true division (i.e.1
numpy.floor_divideElementwise floor division (i.e.1
numpy.fmodComputes the remainder of C division elementwise.
numpy.modComputes the remainder of Python division elementwise.1
numpy.modfExtracts the fractional and integral parts of an array elementwise.
numpy.remainderComputes the remainder of Python division elementwise.1
numpy.divmod

Handling complex numbers

opdescriptionstatusnote
numpy.angleReturns the angle of the complex argument.
numpy.realReturns the real part of the elements of the array.
numpy.imagReturns the imaginary part of the elements of the array.
numpy.conjReturns the complex conjugate, element-wise.

Miscellaneous

opdescriptionfinishnote
numpy.clipClips the values of an array to a given interval.1
numpy.sqrtElementwise square root function.1
numpy.cbrtElementwise cube root function.1
numpy.squareElementwise square function.1
numpy.absoluteElementwise absolute value function.1
numpy.signElementwise sign function.1
numpy.maximumTakes the maximum of two arrays elementwise.1
numpy.minimumTakes the minimum of two arrays elementwise.1
numpy.fmaxTakes the maximum of two arrays elementwise.WIP(tvm) guangtai@ #15800
numpy.fminTakes the minimum of two arrays elementwise.
numpy.nan_to_numElementwise nan_to_num function.
numpy.blackmanReturns the Blackman window.1PR15815
numpy.hammingReturns the Hamming window.1
numpy.hanningReturns the Hanning window.1

Padding

opdescriptionstatusnote
numpy.padReturns padded array.

Random Sampling (**numpy.random**)

The big difference of [``numpy.random Unlike NumPy, CuPy allows itself to replace its random number generator across its major versions. It means that numbers generated by numpy.random of a new major version may not be the same as that of its previous one even if the same seed and distribution are used.

Sample random data

opdescriptionstatusnote
numpy.random.randReturns an array of uniform random values over the interval [0,` `1).
numpy.random.randnReturns an array of standard normal random values.
numpy.random.randintReturns a scalar or an array of integer values over [low,` `high).1
numpy.random.random_integersReturn a scalar or an array of integer values over [low,` `high]
numpy.random.random_sampleReturns an array of random values over the interval [0,` `1).
numpy.random.randomReturns an array of random values over the interval [0,` `1).
numpy.random.ranfReturns an array of random values over the interval [0,` `1).
numpy.random.sampleReturns an array of random values over the interval [0,` `1).
numpy.random.choiceReturns an array of random values from a given 1-D array.1
numpy.random.bytesReturns random bytes.

Distributions

opdescriptionstatusnote
numpy.random.betaBeta distribution.
numpy.random.binomialBinomial distribution.
numpy.random.chisquareChi-square distribution.
numpy.random.dirichletDirichlet distribution.
numpy.random.exponentialExponential distribution.
numpy.random.fF distribution.
numpy.random.gammaGamma distribution.1
numpy.random.geometricGeometric distribution.
numpy.random.gumbelReturns an array of samples drawn from a Gumbel distribution.
numpy.random.hypergeometrichypergeometric distribution.
numpy.random.laplaceLaplace distribution.
numpy.random.logisticLogistic distribution.
numpy.random.lognormalReturns an array of samples drawn from a log normal distribution.
numpy.random.logseriesLog series distribution.
numpy.random.multinomialReturns an array from multinomial distribution.1
numpy.random.multivariate_normal(experimental) Multivariate normal distribution.
numpy.random.negative_binomialNegative binomial distribution.
numpy.random.noncentral_chisquareNoncentral chisquare distribution.
numpy.random.noncentral_fNoncentral F distribution.
numpy.random.normalReturns an array of normally distributed samples.1
numpy.random.paretoPareto II or Lomax distribution.
numpy.random.poissonPoisson distribution.
numpy.random.powerPower distribution.
numpy.random.rayleighRayleigh distribution.
numpy.random.standard_cauchyStandard cauchy distribution.
numpy.random.standard_exponentialStandard exponential distribution.
numpy.random.standard_gammaStandard gamma distribution.
numpy.random.standard_normalReturns an array of samples drawn from the standard normal distribution.
numpy.random.standard_tStandard Student’s t distribution.
numpy.random.triangularTriangular distribution.
numpy.random.uniformReturns an array of uniformly-distributed samples over an interval.1
numpy.random.vonmisesvon Mises distribution.
numpy.random.waldWald distribution.
numpy.random.weibullweibull distribution.
numpy.random.zipfZipf distribution.

Random generator

opdescriptionstatusnote
numpy.random.RandomStatePortable container of a pseudo-random number generator.
numpy.random.seedResets the state of the random number generator with a seed.
numpy.random.get_random_stateGets the state of the random number generator for the current device.
numpy.random.set_random_stateSets the state of the random number generator for the current device.

Note CuPy does not provide numpy.random.get_state nor numpy.random.set_state at this time. Use [``numpy.random.get_random_state()

Permutations

opdescriptionstatusnote
numpy.random.shuffleShuffles an array.1
numpy.random.permutationReturns a permuted range or a permutation of an array.

Sorting, Searching, and Counting

Sorting

opdescriptionstatusnote
numpy.sortReturns a sorted copy of an array with a stable sorting algorithm.
numpy.lexsortPerform an indirect sort using an array of keys.
numpy.argsortReturns the indices that would sort an array with a stable sorting.1
numpy.msortReturns a copy of an array sorted along the first axis.
numpy.partitionReturns a partitioned copy of an array.
numpy.argpartitionReturns the indices that would partially sort an array.

See also numpy.ndarray.sort()

Searching

opdescriptionstatusnote
numpy.argmaxReturns the indices of the maximum along an axis.1
numpy.argminReturns the indices of the minimum along an axis.
numpy.nonzeroReturn the indices of the elements that are non-zero.1
numpy.flatnonzeroReturn indices that are non-zero in the flattened version of a.
numpy.whereReturn elements, either from x or y, depending on condition.

Counting

opdescriptionstatusnote
numpy.count_nonzeroCounts the number of non-zero values in the array.


  • No labels