About 4,310,000 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. python - 'list' object has no attribute 'shape' - Stack Overflow

    Jan 9, 2014 · 8 list object in python does not have 'shape' attribute because 'shape' implies that all the columns (or rows) have equal length along certain dimension. Let's say list variable a has following …

  3. PyTorch: How to get the shape of a Tensor as a list of int

    Oct 19, 2017 · Instead of calling list, does the Size class have some sort of attribute I can access directly to get the shape in a tuple or list form?

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

  5. r - How would one add a new shape, with both outline color and fill ...

    Jun 27, 2025 · Donuts (hollow circles) are also intriguing. What would it take to build one of these shapes and incorporate it fully into ggplot's machinery so that "it just works" whenever a user says …

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

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

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

  9. ValueError: Arguments `target` and `output` must have the same shape ...

    May 13, 2024 · 3 Your labels have a shape of (16,), while your model's output has a shape of (None,3). Probably the issue is that your labels are not one-hot encoded. They should have the same second …

  10. ValueError: Must pass 2-d input. shape= - Stack Overflow

    Mar 31, 2022 · Our objective is to create a data frame with a shape of (2,3,2) as follows: first index or 2 = row in the data frame second index or 3 = columns in the data frame third index or 2 = values in th...