Yahoo Αναζήτηση Διαδυκτίου

Αποτελέσματα Αναζήτησης

  1. 14 Μαρ 2017 · By definition, the axis number of the dimension is the index of that dimension within the array's shape. It is also the position used to access that dimension during indexing. For example, if a 2D array a has shape (5,6), then you can access a[0,0] up to a[4,5].

  2. You can use the function numpy.nonzero(), or the nonzero() method of an array. import numpy as np A = np.array([[2,4], [6,2]]) index= np.nonzero(A>1) OR (A>1).nonzero() Output: (array([0, 1]), array([1, 0])) First array in output depicts the row index and second array depicts the corresponding column index.

  3. ndarrays can be indexed using the standard Python x[obj] syntax, where x is the array and obj the selection. There are different kinds of indexing available depending on obj: basic indexing, advanced indexing and field access. Most of the following examples show the use of indexing when referencing data in an array.

  4. Use the axis keyword to get the indices of maximum and minimum values along a specific axis: >>> np . argmax ( a , axis = 0 ) array([[1, 1, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 1]]) >>> np . argmax ( a , axis = 1 ) array([[2, 2, 2, 2, 2], [2, 2, 2, 2, 2]]) >>> np . argmax ( a , axis = 2 ) array([[4, 4, 4], [4, 4, 4]]) >>> np . argmin ( a ...

  5. 10 Δεκ 2018 · Essentially all Python sequences work like this. In any Python sequence – like a list, tuple, or string – the index starts at 0. Numbering of NumPy axes essentially works the same way. They are numbered starting with 0. So the “first” axis is actually “axis 0.” The “second” axis is “axis 1,” and so on.

  6. 26 Μαρ 2014 · Indexing ¶. ndarrays can be indexed using the standard Python x [obj] syntax, where x is the array and obj the selection. There are three kinds of indexing available: record access, basic slicing, advanced indexing. Which one occurs depends on obj. Note.

  7. put_along_axis (arr, indices, values, axis) Put values into the destination array by matching 1d index and data slices. putmask (a, mask, values) Changes elements of an array based on conditional and input values. fill_diagonal (a, val [, wrap]) Fill the main diagonal of the given array of any dimensionality.

  1. Γίνεται επίσης αναζήτηση για