About 187,000 results
Open links in new tab
  1. NumPy Array Shape - GeeksforGeeks

    Dec 28, 2023 · How can we get the Shape of an Array? In NumPy, we will use an attribute called shape which returns a tuple, the elements of the tuple give the lengths of the corresponding …

  2. Python shape() method - All you need to know! - DigitalOcean

    Aug 4, 2022 · To understand the output, the tuple returned by the shape () method is the actual number of elements that represent the value of the dimension of the object. Usually, on a …

  3. numpy.shape — NumPy v2.2 Manual

    numpy.shape# numpy. shape (a) [source] # Return the shape of an array. Parameters: a array_like. Input array. Returns: shape tuple of ints. The elements of the shape tuple give the …

  4. How To Get Shape of a List in Python

    Aug 27, 2021 · The shape of a list normally returns the number of objects in a list. We can calculate a shape of a list using two methods, len() and NumPy array shape. Numpy has an …

  5. How to get the the shape and the type of any object in Python

    May 9, 2022 · What you can do is check for the data type of the object using type() and then use len() or np.shape or df.shape accordingly. To get the shape of a list or a tuple which are (1-D) …

  6. NumPy Shape and Array Dimensions in Python - Python Guides

    5 days ago · Learn how to use NumPy shape in Python to understand and manipulate array dimensions. Examples with real-world data, reshaping techniques, and common solutions.

  7. NumPy Array Shape - W3Schools

    Get the Shape of an Array. NumPy arrays have an attribute called shape that returns a tuple with each index having the number of corresponding elements.

  8. NumPy: Get the dimensions, shape, and size of an array

    Apr 23, 2025 · You can get the number of dimensions, the shape (length of each dimension), and the size (total number of elements) of a NumPy array (numpy.ndarray) using the ndim, shape, …

  9. Python Shape Function: Find Dimensions of Arrays and DataFrames

    Jul 6, 2021 · The shape function in Python is used to find the dimensions of data structures, such as NumPy arrays and Pandas DataFrames. It returns a tuple representing the dimensions, …

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

  11. Some results have been removed
Refresh