About 11,700,000 results
Open links in new tab
  1. 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. python - shape vs len for numpy array - Stack Overflow

    May 24, 2016 · Still, performance-wise, the difference should be negligible except for a giant giant 2D dataframe. So in line with the previous answers, df.shape is good if you need both dimensions, for a …

  4. How to find the size or shape of a DataFrame in PySpark?

    Why doesn't Pyspark Dataframe simply store the shape values like pandas dataframe does with .shape? Having to call count seems incredibly resource-intensive for such a common and simple operation.

  5. Keras input explanation: input_shape, units, batch_size, dim, etc

    Jun 25, 2017 · For any Keras layer (Layer class), can someone explain how to understand the difference between input_shape, units, dim, etc.? For example the doc says units specify the output shape of a …

  6. 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 know how to …

  7. python - Explaining the differences between dim, shape, rank, …

    Mar 1, 2014 · I'm new to python and numpy in general. I read several tutorials and still so confused between the differences in dim, ranks, shape, aixes and dimensions. My mind seems to be stuck at …

  8. python - Keras Dense layer Output Shape - Stack Overflow

    For example, output shape of Dense layer is based on units defined in the layer where as output shape of Conv layer depends on filters. Another thing to remember is, by default, last dimension of any …

  9. How do I create an empty array and then append to it in NumPy?

    That is the wrong mental model for using NumPy efficiently. NumPy arrays are stored in contiguous blocks of memory. To append rows or columns to an existing array, the entire array needs to be …

  10. How do I get the row count of a Pandas DataFrame?

    Apr 11, 2013 · There's one good reason why to use shape in interactive work, instead of len (df): Trying out different filtering, I often need to know how many items remain. With shape I can see that just by …