ee.Array.reshape
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zmienia kształt tablicy na nową listę długości wymiarów.
Wykorzystanie | Zwroty |
---|
Array.reshape(shape) | Tablica |
Argument | Typ | Szczegóły |
---|
to: array | Tablica | Tablica do przekształcenia. |
shape | Tablica | Nowy kształt, na który zostaną przekonwertowane tablice. Jeśli jeden ze składników kształtu ma wartość specjalną -1, rozmiar tego wymiaru jest obliczany tak, aby całkowity rozmiar pozostał stały. W szczególności kształt [-1] spłaszcza się do 1-D. Maksymalnie 1 element kształtu może mieć wartość -1. |
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003ereshape\u003c/code\u003e method modifies the structure of an array without changing its data.\u003c/p\u003e\n"],["\u003cp\u003eIt allows you to specify a new shape using the \u003ccode\u003eshape\u003c/code\u003e argument, which is an array of dimension lengths.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003e-1\u003c/code\u003e within the \u003ccode\u003eshape\u003c/code\u003e array automatically calculates the size of that dimension to maintain the total number of elements.\u003c/p\u003e\n"]]],[],null,["# ee.Array.reshape\n\nReshapes an array to a new list of dimension lengths.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------|---------|\n| Array.reshape`(shape)` | Array |\n\n| Argument | Type | Details |\n|---------------|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `array` | Array | Array to reshape. |\n| `shape` | Array | New shape to which arrays are converted. If one component of the shape is the special value -1, the size of that dimension is computed so that the total size remains constant. In particular, a shape of \\[-1\\] flattens into 1-D. At most one component of shape can be -1. |"]]