ee.Array.add
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
بر اساس عنصر، مقدار اول را به مقدار دوم اضافه می کند.
استفاده | برمی گرداند | Array. add (right) | آرایه |
استدلال | تایپ کنید | جزئیات | این: left | آرایه | مقدار سمت چپ. |
right | آرایه | مقدار سمت راست. |
نمونه ها
ویرایشگر کد (جاوا اسکریپت)
var empty = ee.Array([], ee.PixelType.int8());
print(empty.add(empty)); // []
print(ee.Array([0]).add(1)); // [1]
print(ee.Array([1]).add([2])); // [3]
print(ee.Array([-3]).add([-4])); // [-7]
print(ee.Array([5, 6]).add([7, 8])); // [12,14]
var array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]]);
print(array2x3.add(1)); // [[1,2,3],[4,5,6]]
print(array2x3.add(array2x3)); // [[0,2,4],[6,8,10]]
راه اندازی پایتون
برای اطلاعات در مورد API پایتون و استفاده از geemap
برای توسعه تعاملی به صفحه محیط پایتون مراجعه کنید.
import ee
import geemap.core as geemap
کولب (پایتون)
empty = ee.Array([], ee.PixelType.int8())
display(empty.add(empty)) # []
display(ee.Array([0]).add(1)) # [1]
display(ee.Array([1]).add([2])) # [3]
display(ee.Array([-3]).add([-4])) # [-7]
display(ee.Array([5, 6]).add([7, 8])) # [12 ,14]
array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]])
display(array2x3.add(1)) # [[1, 2 ,3], [4, 5, 6]]
display(array2x3.add(array2x3)) # [[0, 2, 4], [6, 8, 10]]
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eArray.add()\u003c/code\u003e performs element-wise addition, adding the corresponding elements of two arrays or an array and a scalar.\u003c/p\u003e\n"],["\u003cp\u003eThe method returns a new array with the results of the addition.\u003c/p\u003e\n"],["\u003cp\u003eIt supports both single values and multi-dimensional arrays as input.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eArray.add()\u003c/code\u003e can be used with both server-side objects (like Images) and client-side objects (like Lists).\u003c/p\u003e\n"]]],["The `Array.add(right)` function performs element-wise addition between two arrays. The left-hand array is added to the right-hand array or value, returning a new array. It supports adding a scalar value to an array or adding two arrays of the same dimensions. Examples show how an empty array added to itself returns an empty array, single element arrays added to a scalar or array, as well as multi-element and multi-dimensional array addition.\n"],null,["# ee.Array.add\n\nOn an element-wise basis, adds the first value to the second.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------|---------|\n| Array.add`(right)` | Array |\n\n| Argument | Type | Details |\n|--------------|-------|-----------------------|\n| this: `left` | Array | The left-hand value. |\n| `right` | Array | The right-hand value. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nvar empty = ee.Array([], ee.PixelType.int8());\nprint(empty.add(empty)); // []\n\nprint(ee.Array([0]).add(1)); // [1]\nprint(ee.Array([1]).add([2])); // [3]\nprint(ee.Array([-3]).add([-4])); // [-7]\n\nprint(ee.Array([5, 6]).add([7, 8])); // [12,14]\n\nvar array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]]);\nprint(array2x3.add(1)); // [[1,2,3],[4,5,6]]\nprint(array2x3.add(array2x3)); // [[0,2,4],[6,8,10]]\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nempty = ee.Array([], ee.PixelType.int8())\ndisplay(empty.add(empty)) # []\n\ndisplay(ee.Array([0]).add(1)) # [1]\ndisplay(ee.Array([1]).add([2])) # [3]\ndisplay(ee.Array([-3]).add([-4])) # [-7]\n\ndisplay(ee.Array([5, 6]).add([7, 8])) # [12 ,14]\n\narray2x3 = ee.Array([[0, 1, 2], [3, 4, 5]])\ndisplay(array2x3.add(1)) # [[1, 2 ,3], [4, 5, 6]]\ndisplay(array2x3.add(array2x3)) # [[0, 2, 4], [6, 8, 10]]\n```"]]