About 50 results
Open links in new tab
  1. python - What does .shape [] do in "for i in range (Y.shape [0 ...

    The shape attribute for numpy arrays returns the dimensions of the array. If Y has n rows and m columns, then Y.shape is (n,m). So Y.shape[0] is n.

  2. Difference between numpy.array shape (R, 1) and (R,)

    Shape n, expresses the shape of a 1D array with n items, and n, 1 the shape of a n-row x 1-column array. (R,) and (R,1) just add (useless) parentheses but still express respectively 1D and 2D array …

  3. arrays - what does numpy ndarray shape do? - Stack Overflow

    Nov 30, 2017 · yourarray.shape or np.shape() or np.ma.shape() returns the shape of your ndarray as a tuple; And you can get the (number of) dimensions of your array using yourarray.ndim or np.ndim(). …

  4. What does shape[0] and shape[1] do in python? - Stack Overflow

    Jul 21, 2018 · In python shape[0] returns the dimension but in this code it is returning total number of set. Please can someone tell me work of shape[0] and shape[1]? Code: m_train = …

  5. python - x.shape [0] vs x [0].shape in NumPy - Stack Overflow

    Jan 7, 2018 · On the other hand, x.shape is a 2-tuple which represents the shape of x, which in this case is (10, 1024). x.shape[0] gives the first element in that tuple, which is 10. Here's a demo with some …

  6. python - What does -1 mean in numpy reshape? - Stack Overflow

    Sep 9, 2013 · The criterion to satisfy for providing the new shape is that 'The new shape should be compatible with the original shape' numpy allow us to give one of new shape parameter as -1 (eg: (2, …

  7. tensorflow placeholder - understanding `shape= [None,`

    You can think of a placeholder in TensorFlow as an operation specifying the shape and type of data that will be fed into the graph.placeholder X defines that an unspecified number of rows of shape (128, …

  8. python - What does 'range (y.shape [1])' mean in "for i in range ...

    Jan 29, 2021 · .shape returns a tuple (number of row, number of columns). Therefore dataset.shape [1] is the number of columns. i in range (dataset.shape [1]) simply iterates from 0 through the number of …

  9. shape = 19, shape = 20 and shape=16 in R graphics [duplicate]

    Jan 23, 2020 · The shape = 19 symbol seems to have a fill and stroke when examined in Illustrator. It does have only one colour though (that is used for both fill and stroke).

  10. I want to know what it means (height,width)=img.shape[:2]

    Feb 1, 2021 · The shape property of the img object evidently is a list which contains some image data, the first two elements of which are here being copied into variables height and width.