numpy.tri()

numpy.tri(N, M=None, k=0, dtype=) [source] An array with ones at and below the given diagonal and zeros elsewhere. Parameters: N : int Number of rows in the array. M : int, optional Number of columns in the array. By default, M is taken equal to N. k : int, optional The sub-diagonal at and below which the array is filled. k = 0 is the main diagonal, while k < 0 is below it, and k > 0 is above. The default is 0. dtype : dtype, optional Data type of the returned array. The defau

numpy.trapz()

numpy.trapz(y, x=None, dx=1.0, axis=-1) [source] Integrate along the given axis using the composite trapezoidal rule. Integrate y (x) along given axis. Parameters: y : array_like Input array to integrate. x : array_like, optional The sample points corresponding to the y values. If x is None, the sample points are assumed to be evenly spaced dx apart. The default is None. dx : scalar, optional The spacing between sample points when x is None. The default is 1. axis : int, optional Th

numpy.transpose()

numpy.transpose(a, axes=None) [source] Permute the dimensions of an array. Parameters: a : array_like Input array. axes : list of ints, optional By default, reverse the dimensions, otherwise permute the axes according to the values given. Returns: p : ndarray a with its axes permuted. A view is returned whenever possible. See also moveaxis, argsort Notes Use transpose(a, argsort(axes)) to invert the transposition of tensors when using the axes keyword argument. Transposing a 1-D

numpy.tile()

numpy.tile(A, reps) [source] Construct an array by repeating A the number of times given by reps. If reps has length d, the result will have dimension of max(d, A.ndim). If A.ndim < d, A is promoted to be d-dimensional by prepending new axes. So a shape (3,) array is promoted to (1, 3) for 2-D replication, or shape (1, 1, 3) for 3-D replication. If this is not the desired behavior, promote A to d-dimensions manually before calling this function. If A.ndim > d, reps is promoted to A.nd

numpy.trace()

numpy.trace(a, offset=0, axis1=0, axis2=1, dtype=None, out=None) [source] Return the sum along diagonals of the array. If a is 2-D, the sum along its diagonal with the given offset is returned, i.e., the sum of elements a[i,i+offset] for all i. If a has more than two dimensions, then the axes specified by axis1 and axis2 are used to determine the 2-D sub-arrays whose traces are returned. The shape of the resulting array is the same as that of a with axis1 and axis2 removed. Parameters: a :

numpy.testing.run_module_suite()

numpy.testing.run_module_suite(file_to_run=None, argv=None) [source] Run a test module. Equivalent to calling $ nosetests <argv> <file_to_run> from the command line Parameters: file_to_run : str, optional Path to test module, or None. By default, run the module from which this function is called. argv : list of strings Arguments to be passed to the nose test runner. argv[0] is ignored. All command line arguments accepted by nosetests will work. If it is the default value Non

numpy.testing.Tester

numpy.testing.Tester [source] alias of NoseTester

numpy.testing.rundocs()

numpy.testing.rundocs(filename=None, raise_on_error=True) [source] Run doctests found in the given file. By default rundocs raises an AssertionError on failure. Parameters: filename : str The path to the file for which the doctests are run. raise_on_error : bool Whether to raise an AssertionError when a doctest fails. Default is True. Notes The doctests can be run by the user/developer by adding the doctests argument to the test() call. For example, to run all tests (including doctest

numpy.testing.decorators.skipif()

numpy.testing.decorators.skipif(skip_condition, msg=None) [source] Make function raise SkipTest exception if a given condition is true. If the condition is a callable, it is used at runtime to dynamically make the decision. This is useful for tests that may require costly imports, to delay the cost until the test suite is actually executed. Parameters: skip_condition : bool or callable Flag to determine whether to skip the decorated test. msg : str, optional Message to give on raising a

numpy.testing.decorators.slow()

numpy.testing.decorators.slow(t) [source] Label a test as ?slow?. The exact definition of a slow test is obviously both subjective and hardware-dependent, but in general any individual test that requires more than a second or two should be labeled as slow (the whole suite consits of thousands of tests, so even a second is significant). Parameters: t : callable The test to label as slow. Returns: t : callable The decorated test t. Examples The numpy.testing module includes import dec