ee.Reducer.forEachElement
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
به طور جداگانه هر موقعیت را در ورودی های آرایه با شکل مساوی کاهش می دهد و خروجی آرایه ای با همان شکل تولید می کند.
به عنوان مثال، با اعمال کاهنده "جمع" به 5 آرایه با شکل 2x2، خروجی یک آرایه 2x2 خواهد بود، که در آن هر موقعیت مجموع 5 مقدار در آن موقعیت است.
استفاده | برمی گرداند | Reducer. forEachElement () | کاهنده |
استدلال | تایپ کنید | جزئیات | این: reducer | کاهنده | کاهنده برای اعمال به هر عنصر آرایه. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eApplies a reducer function to corresponding elements across multiple arrays of the same shape.\u003c/p\u003e\n"],["\u003cp\u003eOutputs a single array mirroring the input shape, with each element representing the reduced value of corresponding input elements.\u003c/p\u003e\n"],["\u003cp\u003eOffers flexibility through the \u003ccode\u003eforEachElement\u003c/code\u003e method to specify the reducer function.\u003c/p\u003e\n"],["\u003cp\u003eIllustrated with an example using the 'sum' reducer to aggregate values across five 2x2 arrays into a resultant 2x2 array.\u003c/p\u003e\n"]]],[],null,["# ee.Reducer.forEachElement\n\nSeparately reduces each position in array inputs of equal shape, producing an array output of the same shape.\n\n\u003cbr /\u003e\n\nFor example, with the 'sum' reducer applied to 5 arrays with shape 2x2, the output will be a 2x2 array, where each position is the sum of the 5 values at that position.\n\n| Usage | Returns |\n|----------------------------|---------|\n| Reducer.forEachElement`()` | Reducer |\n\n| Argument | Type | Details |\n|-----------------|---------|---------------------------------------------|\n| this: `reducer` | Reducer | The reducer to apply to each array element. |"]]