ee.Array.repeat
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ทำซ้ำอาร์เรย์ตามแกนที่ระบุ ผลลัพธ์จะมีรูปร่างเหมือนอินพุต ยกเว้นความยาวตามแกนที่ซ้ำกันจะคูณด้วยจำนวนสำเนาที่ระบุ
การใช้งาน | การคืนสินค้า |
---|
Array.repeat(axis, copies) | อาร์เรย์ |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ array | อาร์เรย์ | อาร์เรย์ที่จะทำซ้ำ |
axis | จำนวนเต็ม ค่าเริ่มต้น: 0 | แกนที่จะทำซ้ำอาร์เรย์ |
copies | จำนวนเต็ม ค่าเริ่มต้น: 2 | จำนวนสำเนาของอาร์เรย์นี้ที่จะต่อกันตามแกนที่ระบุ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003eArray.repeat()\u003c/code\u003e creates a new array by repeating the original array along a specified axis.\u003c/p\u003e\n"],["\u003cp\u003eThe size of the new array remains the same except for the specified axis, which is multiplied by the number of copies.\u003c/p\u003e\n"],["\u003cp\u003eYou can control which axis to repeat along and how many times using the \u003ccode\u003eaxis\u003c/code\u003e and \u003ccode\u003ecopies\u003c/code\u003e parameters.\u003c/p\u003e\n"],["\u003cp\u003eIt's a convenient way to expand an array by duplicating its elements.\u003c/p\u003e\n"]]],[],null,["# ee.Array.repeat\n\nRepeats the array along the given axis. The result will have the shape of the input, except length along the repeated axis will be multiplied by the given number of copies.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------------------|---------|\n| Array.repeat`(`*axis* `, `*copies*`)` | Array |\n\n| Argument | Type | Details |\n|---------------|---------------------|-------------------------------------------------------------------------|\n| this: `array` | Array | Array to repeat. |\n| `axis` | Integer, default: 0 | The axis along which to repeat the array. |\n| `copies` | Integer, default: 2 | The number of copies of this array to concatenate along the given axis. |"]]