About 6,200,000 results
Open links in new tab
  1. 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 …

  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 …

  3. python - Numpy array dimensions - Stack Overflow

    Jun 22, 2023 · In Numpy, dimension, axis/axes, shape are related and sometimes similar concepts: dimension In Mathematics/Physics, dimension or dimensionality is informally …

  4. Numpy Typing with specific shape and datatype - Stack Overflow

    Feb 14, 2022 · Currently, shape type information is reflected in ndarray.shape. However, most numpy functions that change the dimension or size of an array, however, don't necessarily …

  5. numpy: "size" vs. "shape" in function arguments? - Stack Overflow

    Oct 22, 2018 · 26 I noticed that some numpy operations take an argument called shape, such as np.zeros, whereas some others take an argument called size, such as np.random.randint. To …

  6. 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.

  7. Numpy Vector (N,1) dimension -> (N,) dimension conversion

    Apr 19, 2015 · Numpy Vector (N,1) dimension -> (N,) dimension conversion Asked 12 years, 4 months ago Modified 3 years, 1 month ago Viewed 110k times

  8. python - shape vs len for numpy array - Stack Overflow

    May 24, 2016 · Looking at property vs method answers, it all points to usability and readability of code. So again, in your case, I would say if you want information about the whole dataframe …

  9. Type hinting / annotation (PEP 484) for numpy.ndarray

    Feb 28, 2016 · Has anyone implemented type hinting for the specific numpy.ndarray class? Right now, I'm using typing.Any, but it would be nice to have something more specific. For instance …

  10. 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 …