About 3,440,000 results
Open links in new tab
  1. python - What does -1 mean in numpy reshape? - Stack Overflow

    Sep 9, 2013 · numpy.reshape(r, shape=(5, 5, 8)) will do the job. Note that, once you fix first dim = 5 and second dim = 5, you don't need to determine third dimension. To assist your laziness, …

  2. python - Reshape an array in NumPy - Stack Overflow

    Jan 23, 2013 · Reshape an array in NumPy Asked 12 years, 11 months ago Modified 6 years, 6 months ago Viewed 146k times

  3. numpy - Python reshape list to ndim array - Stack Overflow

    Feb 16, 2016 · The examples you provide are inconsistent: (1) you cannot reshape a list with 8 elements into a 2x2 array. (2) what is np.shape = (28, 100) supposed to do?

  4. python - How does numpy reshape works? - Stack Overflow

    Apr 2, 2015 · 9 When you use b = a.reshape((5,4,5)) you just create a different view on the same data used by the array a. (ie changes to the elements of a will appear in b). reshape() does not …

  5. python - Reshape numpy (n,) vector to (n,1) vector - Stack Overflow

    Sep 17, 2016 · b_new = b.reshape((10, 1)) The amount of memory used should not differ at all between the 2 shapes. Numpy arrays use the concept of strides and so the dimensions (10,) …

  6. python - Reshape numpy array having only one dimension - Stack …

    Jun 7, 2018 · Secondly, you can pass -1 to one dimension of reshape (both the function np.reshape and the method np.ndarray.reshape). In your case, if you know the total size is a …

  7. python - Numpy para qué sirve el -1 en reshape () - Stack …

    Nov 29, 2020 · 0 Lo que hace reshape(-1) es mantener esa dimensión de tamaño indefinido y hacer que se ajuste al resto de las dimensiones, por eso numpy solo te lo permite hacer una …

  8. python - Convert a 1D array to a 2D array in numpy - Stack Overflow

    Sep 25, 2012 · Note that np.reshape also accepts an optional keyword order that lets you switch from row-major C order to column-major Fortran order. np.reshape is the function version of …

  9. python - How to reshape a list without numpy - Stack Overflow

    May 14, 2019 · The code below should do the trick. The solution given below very general. The input list can be a nested list of lists of an any old/undesired shape; it need not be a list of …

  10. python - What is x_train.reshape () and What it Does? - Stack …

    May 2, 2020 · 0 reshape() function is generally used to change the shape of an array without changing the data. x_train.reshape([-1,num_features]) in this command x_train will be …