From 2864bd215e02052a37bb3659d7dc3e4a5731dbd3 Mon Sep 17 00:00:00 2001 From: Justin Braaten Date: Wed, 30 Aug 2023 11:24:08 -0700 Subject: [PATCH] Use `display` instead of `print` for existing Py API ee.Array code snippets PiperOrigin-RevId: 561398392 --- samples/python/apidocs/ee_array_abs.py | 6 +- samples/python/apidocs/ee_array_accum.py | 22 +++---- samples/python/apidocs/ee_array_acos.py | 6 +- samples/python/apidocs/ee_array_add.py | 14 ++-- samples/python/apidocs/ee_array_and.py | 18 +++--- samples/python/apidocs/ee_array_argmax.py | 10 +-- samples/python/apidocs/ee_array_asin.py | 6 +- samples/python/apidocs/ee_array_atan.py | 6 +- samples/python/apidocs/ee_array_bitcount.py | 22 +++---- .../python/apidocs/ee_array_bitstoarray.py | 12 ++-- .../python/apidocs/ee_array_bitwise_and.py | 20 +++--- .../python/apidocs/ee_array_bitwise_not.py | 16 ++--- samples/python/apidocs/ee_array_bitwise_or.py | 22 +++---- .../python/apidocs/ee_array_bitwise_xor.py | 14 ++-- samples/python/apidocs/ee_array_bitwiseand.py | 20 +++--- samples/python/apidocs/ee_array_bitwisenot.py | 16 ++--- samples/python/apidocs/ee_array_bitwiseor.py | 22 +++---- samples/python/apidocs/ee_array_bitwisexor.py | 14 ++-- samples/python/apidocs/ee_array_byte.py | 10 +-- samples/python/apidocs/ee_array_cat.py | 36 +++++------ samples/python/apidocs/ee_array_cbrt.py | 12 ++-- samples/python/apidocs/ee_array_ceil.py | 12 ++-- samples/python/apidocs/ee_array_cos.py | 10 +-- samples/python/apidocs/ee_array_cosh.py | 6 +- samples/python/apidocs/ee_array_cut.py | 16 ++--- samples/python/apidocs/ee_array_eigen.py | 40 ++++++------ samples/python/apidocs/ee_array_eq.py | 16 ++--- samples/python/apidocs/ee_array_erf.py | 6 +- samples/python/apidocs/ee_array_erfc.py | 6 +- samples/python/apidocs/ee_array_erfcinv.py | 6 +- samples/python/apidocs/ee_array_erfinv.py | 6 +- samples/python/apidocs/ee_array_exp.py | 4 +- samples/python/apidocs/ee_array_first.py | 10 +-- .../python/apidocs/ee_array_first_nonzero.py | 16 ++--- .../python/apidocs/ee_array_firstnonzero.py | 16 ++--- samples/python/apidocs/ee_array_get.py | 12 ++-- samples/python/apidocs/ee_array_gt.py | 10 +-- samples/python/apidocs/ee_array_gte.py | 10 +-- samples/python/apidocs/ee_array_identity.py | 8 +-- samples/python/apidocs/ee_array_log.py | 2 +- samples/python/apidocs/ee_array_log10.py | 2 +- samples/python/apidocs/ee_array_lt.py | 10 +-- samples/python/apidocs/ee_array_lte.py | 10 +-- samples/python/apidocs/ee_array_mask.py | 16 ++--- samples/python/apidocs/ee_array_max.py | 4 +- samples/python/apidocs/ee_array_min.py | 4 +- samples/python/apidocs/ee_array_mod.py | 16 ++--- samples/python/apidocs/ee_array_multiply.py | 14 ++-- samples/python/apidocs/ee_array_neq.py | 16 ++--- samples/python/apidocs/ee_array_not.py | 8 +-- samples/python/apidocs/ee_array_or.py | 4 +- samples/python/apidocs/ee_array_pow.py | 20 +++--- samples/python/apidocs/ee_array_sin.py | 10 +-- samples/python/apidocs/ee_array_sinh.py | 6 +- samples/python/apidocs/ee_array_slice.py | 64 +++++++++---------- samples/python/apidocs/ee_array_subtract.py | 8 +-- samples/python/apidocs/ee_array_tan.py | 6 +- samples/python/apidocs/ee_array_tanh.py | 6 +- 58 files changed, 380 insertions(+), 380 deletions(-) diff --git a/samples/python/apidocs/ee_array_abs.py b/samples/python/apidocs/ee_array_abs.py index ece9ae86e..01bf31e25 100644 --- a/samples/python/apidocs/ee_array_abs.py +++ b/samples/python/apidocs/ee_array_abs.py @@ -13,7 +13,7 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_abs] -print(ee.Array([-1]).abs().getInfo()) # [1] -print(ee.Array([-2, 0, 2]).abs().getInfo()) # [2, 0, 2] -print(ee.Array([[-3.1, -2], [-1, 0]]).abs().getInfo()) # [[3.1, 2], [1, 0]] +display(ee.Array([-1]).abs()) # [1] +display(ee.Array([-2, 0, 2]).abs()) # [2, 0, 2] +display(ee.Array([[-3.1, -2], [-1, 0]]).abs()) # [[3.1, 2], [1, 0]] # [END earthengine__apidocs__ee_array_abs] diff --git a/samples/python/apidocs/ee_array_accum.py b/samples/python/apidocs/ee_array_accum.py index 3c4de3376..3f5b9965c 100644 --- a/samples/python/apidocs/ee_array_accum.py +++ b/samples/python/apidocs/ee_array_accum.py @@ -13,32 +13,32 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_accum] -print(ee.Array([-1]).accum(0).getInfo()) # [-1] -print(ee.Array([-2, 1]).accum(0).getInfo()) # [-2, -1] -print(ee.Array([-2, 1, 9]).accum(0).getInfo()) # [-2, -1, 8] +display(ee.Array([-1]).accum(0)) # [-1] +display(ee.Array([-2, 1]).accum(0)) # [-2, -1] +display(ee.Array([-2, 1, 9]).accum(0)) # [-2, -1, 8] # accum over 2D arrays with different axes. -print(ee.Array([[1, 3], [5, 7]]).accum(0).getInfo()) # [[1, 3],[6, 10]] -print(ee.Array([[1, 3], [5, 7]]).accum(1).getInfo()) # [[1, 4],[5, 12]] +display(ee.Array([[1, 3], [5, 7]]).accum(0)) # [[1, 3],[6, 10]] +display(ee.Array([[1, 3], [5, 7]]).accum(1)) # [[1, 4],[5, 12]] # sum is the default reducer. -print(ee.Array([2, -2, 3, 1]).accum(0).getInfo()) # [2, 0, 3, 4] +display(ee.Array([2, -2, 3, 1]).accum(0)) # [2, 0, 3, 4] # [2, 0, 3, 4] -print(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.sum()).getInfo()) +display(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.sum())) # Some example reducers. # [2, 2, 3, 3] -print(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.max()).getInfo()) +display(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.max())) # [2, 0, 1, 1] -print(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.mean()).getInfo()) +display(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.mean())) # [2, -2, -2, -2] -print(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.min()).getInfo()) +display(ee.Array([2, -2, 3, 1]).accum(0, ee.Reducer.min())) # [2, -4, -12] -print(ee.Array([2, -2, 3]).accum(0, ee.Reducer.product()).getInfo()) +display(ee.Array([2, -2, 3]).accum(0, ee.Reducer.product())) # [END earthengine__apidocs__ee_array_accum] diff --git a/samples/python/apidocs/ee_array_acos.py b/samples/python/apidocs/ee_array_acos.py index 3753db786..05544f705 100644 --- a/samples/python/apidocs/ee_array_acos.py +++ b/samples/python/apidocs/ee_array_acos.py @@ -17,9 +17,9 @@ import altair as alt import pandas as pd -print(ee.Array([-1]).acos().getInfo()) # [π] -print(ee.Array([0]).acos().getInfo()) # [π/2] -print(ee.Array([1]).acos().getInfo()) # [0] +display(ee.Array([-1]).acos()) # [π] +display(ee.Array([0]).acos()) # [π/2] +display(ee.Array([1]).acos()) # [0] start = -1 end = 1 diff --git a/samples/python/apidocs/ee_array_add.py b/samples/python/apidocs/ee_array_add.py index 0af84c091..9bca0d6ba 100644 --- a/samples/python/apidocs/ee_array_add.py +++ b/samples/python/apidocs/ee_array_add.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_add] empty = ee.Array([], ee.PixelType.int8()) -print(empty.add(empty).getInfo()) # [] +display(empty.add(empty)) # [] -print(ee.Array([0]).add(1).getInfo()) # [1] -print(ee.Array([1]).add([2]).getInfo()) # [3] -print(ee.Array([-3]).add([-4]).getInfo()) # [-7] +display(ee.Array([0]).add(1)) # [1] +display(ee.Array([1]).add([2])) # [3] +display(ee.Array([-3]).add([-4])) # [-7] -print(ee.Array([5, 6]).add([7, 8]).getInfo()) # [12 ,14] +display(ee.Array([5, 6]).add([7, 8])) # [12 ,14] array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]]) -print(array2x3.add(1).getInfo()) # [[1, 2 ,3], [4, 5, 6]] -print(array2x3.add(array2x3).getInfo()) # [[0, 2, 4], [6, 8, 10]] +display(array2x3.add(1)) # [[1, 2 ,3], [4, 5, 6]] +display(array2x3.add(array2x3)) # [[0, 2, 4], [6, 8, 10]] # [END earthengine__apidocs__ee_array_add] diff --git a/samples/python/apidocs/ee_array_and.py b/samples/python/apidocs/ee_array_and.py index 9852a4183..6ee55f31e 100644 --- a/samples/python/apidocs/ee_array_and.py +++ b/samples/python/apidocs/ee_array_and.py @@ -22,19 +22,19 @@ # Any non-zero value is true. array_larger = ee.Array([-2, 2]) -print(array_both.And(array_larger).getInfo()) # [1, 1] -print(array_both.And(array_neither).getInfo()) # [0, 0] +display(array_both.And(array_larger)) # [1, 1] +display(array_both.And(array_neither)) # [0, 0] -print(array_first.And(array_second).getInfo()) # [0, 0] -print(array_second.And(array_first).getInfo()) # [0, 0] +display(array_first.And(array_second)) # [0, 0] +display(array_second.And(array_first)) # [0, 0] -print(array_both.And(array_first).getInfo()) # [1, 0] -print(array_both.And(array_second).getInfo()) # [0, 1] +display(array_both.And(array_first)) # [1, 0] +display(array_both.And(array_second)) # [0, 1] -print(array_neither.And(array_first).getInfo()) # [0, 0] -print(array_neither.And(array_second).getInfo()) # [0, 0] +display(array_neither.And(array_first)) # [0, 0] +display(array_neither.And(array_second)) # [0, 0] # Works the same for all PixelTypes. array_double = ee.Array([0.0, 2.0], ee.PixelType.double()) -print(array_both.And(array_double).getInfo()) # [0, 1] +display(array_both.And(array_double)) # [0, 1] # [END earthengine__apidocs__ee_array_and] diff --git a/samples/python/apidocs/ee_array_argmax.py b/samples/python/apidocs/ee_array_argmax.py index 3c39a88c4..a4ec1bbe1 100644 --- a/samples/python/apidocs/ee_array_argmax.py +++ b/samples/python/apidocs/ee_array_argmax.py @@ -16,12 +16,12 @@ # Return the position of the maximum value in each dimension. # Returns null if the array is empty. -print(ee.Array([], ee.PixelType.int8()).argmax().getInfo()) # None +display(ee.Array([], ee.PixelType.int8()).argmax()) # None -print(ee.Array([9]).argmax().getInfo()) # [0] -print(ee.Array([0, -1, 2, 1]).argmax().getInfo()) # [2] -print(ee.Array([[3, 4, 2], [6, 5, 7]]).argmax().getInfo()) # [1, 2] +display(ee.Array([9]).argmax()) # [0] +display(ee.Array([0, -1, 2, 1]).argmax()) # [2] +display(ee.Array([[3, 4, 2], [6, 5, 7]]).argmax()) # [1, 2] # Returns the first occurrence of the maximum. -print(ee.Array([1, 1, 1, 9, 9, 9]).argmax().getInfo()) # [3] +display(ee.Array([1, 1, 1, 9, 9, 9]).argmax()) # [3] # [END earthengine__apidocs__ee_array_argmax] diff --git a/samples/python/apidocs/ee_array_asin.py b/samples/python/apidocs/ee_array_asin.py index 066a14663..c459372d7 100644 --- a/samples/python/apidocs/ee_array_asin.py +++ b/samples/python/apidocs/ee_array_asin.py @@ -17,9 +17,9 @@ import altair as alt import pandas as pd -print(ee.Array([-1]).asin().getInfo()) # [-π/2] -print(ee.Array([0]).asin().getInfo()) # [0] -print(ee.Array([1]).asin().getInfo()) # [π/2] +display(ee.Array([-1]).asin()) # [-π/2] +display(ee.Array([0]).asin()) # [0] +display(ee.Array([1]).asin()) # [π/2] start = -1 end = 1 diff --git a/samples/python/apidocs/ee_array_atan.py b/samples/python/apidocs/ee_array_atan.py index 41d7e5cb7..5fa405969 100644 --- a/samples/python/apidocs/ee_array_atan.py +++ b/samples/python/apidocs/ee_array_atan.py @@ -17,9 +17,9 @@ import altair as alt import pandas as pd -print(ee.Array([-5]).atan().getInfo()) # [-1.3734] -print(ee.Array([0]).atan().getInfo()) # [0] -print(ee.Array([5]).atan().getInfo()) # [1.3734] +display(ee.Array([-5]).atan()) # [-1.3734] +display(ee.Array([0]).atan()) # [0] +display(ee.Array([5]).atan()) # [1.3734] start = -5 end = 5 diff --git a/samples/python/apidocs/ee_array_bitcount.py b/samples/python/apidocs/ee_array_bitcount.py index 714b33e0a..01e7777b3 100644 --- a/samples/python/apidocs/ee_array_bitcount.py +++ b/samples/python/apidocs/ee_array_bitcount.py @@ -13,19 +13,19 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_bitcount] -print(ee.Array([], ee.PixelType.int8()).bitCount().getInfo()) # [] +display(ee.Array([], ee.PixelType.int8()).bitCount()) # [] -print(ee.Array([0]).bitCount().getInfo()) # [0] -print(ee.Array([1]).bitCount().getInfo()) # [1] -print(ee.Array([2]).bitCount().getInfo()) # [1] -print(ee.Array([3]).bitCount().getInfo()) # [2] -print(ee.Array([0xFFFF]).bitCount().getInfo()) # [16] -print(ee.Array([1, 2, 3]).bitCount().getInfo()) # [1, 1, 2] +display(ee.Array([0]).bitCount()) # [0] +display(ee.Array([1]).bitCount()) # [1] +display(ee.Array([2]).bitCount()) # [1] +display(ee.Array([3]).bitCount()) # [2] +display(ee.Array([0xFFFF]).bitCount()) # [16] +display(ee.Array([1, 2, 3]).bitCount()) # [1, 1, 2] -print(ee.Array([[0, 1], [6, 13]]).bitCount().getInfo()) # [[0, 1], [2, 3]] +display(ee.Array([[0, 1], [6, 13]]).bitCount()) # [[0, 1], [2, 3]] # https://en.wikipedia.org/wiki/Two's_complement signed values. -print(ee.Array([-1]).bitCount().getInfo()) # [64] -print(ee.Array([-1], ee.PixelType.int8()).bitCount().getInfo()) # [64] -print(ee.Array([-2]).bitCount().getInfo()) # [63] +display(ee.Array([-1]).bitCount()) # [64] +display(ee.Array([-1], ee.PixelType.int8()).bitCount()) # [64] +display(ee.Array([-2]).bitCount()) # [63] # [END earthengine__apidocs__ee_array_bitcount] diff --git a/samples/python/apidocs/ee_array_bitstoarray.py b/samples/python/apidocs/ee_array_bitstoarray.py index dc4ed56c6..7773bd20e 100644 --- a/samples/python/apidocs/ee_array_bitstoarray.py +++ b/samples/python/apidocs/ee_array_bitstoarray.py @@ -13,10 +13,10 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_bitstoarray] -print(ee.Array.bitsToArray(0).getInfo()) # [0] -print(ee.Array.bitsToArray(1).getInfo()) # [1] -print(ee.Array.bitsToArray(5).getInfo()) # [1, 0 , 1] -print(ee.Array.bitsToArray(0xFF).getInfo()) # [1, 1, 1, 1, 1, 1, 1, 1] -print(ee.Array.bitsToArray(-1).getInfo()) # Array of 64 "1" values -print(ee.Array.bitsToArray(-1).toInt8().getInfo()) # Array of 64 "1" values +display(ee.Array.bitsToArray(0)) # [0] +display(ee.Array.bitsToArray(1)) # [1] +display(ee.Array.bitsToArray(5)) # [1, 0 , 1] +display(ee.Array.bitsToArray(0xFF)) # [1, 1, 1, 1, 1, 1, 1, 1] +display(ee.Array.bitsToArray(-1)) # Array of 64 "1" values +display(ee.Array.bitsToArray(-1).toInt8()) # Array of 64 "1" values # [END earthengine__apidocs__ee_array_bitstoarray] diff --git a/samples/python/apidocs/ee_array_bitwise_and.py b/samples/python/apidocs/ee_array_bitwise_and.py index 358c35989..1edfeb152 100644 --- a/samples/python/apidocs/ee_array_bitwise_and.py +++ b/samples/python/apidocs/ee_array_bitwise_and.py @@ -14,17 +14,17 @@ # [START earthengine__apidocs__ee_array_bitwise_and] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwise_and(empty).getInfo()) # [] +display(empty.bitwise_and(empty)) # [] -print(ee.Array(0).bitwise_and(ee.Array(0)).getInfo()) # 0 -print(ee.Array(0).bitwise_and(ee.Array(1)).getInfo()) # 0 -print(ee.Array(1).bitwise_and(ee.Array(0)).getInfo()) # 0 -print(ee.Array(1).bitwise_and(ee.Array(1)).getInfo()) # 1 -print(ee.Array(0xFF).bitwise_and(ee.Array(0xFFFF)).getInfo()) # 255 -print(ee.Array(0xFFFF).bitwise_and(ee.Array(0xFF)).getInfo()) # 255 +display(ee.Array(0).bitwise_and(ee.Array(0))) # 0 +display(ee.Array(0).bitwise_and(ee.Array(1))) # 0 +display(ee.Array(1).bitwise_and(ee.Array(0))) # 0 +display(ee.Array(1).bitwise_and(ee.Array(1))) # 1 +display(ee.Array(0xFF).bitwise_and(ee.Array(0xFFFF))) # 255 +display(ee.Array(0xFFFF).bitwise_and(ee.Array(0xFF))) # 255 -print(ee.Array(-1).bitwise_and(ee.Array(0xFF)).getInfo()) # 255 -print(ee.Array(-1).bitwise_and(ee.Array(-2)).getInfo()) # -2 +display(ee.Array(-1).bitwise_and(ee.Array(0xFF))) # 255 +display(ee.Array(-1).bitwise_and(ee.Array(-2))) # -2 -print(ee.Array([6, 6]).bitwise_and(ee.Array([1, 11])).getInfo()) # [0, 2] +display(ee.Array([6, 6]).bitwise_and(ee.Array([1, 11]))) # [0, 2] # [END earthengine__apidocs__ee_array_bitwise_and] diff --git a/samples/python/apidocs/ee_array_bitwise_not.py b/samples/python/apidocs/ee_array_bitwise_not.py index 2c05f7330..e3fd947d0 100644 --- a/samples/python/apidocs/ee_array_bitwise_not.py +++ b/samples/python/apidocs/ee_array_bitwise_not.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_bitwise_not] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwise_not().getInfo()) # [] +display(empty.bitwise_not()) # [] -print(ee.Array(0).bitwise_not().getInfo()) # -1 -print(ee.Array(1).bitwise_not().getInfo()) # -2 -print(ee.Array(0xFF).bitwise_not().getInfo()) # -256 +display(ee.Array(0).bitwise_not()) # -1 +display(ee.Array(1).bitwise_not()) # -2 +display(ee.Array(0xFF).bitwise_not()) # -256 -print(ee.Array(-1).bitwise_not().getInfo()) # 0 -print(ee.Array(-2).bitwise_not().getInfo()) # 1 -print(ee.Array(-3).bitwise_not().getInfo()) # 2 +display(ee.Array(-1).bitwise_not()) # 0 +display(ee.Array(-2).bitwise_not()) # 1 +display(ee.Array(-3).bitwise_not()) # 2 -print(ee.Array(0xFF).toInt64().bitwise_not().getInfo()) # -256 +display(ee.Array(0xFF).toInt64().bitwise_not()) # -256 # [END earthengine__apidocs__ee_array_bitwise_not] diff --git a/samples/python/apidocs/ee_array_bitwise_or.py b/samples/python/apidocs/ee_array_bitwise_or.py index e58b47a71..c13d85cd4 100644 --- a/samples/python/apidocs/ee_array_bitwise_or.py +++ b/samples/python/apidocs/ee_array_bitwise_or.py @@ -14,19 +14,19 @@ # [START earthengine__apidocs__ee_array_bitwise_or] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwise_or(empty).getInfo()) # [] +display(empty.bitwise_or(empty)) # [] -print(ee.Array(0).bitwise_or(ee.Array(0)).getInfo()) # 0 -print(ee.Array(0).bitwise_or(ee.Array(1)).getInfo()) # 1 -print(ee.Array(1).bitwise_or(ee.Array(0)).getInfo()) # 1 -print(ee.Array(1).bitwise_or(ee.Array(1)).getInfo()) # 1 +display(ee.Array(0).bitwise_or(ee.Array(0))) # 0 +display(ee.Array(0).bitwise_or(ee.Array(1))) # 1 +display(ee.Array(1).bitwise_or(ee.Array(0))) # 1 +display(ee.Array(1).bitwise_or(ee.Array(1))) # 1 -print(ee.Array(0xFF).bitwise_or(ee.Array(0xFFFF)).getInfo()) # 65535 -print(ee.Array(0xFFFF).bitwise_or(ee.Array(0xFF)).getInfo()) # 65535 +display(ee.Array(0xFF).bitwise_or(ee.Array(0xFFFF))) # 65535 +display(ee.Array(0xFFFF).bitwise_or(ee.Array(0xFF))) # 65535 -print(ee.Array(-1).bitwise_or(ee.Array(0xFF)).getInfo()) # -1 -print(ee.Array(-2).bitwise_or(ee.Array(-3)).getInfo()) # -1 -print(ee.Array(-2).bitwise_or(ee.Array(-4)).getInfo()) # -2 +display(ee.Array(-1).bitwise_or(ee.Array(0xFF))) # -1 +display(ee.Array(-2).bitwise_or(ee.Array(-3))) # -1 +display(ee.Array(-2).bitwise_or(ee.Array(-4))) # -2 -print(ee.Array([6, 6]).bitwise_or(ee.Array([1, 11])).getInfo()) # [7, 15] +display(ee.Array([6, 6]).bitwise_or(ee.Array([1, 11]))) # [7, 15] # [END earthengine__apidocs__ee_array_bitwise_or] diff --git a/samples/python/apidocs/ee_array_bitwise_xor.py b/samples/python/apidocs/ee_array_bitwise_xor.py index 9091b2b4a..f27988279 100644 --- a/samples/python/apidocs/ee_array_bitwise_xor.py +++ b/samples/python/apidocs/ee_array_bitwise_xor.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_bitwise_xor] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwise_xor(empty).getInfo()) # [] +display(empty.bitwise_xor(empty)) # [] -print(ee.Array(0).bitwise_xor(ee.Array(0)).getInfo()) # 0 -print(ee.Array(0).bitwise_xor(ee.Array(1)).getInfo()) # 1 -print(ee.Array(1).bitwise_xor(ee.Array(0)).getInfo()) # 1 -print(ee.Array(1).bitwise_xor(ee.Array(1)).getInfo()) # 0 +display(ee.Array(0).bitwise_xor(ee.Array(0))) # 0 +display(ee.Array(0).bitwise_xor(ee.Array(1))) # 1 +display(ee.Array(1).bitwise_xor(ee.Array(0))) # 1 +display(ee.Array(1).bitwise_xor(ee.Array(1))) # 0 -print(ee.Array(0x00FF).bitwise_xor(ee.Array(0xFF00)).getInfo()) # 65535 +display(ee.Array(0x00FF).bitwise_xor(ee.Array(0xFF00))) # 65535 # [4, 10, 19] -print(ee.Array([1, 2, 3]).bitwise_xor(ee.Array([5, 8, 16])).getInfo()) +display(ee.Array([1, 2, 3]).bitwise_xor(ee.Array([5, 8, 16]))) # [END earthengine__apidocs__ee_array_bitwise_xor] diff --git a/samples/python/apidocs/ee_array_bitwiseand.py b/samples/python/apidocs/ee_array_bitwiseand.py index f9c8e8ea1..9c0d6d047 100644 --- a/samples/python/apidocs/ee_array_bitwiseand.py +++ b/samples/python/apidocs/ee_array_bitwiseand.py @@ -14,17 +14,17 @@ # [START earthengine__apidocs__ee_array_bitwiseand] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwiseAnd(empty).getInfo()) # [] +display(empty.bitwiseAnd(empty)) # [] -print(ee.Array(0).bitwiseAnd(ee.Array(0)).getInfo()) # 0 -print(ee.Array(0).bitwiseAnd(ee.Array(1)).getInfo()) # 0 -print(ee.Array(1).bitwiseAnd(ee.Array(0)).getInfo()) # 0 -print(ee.Array(1).bitwiseAnd(ee.Array(1)).getInfo()) # 1 -print(ee.Array(0xFF).bitwiseAnd(ee.Array(0xFFFF)).getInfo()) # 255 -print(ee.Array(0xFFFF).bitwiseAnd(ee.Array(0xFF)).getInfo()) # 255 +display(ee.Array(0).bitwiseAnd(ee.Array(0))) # 0 +display(ee.Array(0).bitwiseAnd(ee.Array(1))) # 0 +display(ee.Array(1).bitwiseAnd(ee.Array(0))) # 0 +display(ee.Array(1).bitwiseAnd(ee.Array(1))) # 1 +display(ee.Array(0xFF).bitwiseAnd(ee.Array(0xFFFF))) # 255 +display(ee.Array(0xFFFF).bitwiseAnd(ee.Array(0xFF))) # 255 -print(ee.Array(-1).bitwiseAnd(ee.Array(0xFF)).getInfo()) # 255 -print(ee.Array(-1).bitwiseAnd(ee.Array(-2)).getInfo()) # -2 +display(ee.Array(-1).bitwiseAnd(ee.Array(0xFF))) # 255 +display(ee.Array(-1).bitwiseAnd(ee.Array(-2))) # -2 -print(ee.Array([6, 6]).bitwiseAnd(ee.Array([1, 11])).getInfo()) # [0, 2] +display(ee.Array([6, 6]).bitwiseAnd(ee.Array([1, 11]))) # [0, 2] # [END earthengine__apidocs__ee_array_bitwiseand] diff --git a/samples/python/apidocs/ee_array_bitwisenot.py b/samples/python/apidocs/ee_array_bitwisenot.py index 88ca412bd..901778d28 100644 --- a/samples/python/apidocs/ee_array_bitwisenot.py +++ b/samples/python/apidocs/ee_array_bitwisenot.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_bitwisenot] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwiseNot().getInfo()) # [] +display(empty.bitwiseNot()) # [] -print(ee.Array(0).bitwiseNot().getInfo()) # -1 -print(ee.Array(1).bitwiseNot().getInfo()) # -2 -print(ee.Array(0xFF).bitwiseNot().getInfo()) # -256 +display(ee.Array(0).bitwiseNot()) # -1 +display(ee.Array(1).bitwiseNot()) # -2 +display(ee.Array(0xFF).bitwiseNot()) # -256 -print(ee.Array(-1).bitwiseNot().getInfo()) # 0 -print(ee.Array(-2).bitwiseNot().getInfo()) # 1 -print(ee.Array(-3).bitwiseNot().getInfo()) # 2 +display(ee.Array(-1).bitwiseNot()) # 0 +display(ee.Array(-2).bitwiseNot()) # 1 +display(ee.Array(-3).bitwiseNot()) # 2 -print(ee.Array(0xFF).toInt64().bitwiseNot().getInfo()) # -256 +display(ee.Array(0xFF).toInt64().bitwiseNot()) # -256 # [END earthengine__apidocs__ee_array_bitwisenot] diff --git a/samples/python/apidocs/ee_array_bitwiseor.py b/samples/python/apidocs/ee_array_bitwiseor.py index b3b741425..391b0752e 100644 --- a/samples/python/apidocs/ee_array_bitwiseor.py +++ b/samples/python/apidocs/ee_array_bitwiseor.py @@ -14,19 +14,19 @@ # [START earthengine__apidocs__ee_array_bitwiseor] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwiseOr(empty).getInfo()) # [] +display(empty.bitwiseOr(empty)) # [] -print(ee.Array(0).bitwiseOr(ee.Array(0)).getInfo()) # 0 -print(ee.Array(0).bitwiseOr(ee.Array(1)).getInfo()) # 1 -print(ee.Array(1).bitwiseOr(ee.Array(0)).getInfo()) # 1 -print(ee.Array(1).bitwiseOr(ee.Array(1)).getInfo()) # 1 +display(ee.Array(0).bitwiseOr(ee.Array(0))) # 0 +display(ee.Array(0).bitwiseOr(ee.Array(1))) # 1 +display(ee.Array(1).bitwiseOr(ee.Array(0))) # 1 +display(ee.Array(1).bitwiseOr(ee.Array(1))) # 1 -print(ee.Array(0xFF).bitwiseOr(ee.Array(0xFFFF)).getInfo()) # 65535 -print(ee.Array(0xFFFF).bitwiseOr(ee.Array(0xFF)).getInfo()) # 65535 +display(ee.Array(0xFF).bitwiseOr(ee.Array(0xFFFF))) # 65535 +display(ee.Array(0xFFFF).bitwiseOr(ee.Array(0xFF))) # 65535 -print(ee.Array(-1).bitwiseOr(ee.Array(0xFF)).getInfo()) # -1 -print(ee.Array(-2).bitwiseOr(ee.Array(-3)).getInfo()) # -1 -print(ee.Array(-2).bitwiseOr(ee.Array(-4)).getInfo()) # -2 +display(ee.Array(-1).bitwiseOr(ee.Array(0xFF))) # -1 +display(ee.Array(-2).bitwiseOr(ee.Array(-3))) # -1 +display(ee.Array(-2).bitwiseOr(ee.Array(-4))) # -2 -print(ee.Array([6, 6]).bitwiseOr(ee.Array([1, 11])).getInfo()) # [7, 15] +display(ee.Array([6, 6]).bitwiseOr(ee.Array([1, 11]))) # [7, 15] # [END earthengine__apidocs__ee_array_bitwiseor] diff --git a/samples/python/apidocs/ee_array_bitwisexor.py b/samples/python/apidocs/ee_array_bitwisexor.py index 7bd4258ab..974613cf9 100644 --- a/samples/python/apidocs/ee_array_bitwisexor.py +++ b/samples/python/apidocs/ee_array_bitwisexor.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_bitwisexor] empty = ee.Array([], ee.PixelType.int8()) -print(empty.bitwiseXor(empty).getInfo()) # [] +display(empty.bitwiseXor(empty)) # [] -print(ee.Array(0).bitwiseXor(ee.Array(0)).getInfo()) # 0 -print(ee.Array(0).bitwiseXor(ee.Array(1)).getInfo()) # 1 -print(ee.Array(1).bitwiseXor(ee.Array(0)).getInfo()) # 1 -print(ee.Array(1).bitwiseXor(ee.Array(1)).getInfo()) # 0 +display(ee.Array(0).bitwiseXor(ee.Array(0))) # 0 +display(ee.Array(0).bitwiseXor(ee.Array(1))) # 1 +display(ee.Array(1).bitwiseXor(ee.Array(0))) # 1 +display(ee.Array(1).bitwiseXor(ee.Array(1))) # 0 -print(ee.Array(0x00FF).bitwiseXor(ee.Array(0xFF00)).getInfo()) # 65535 +display(ee.Array(0x00FF).bitwiseXor(ee.Array(0xFF00))) # 65535 # [4, 10, 19] -print(ee.Array([1, 2, 3]).bitwiseXor(ee.Array([5, 8, 16])).getInfo()) +display(ee.Array([1, 2, 3]).bitwiseXor(ee.Array([5, 8, 16]))) # [END earthengine__apidocs__ee_array_bitwisexor] diff --git a/samples/python/apidocs/ee_array_byte.py b/samples/python/apidocs/ee_array_byte.py index ab0ab19d0..b870d5921 100644 --- a/samples/python/apidocs/ee_array_byte.py +++ b/samples/python/apidocs/ee_array_byte.py @@ -14,14 +14,14 @@ # [START earthengine__apidocs__ee_array_byte] # Clamps below at 0. -print(ee.Array([-1]).byte().getInfo()) # [0] -print(ee.Array([255]).byte().getInfo()) # [255] +display(ee.Array([-1]).byte()) # [0] +display(ee.Array([255]).byte()) # [255] # Clamps above at 255. -print(ee.Array([256]).byte().getInfo()) # [255] +display(ee.Array([256]).byte()) # [255] # Rounds. [0, 0, 1, 127, 255, 255] -print(ee.Array([-0.1, 0.1, 0.5, 127.1, 255.1, 255.9]).byte().getInfo()) +display(ee.Array([-0.1, 0.1, 0.5, 127.1, 255.1, 255.9]).byte()) # Requires an explicit PixelType if no data. -print(ee.Array([[], []], ee.PixelType.float()).byte().getInfo()) # [[], []] +display(ee.Array([[], []], ee.PixelType.float()).byte()) # [[], []] # [END earthengine__apidocs__ee_array_byte] diff --git a/samples/python/apidocs/ee_array_cat.py b/samples/python/apidocs/ee_array_cat.py index c4e513235..b84b2d267 100644 --- a/samples/python/apidocs/ee_array_cat.py +++ b/samples/python/apidocs/ee_array_cat.py @@ -18,27 +18,27 @@ one = ee.Array([1]) two = ee.Array([2]) -print(ee.Array.cat([empty]).getInfo()) # [] -print(ee.Array.cat([empty, empty]).getInfo()) # [] -print(ee.Array.cat([empty, one]).getInfo()) # [1] -print(ee.Array.cat([one, empty]).getInfo()) # [1] -print(ee.Array.cat([one, two]).getInfo()) # [1, 2] +display(ee.Array.cat([empty])) # [] +display(ee.Array.cat([empty, empty])) # [] +display(ee.Array.cat([empty, one])) # [1] +display(ee.Array.cat([one, empty])) # [1] +display(ee.Array.cat([one, two])) # [1, 2] -print(ee.Array.cat([one, two], 0).getInfo()) # [1, 2] -print(ee.Array.cat([one, two], 1).getInfo()) # [[1, 2]] +display(ee.Array.cat([one, two], 0)) # [1, 2] +display(ee.Array.cat([one, two], 1)) # [[1, 2]] a = ee.Array([0, 1, 2]) b = ee.Array([3, 4, 5]) -print(ee.Array.cat([a, b]).getInfo()) # [0, 1, 2, 3, 4, 5] -print(ee.Array.cat([a, b], 0).getInfo()) # [0, 1, 2, 3, 4, 5] -print(ee.Array.cat([a, b], 1).getInfo()) # [[0, 3], [1, 4], [2, 5]] +display(ee.Array.cat([a, b])) # [0, 1, 2, 3, 4, 5] +display(ee.Array.cat([a, b], 0)) # [0, 1, 2, 3, 4, 5] +display(ee.Array.cat([a, b], 1)) # [[0, 3], [1, 4], [2, 5]] c = ee.Array([[0], [1], [2]]) d = ee.Array([[3], [4], [5]]) -print(ee.Array.cat([c, d]).getInfo()) # [[0], [1], [2], [3], [4], [5]] -print(ee.Array.cat([c, d], 0).getInfo()) # [[0], [1], [2], [3], [4], [5]] -print(ee.Array.cat([c, d], 1).getInfo()) # [[0, 3], [1, 4], [2, 5]] -print(ee.Array.cat([c, d], 2).getInfo()) # [[[0, 3]], [[1, 4]], [[2, 5]]] +display(ee.Array.cat([c, d])) # [[0], [1], [2], [3], [4], [5]] +display(ee.Array.cat([c, d], 0)) # [[0], [1], [2], [3], [4], [5]] +display(ee.Array.cat([c, d], 1)) # [[0, 3], [1, 4], [2, 5]] +display(ee.Array.cat([c, d], 2)) # [[[0, 3]], [[1, 4]], [[2, 5]]] e = ee.Array([[[0, 1], [2, 3]], [[4, 5], [6, 7]]]) f = ee.Array([[[10, 11], [12, 13]], [[14, 15], [16, 17]]]) @@ -47,17 +47,17 @@ # [[4, 5], [6, 7]] # [[10, 11], [12, 13]] # [[14, 15], [16, 17]] -print(ee.Array.cat([e, f], 0).getInfo()) +display(ee.Array.cat([e, f], 0)) # [[[0, 1], [2, 3], [10, 11], [12, 13]] # [[4, 5], [6, 7], [14, 15], [16, 17]]] -print(ee.Array.cat([e, f], 1).getInfo()) +display(ee.Array.cat([e, f], 1)) # [[[0, 1, 10, 11], [2, 3, 12, 13]] # [[4, 5, 14, 15], [6, 7, 16, 17]]] -print(ee.Array.cat([e, f], 2).getInfo()) +display(ee.Array.cat([e, f], 2)) # [[[[0, 10], [1, 11]], [[2, 12], [3, 13]]] # [[[4, 14], [5, 15]], [[6, 16], [7, 17]]]] -print(ee.Array.cat([e, f], 3).getInfo()) +display(ee.Array.cat([e, f], 3)) # [END earthengine__apidocs__ee_array_cat] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_cbrt.py b/samples/python/apidocs/ee_array_cbrt.py index cea2a3dd4..142dbee3d 100644 --- a/samples/python/apidocs/ee_array_cbrt.py +++ b/samples/python/apidocs/ee_array_cbrt.py @@ -14,14 +14,14 @@ # [START earthengine__apidocs__ee_array_cbrt] # Requires an explicit PixelType if no data. -print(ee.Array([], ee.PixelType.int8()).cbrt().getInfo()) # [] +display(ee.Array([], ee.PixelType.int8()).cbrt()) # [] -print(ee.Array([0]).cbrt().getInfo()) # [0] -print(ee.Array([27]).cbrt().getInfo()) # [3] -print(ee.Array([-27]).cbrt().getInfo()) # -3 +display(ee.Array([0]).cbrt()) # [0] +display(ee.Array([27]).cbrt()) # [3] +display(ee.Array([-27]).cbrt()) # -3 -print(ee.Array([0, 1, 8, 27]).cbrt().getInfo()) # [0, 1, 2, 3] +display(ee.Array([0, 1, 8, 27]).cbrt()) # [0, 1, 2, 3] # [[0, 1, 2], [3, 4, 5]] -print(ee.Array([[0, 1, 8], [27, 64, 125]]).cbrt().getInfo()) +display(ee.Array([[0, 1, 8], [27, 64, 125]]).cbrt()) # [END earthengine__apidocs__ee_array_cbrt] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_ceil.py b/samples/python/apidocs/ee_array_ceil.py index 00560ac70..e9f18f782 100644 --- a/samples/python/apidocs/ee_array_ceil.py +++ b/samples/python/apidocs/ee_array_ceil.py @@ -14,11 +14,11 @@ # [START earthengine__apidocs__ee_array_ceil] # Requires an explicit PixelType if no data. -print(ee.Array([], ee.PixelType.int8()).ceil().getInfo()) # [] +display(ee.Array([], ee.PixelType.int8()).ceil()) # [] -print(ee.Array([-1.1]).ceil().getInfo()) # [-1] -print(ee.Array([-0.1]).ceil().getInfo()) # [0] -print(ee.Array([0]).ceil().getInfo()) # [0] -print(ee.Array([0.1]).ceil().getInfo()) # [1] -print(ee.Array([1.1]).ceil().getInfo()) # [2] +display(ee.Array([-1.1]).ceil()) # [-1] +display(ee.Array([-0.1]).ceil()) # [0] +display(ee.Array([0]).ceil()) # [0] +display(ee.Array([0.1]).ceil()) # [1] +display(ee.Array([1.1]).ceil()) # [2] # [END earthengine__apidocs__ee_array_ceil] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_cos.py b/samples/python/apidocs/ee_array_cos.py index 463383dee..df4af323d 100644 --- a/samples/python/apidocs/ee_array_cos.py +++ b/samples/python/apidocs/ee_array_cos.py @@ -18,11 +18,11 @@ import pandas as pd π = math.pi -print(ee.Array([-π]).cos().getInfo()) # [-1] -print(ee.Array([-π / 2.0]).cos().getInfo()) # [Almost zero] -print(ee.Array([0]).cos().getInfo()) # [1] -print(ee.Array([π / 2.0]).cos().getInfo()) # [Almost zero] -print(ee.Array([π]).cos().getInfo()) # [-1] +display(ee.Array([-π]).cos()) # [-1] +display(ee.Array([-π / 2.0]).cos()) # [Almost zero] +display(ee.Array([0]).cos()) # [1] +display(ee.Array([π / 2.0]).cos()) # [Almost zero] +display(ee.Array([π]).cos()) # [-1] start = -π end = π diff --git a/samples/python/apidocs/ee_array_cosh.py b/samples/python/apidocs/ee_array_cosh.py index 24c08a5b5..02d023d85 100644 --- a/samples/python/apidocs/ee_array_cosh.py +++ b/samples/python/apidocs/ee_array_cosh.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([-4]).cosh().getInfo()) # [~27.31] -print(ee.Array([0]).cosh().getInfo()) # [1] -print(ee.Array([4]).cosh().getInfo()) # [~27.31] +display(ee.Array([-4]).cosh()) # [~27.31] +display(ee.Array([0]).cosh()) # [1] +display(ee.Array([4]).cosh()) # [~27.31] start = -4 end = 4 diff --git a/samples/python/apidocs/ee_array_cut.py b/samples/python/apidocs/ee_array_cut.py index e161135a6..9409e9976 100644 --- a/samples/python/apidocs/ee_array_cut.py +++ b/samples/python/apidocs/ee_array_cut.py @@ -13,16 +13,16 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_cut] -print(ee.Array([9]).cut([0]).getInfo()) # [9] -print(ee.Array([9]).cut([-1]).getInfo()) # [9] +display(ee.Array([9]).cut([0])) # [9] +display(ee.Array([9]).cut([-1])) # [9] array1x3 = ee.Array([0, 1, 2]) -print(array1x3.cut([-1]).getInfo()) # [0, 1, 2] -print(array1x3.cut([0]).getInfo()) # [0] -print(array1x3.cut([2]).getInfo()) # [2] +display(array1x3.cut([-1])) # [0, 1, 2] +display(array1x3.cut([0])) # [0] +display(array1x3.cut([2])) # [2] array2x3 = ee.Array([[0, 1, 2], [3, 4, 5]]) -print(array2x3.cut([-1, -1]).getInfo()) # [[0, 1, 2], [3 , 4, 5]] -print(array2x3.cut([-1, 0]).getInfo()) # [[0], [3]] -print(array2x3.cut([1, -1]).getInfo()) # [[3, 4, 5]] +display(array2x3.cut([-1, -1])) # [[0, 1, 2], [3 , 4, 5]] +display(array2x3.cut([-1, 0])) # [[0], [3]] +display(array2x3.cut([1, -1])) # [[3, 4, 5]] # [END earthengine__apidocs__ee_array_cut] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_eigen.py b/samples/python/apidocs/ee_array_eigen.py index 8db5648d9..a1547bb33 100644 --- a/samples/python/apidocs/ee_array_eigen.py +++ b/samples/python/apidocs/ee_array_eigen.py @@ -13,62 +13,62 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_eigen] -print(ee.Array([[0, 0], [0, 0]]).eigen().getInfo()) # [[0, 0, 1], [0, 1, 0]] +display(ee.Array([[0, 0], [0, 0]]).eigen()) # [[0, 0, 1], [0, 1, 0]] -print(ee.Array([[1, 0], [0, 0]]).eigen().getInfo()) # [[1, 1, 0], [0,0,1]] -print(ee.Array([[0, 1], [0, 0]]).eigen().getInfo()) # [[0, 0, 1], [0, 1, 0]] -print(ee.Array([[0, 0], [1, 0]]).eigen().getInfo()) # [[0, -1, 0], [0, 0, -1]] -print(ee.Array([[0, 0], [0, 1]]).eigen().getInfo()) # [[1, 0, 1], [0, 1, 0]] +display(ee.Array([[1, 0], [0, 0]]).eigen()) # [[1, 1, 0], [0,0,1]] +display(ee.Array([[0, 1], [0, 0]]).eigen()) # [[0, 0, 1], [0, 1, 0]] +display(ee.Array([[0, 0], [1, 0]]).eigen()) # [[0, -1, 0], [0, 0, -1]] +display(ee.Array([[0, 0], [0, 1]]).eigen()) # [[1, 0, 1], [0, 1, 0]] # [[1, 1, 0], [0, -1/√2, 1/√2]] -print(ee.Array([[1, 1], [0, 0]]).eigen().getInfo()) +display(ee.Array([[1, 1], [0, 0]]).eigen()) # [[1, 0, -1], [0, -1/√2, 1/√2]]] -print(ee.Array([[0, 0], [1, 1]]).eigen().getInfo()) +display(ee.Array([[0, 0], [1, 1]]).eigen()) # [[1, 1/√2, 1/√2], [0, 0, 1]] -print(ee.Array([[1, 0], [1, 0]]).eigen().getInfo()) -print(ee.Array([[1, 0], [0, 1]]).eigen().getInfo()) # [[1, 1, 0], [1, 0, 1]] +display(ee.Array([[1, 0], [1, 0]]).eigen()) +display(ee.Array([[1, 0], [0, 1]]).eigen()) # [[1, 1, 0], [1, 0, 1]] # [[1, 1/√2, 1/√2], [-1, 1/√2, -1/√2]] -print(ee.Array([[0, 1], [1, 0]]).eigen().getInfo()) +display(ee.Array([[0, 1], [1, 0]]).eigen()) # [[1, 1/√2, 1/√2], [0, 1, 0]] -print(ee.Array([[0, 1], [0, 1]]).eigen().getInfo()) +display(ee.Array([[0, 1], [0, 1]]).eigen()) # [[1.62, 0.85, 0.53], [-0.62, 0.53]] -print(ee.Array([[1, 1], [1, 0]]).eigen().getInfo()) -print(ee.Array([[1, 1], [0, 1]]).eigen().getInfo()) # [[1, 0, 1], [1, 1, 0]] -print(ee.Array([[1, 0], [1, 1]]).eigen().getInfo()) # [[1, -1, 0], [1, 0, -1]] +display(ee.Array([[1, 1], [1, 0]]).eigen()) +display(ee.Array([[1, 1], [0, 1]]).eigen()) # [[1, 0, 1], [1, 1, 0]] +display(ee.Array([[1, 0], [1, 1]]).eigen()) # [[1, -1, 0], [1, 0, -1]] # [[1.62, -0.53, -0.85], [-0.62, -0.85, 0.53]] -print(ee.Array([[0, 1], [1, 1]]).eigen().getInfo()) +display(ee.Array([[0, 1], [1, 1]]).eigen()) # [[2, 1/√2, 1/√2], [0, 1/√2, -1/√2]] -print(ee.Array([[1, 1], [1, 1]]).eigen().getInfo()) +display(ee.Array([[1, 1], [1, 1]]).eigen()) matrix = ee.Array([ [1, 0, 0], [0, 1, 0], [0, 0, 1]]) -print(matrix.eigen().getInfo()) # [[1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]] +display(matrix.eigen()) # [[1, 1, 0, 0], [1, 0, 1, 0], [1, 0, 0, 1]] matrix = ee.Array([ [2, 0, 0], [0, 3, 0], [0, 0, 4]]) -print(matrix.eigen().getInfo()) # [[4, 0, 0, 1], [3, 0, 1, 0], [2, 1, 0, 0]] +display(matrix.eigen()) # [[4, 0, 0, 1], [3, 0, 1, 0], [2, 1, 0, 0]] matrix = ee.Array([ [1, 0, 0], [0, 0, 0], [0, 0, 0]]) -print(matrix.eigen().getInfo()) # [[1, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] +display(matrix.eigen()) # [[1, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]] matrix = ee.Array([ [1, 1, 1], [1, 1, 1], [1, 1, 1]]) # [[3, -0.58, -0.58, -0.58], [0, 0, -1/√2, 1/√2], [0, -0.82, 0.41, 0.41]] -print(matrix.eigen().getInfo()) +display(matrix.eigen()) # [END earthengine__apidocs__ee_array_eigen] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_eq.py b/samples/python/apidocs/ee_array_eq.py index d2296adb5..737f714ff 100644 --- a/samples/python/apidocs/ee_array_eq.py +++ b/samples/python/apidocs/ee_array_eq.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_eq] empty = ee.Array([], ee.PixelType.int8()) -print(empty.eq(empty).getInfo()) # [] +display(empty.eq(empty)) # [] -print(ee.Array([0]).eq(ee.Array([1])).getInfo()) # 0 -print(ee.Array([0]).eq(ee.Array([0])).getInfo()) # 1 +display(ee.Array([0]).eq(ee.Array([1]))) # 0 +display(ee.Array([0]).eq(ee.Array([0]))) # 1 -print(ee.Array([1.1]).eq(ee.Array([1.1])).getInfo()) # 1 -print(ee.Array([1.1]).float().eq(ee.Array([1.1])).getInfo()) # 0 -print(ee.Array([1.1]).double().eq(ee.Array([1.1])).getInfo()) # 1 +display(ee.Array([1.1]).eq(ee.Array([1.1]))) # 1 +display(ee.Array([1.1]).float().eq(ee.Array([1.1]))) # 0 +display(ee.Array([1.1]).double().eq(ee.Array([1.1]))) # 1 -print(ee.Array([1]).int8().eq(ee.Array([1])).getInfo()) # 1 -print(ee.Array([1]).int8().eq(ee.Array([1]).int32()).getInfo()) # 1 +display(ee.Array([1]).int8().eq(ee.Array([1]))) # 1 +display(ee.Array([1]).int8().eq(ee.Array([1]).int32())) # 1 # [END earthengine__apidocs__ee_array_eq] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_erf.py b/samples/python/apidocs/ee_array_erf.py index ab5d20554..a86c094d7 100644 --- a/samples/python/apidocs/ee_array_erf.py +++ b/samples/python/apidocs/ee_array_erf.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([-6]).erf().getInfo()) # [-1] -print(ee.Array([0]).erf().getInfo()) # [0] -print(ee.Array([6]).erf().getInfo()) # [1] +display(ee.Array([-6]).erf()) # [-1] +display(ee.Array([0]).erf()) # [0] +display(ee.Array([6]).erf()) # [1] start = -3 end = 3 diff --git a/samples/python/apidocs/ee_array_erfc.py b/samples/python/apidocs/ee_array_erfc.py index 5952fd557..d23fc7c86 100644 --- a/samples/python/apidocs/ee_array_erfc.py +++ b/samples/python/apidocs/ee_array_erfc.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([-6]).erfc().getInfo()) # [2] -print(ee.Array([0]).erfc().getInfo()) # [1] -print(ee.Array([28]).erfc().getInfo()) # [0] +display(ee.Array([-6]).erfc()) # [2] +display(ee.Array([0]).erfc()) # [1] +display(ee.Array([28]).erfc()) # [0] start = -3 end = 3 diff --git a/samples/python/apidocs/ee_array_erfcinv.py b/samples/python/apidocs/ee_array_erfcinv.py index ab5ec4a6b..40527ee4b 100644 --- a/samples/python/apidocs/ee_array_erfcinv.py +++ b/samples/python/apidocs/ee_array_erfcinv.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([0.1]).erfcInv().getInfo()) # [1.163] -print(ee.Array([1]).erfcInv().getInfo()) # [0] -print(ee.Array([1.9]).erfcInv().getInfo()) # [-1.163] +display(ee.Array([0.1]).erfcInv()) # [1.163] +display(ee.Array([1]).erfcInv()) # [0] +display(ee.Array([1.9]).erfcInv()) # [-1.163] start = 0.001 end = 1.999 diff --git a/samples/python/apidocs/ee_array_erfinv.py b/samples/python/apidocs/ee_array_erfinv.py index 24ffb1268..9ecf0bb83 100644 --- a/samples/python/apidocs/ee_array_erfinv.py +++ b/samples/python/apidocs/ee_array_erfinv.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([-0.99]).erfInv().getInfo()) # [-1.82] -print(ee.Array([0]).erfInv().getInfo()) # [0] -print(ee.Array([0.99]).erfInv().getInfo()) # [1.82] +display(ee.Array([-0.99]).erfInv()) # [-1.82] +display(ee.Array([0]).erfInv()) # [0] +display(ee.Array([0.99]).erfInv()) # [1.82] start = -0.99 end = 0.99 diff --git a/samples/python/apidocs/ee_array_exp.py b/samples/python/apidocs/ee_array_exp.py index 16157c255..e880cae63 100644 --- a/samples/python/apidocs/ee_array_exp.py +++ b/samples/python/apidocs/ee_array_exp.py @@ -17,10 +17,10 @@ import pandas as pd empty = ee.Array([], ee.PixelType.int8()) -print(empty.exp().getInfo()) # [] +display(empty.exp()) # [] # [pow(math.e, -1), 1, math.e, 7.389] -print(ee.Array([-1, 0, 1, 2]).exp().getInfo()) +display(ee.Array([-1, 0, 1, 2]).exp()) start = -5 end = 2 diff --git a/samples/python/apidocs/ee_array_first.py b/samples/python/apidocs/ee_array_first.py index be72c1aae..f4e00e97e 100644 --- a/samples/python/apidocs/ee_array_first.py +++ b/samples/python/apidocs/ee_array_first.py @@ -14,10 +14,10 @@ # [START earthengine__apidocs__ee_array_first] empty = ee.Array([], ee.PixelType.int8()) -print(empty.first(empty).getInfo()) # [] +display(empty.first(empty)) # [] -print(ee.Array([0]).first(0).getInfo()) # [0] -print(ee.Array([0, 1, 2]).first(1).getInfo()) # [0,1,2] -print(ee.Array([0, 1, 2]).first(ee.Array([3, 4, 5])).getInfo()) # [0, 1, 2] -print(ee.Array([3, 4, 5]).first(ee.Array([0, 1, 2])).getInfo()) # [3, 4, 5] +display(ee.Array([0]).first(0)) # [0] +display(ee.Array([0, 1, 2]).first(1)) # [0,1,2] +display(ee.Array([0, 1, 2]).first(ee.Array([3, 4, 5]))) # [0, 1, 2] +display(ee.Array([3, 4, 5]).first(ee.Array([0, 1, 2]))) # [3, 4, 5] # [END earthengine__apidocs__ee_array_first] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_first_nonzero.py b/samples/python/apidocs/ee_array_first_nonzero.py index d38d3efb0..e63c1bfef 100644 --- a/samples/python/apidocs/ee_array_first_nonzero.py +++ b/samples/python/apidocs/ee_array_first_nonzero.py @@ -14,16 +14,16 @@ # [START earthengine__apidocs__ee_array_first_nonzero] empty = ee.Array([], ee.PixelType.int8()) -print(empty.first_nonzero(empty).getInfo()) # [] +display(empty.first_nonzero(empty)) # [] -print(ee.Array([0]).first_nonzero(0).getInfo()) # [0] -print(ee.Array([0]).first_nonzero([0]).getInfo()) # [0] -print(ee.Array([0]).first_nonzero([1]).getInfo()) # [1] -print(ee.Array([2]).first_nonzero([3]).getInfo()) # [2] -print(ee.Array([1]).first_nonzero([0]).getInfo()) # [1] +display(ee.Array([0]).first_nonzero(0)) # [0] +display(ee.Array([0]).first_nonzero([0])) # [0] +display(ee.Array([0]).first_nonzero([1])) # [1] +display(ee.Array([2]).first_nonzero([3])) # [2] +display(ee.Array([1]).first_nonzero([0])) # [1] -print(ee.Array([-1, 0, 1]).first_nonzero([2, -1, 2]).getInfo()) # [-1, -1, 1] +display(ee.Array([-1, 0, 1]).first_nonzero([2, -1, 2])) # [-1, -1, 1] # [[1, 2], [3, 4]] -print(ee.Array([[1, 2], [0, 0]]).first_nonzero([[0, 0], [3, 4]]).getInfo()) +display(ee.Array([[1, 2], [0, 0]]).first_nonzero([[0, 0], [3, 4]])) # [END earthengine__apidocs__ee_array_first_nonzero] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_firstnonzero.py b/samples/python/apidocs/ee_array_firstnonzero.py index 9f9266663..ddfa57bf5 100644 --- a/samples/python/apidocs/ee_array_firstnonzero.py +++ b/samples/python/apidocs/ee_array_firstnonzero.py @@ -14,16 +14,16 @@ # [START earthengine__apidocs__ee_array_firstnonzero] empty = ee.Array([], ee.PixelType.int8()) -print(empty.firstNonZero(empty).getInfo()) # [] +display(empty.firstNonZero(empty)) # [] -print(ee.Array([0]).firstNonZero(0).getInfo()) # [0] -print(ee.Array([0]).firstNonZero([0]).getInfo()) # [0] -print(ee.Array([0]).firstNonZero([1]).getInfo()) # [1] -print(ee.Array([2]).firstNonZero([3]).getInfo()) # [2] -print(ee.Array([1]).firstNonZero([0]).getInfo()) # [1] +display(ee.Array([0]).firstNonZero(0)) # [0] +display(ee.Array([0]).firstNonZero([0])) # [0] +display(ee.Array([0]).firstNonZero([1])) # [1] +display(ee.Array([2]).firstNonZero([3])) # [2] +display(ee.Array([1]).firstNonZero([0])) # [1] -print(ee.Array([-1, 0, 1]).firstNonZero([2, -1, 2]).getInfo()) # [-1, -1, 1] +display(ee.Array([-1, 0, 1]).firstNonZero([2, -1, 2])) # [-1, -1, 1] # [[1, 2], [3, 4]] -print(ee.Array([[1, 2], [0, 0]]).firstNonZero([[0, 0], [3, 4]]).getInfo()) +display(ee.Array([[1, 2], [0, 0]]).firstNonZero([[0, 0], [3, 4]])) # [END earthengine__apidocs__ee_array_firstnonzero] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_get.py b/samples/python/apidocs/ee_array_get.py index 7dae9770e..0033094d1 100644 --- a/samples/python/apidocs/ee_array_get.py +++ b/samples/python/apidocs/ee_array_get.py @@ -13,12 +13,12 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_get] -print(ee.Array([9]).get([0]).getInfo()) # 9 -print(ee.Array([8, 7, 6]).get([2]).getInfo()) # 6 +display(ee.Array([9]).get([0])) # 9 +display(ee.Array([8, 7, 6]).get([2])) # 6 array = ee.Array([[0, 1, 2], [3, 4, 5]]) -print(array.get([0, 0]).getInfo()) # 0 -print(array.get([0, 1]).getInfo()) # 1 -print(array.get([1, 0]).getInfo()) # 3 -print(array.get([1, 2]).getInfo()) # 5 +display(array.get([0, 0])) # 0 +display(array.get([0, 1])) # 1 +display(array.get([1, 0])) # 3 +display(array.get([1, 2])) # 5 # [END earthengine__apidocs__ee_array_get] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_gt.py b/samples/python/apidocs/ee_array_gt.py index 7246edfc4..a8aa4bddb 100644 --- a/samples/python/apidocs/ee_array_gt.py +++ b/samples/python/apidocs/ee_array_gt.py @@ -14,11 +14,11 @@ # [START earthengine__apidocs__ee_array_gt] empty = ee.Array([], ee.PixelType.int8()) -print(empty.gt(empty).getInfo()) # [] +display(empty.gt(empty)) # [] -print(ee.Array([0]).gt([0]).getInfo()) # [0] -print(ee.Array([1]).gt([2]).getInfo()) # [0] -print(ee.Array([2]).gt([1]).getInfo()) # [1] +display(ee.Array([0]).gt([0])) # [0] +display(ee.Array([1]).gt([2])) # [0] +display(ee.Array([2]).gt([1])) # [1] -print(ee.Array([-1, 0, 1]).gt([-2, 1, 0]).getInfo()) # [1, 0, 1] +display(ee.Array([-1, 0, 1]).gt([-2, 1, 0])) # [1, 0, 1] # [END earthengine__apidocs__ee_array_gt] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_gte.py b/samples/python/apidocs/ee_array_gte.py index a64d1f3a1..e550ef653 100644 --- a/samples/python/apidocs/ee_array_gte.py +++ b/samples/python/apidocs/ee_array_gte.py @@ -14,11 +14,11 @@ # [START earthengine__apidocs__ee_array_gte] empty = ee.Array([], ee.PixelType.int8()) -print(empty.gte(empty).getInfo()) # [] +display(empty.gte(empty)) # [] -print(ee.Array([0]).gte([0]).getInfo()) # [1] -print(ee.Array([1]).gte([2]).getInfo()) # [0] -print(ee.Array([2]).gte([1]).getInfo()) # [1] +display(ee.Array([0]).gte([0])) # [1] +display(ee.Array([1]).gte([2])) # [0] +display(ee.Array([2]).gte([1])) # [1] -print(ee.Array([-1, 0, 1]).gte([-2, 1, 1]).getInfo()) # [1, 0, 1] +display(ee.Array([-1, 0, 1]).gte([-2, 1, 1])) # [1, 0, 1] # [END earthengine__apidocs__ee_array_gte] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_identity.py b/samples/python/apidocs/ee_array_identity.py index 6f2604f47..78d8743de 100644 --- a/samples/python/apidocs/ee_array_identity.py +++ b/samples/python/apidocs/ee_array_identity.py @@ -14,17 +14,17 @@ # [START earthengine__apidocs__ee_array_identity] # [] -print(ee.Array.identity(0).getInfo()) +display(ee.Array.identity(0)) # [[1]] -print(ee.Array.identity(1).getInfo()) +display(ee.Array.identity(1)) # [[1, 0], # [0, 1]] -print(ee.Array.identity(2).getInfo()) +display(ee.Array.identity(2)) # [[1, 0, 0], # [0, 1, 0], # [0, 0, 1]] -print(ee.Array.identity(3).getInfo()) +display(ee.Array.identity(3)) # [END earthengine__apidocs__ee_array_identity] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_log.py b/samples/python/apidocs/ee_array_log.py index e720adfd3..a9e81ba01 100644 --- a/samples/python/apidocs/ee_array_log.py +++ b/samples/python/apidocs/ee_array_log.py @@ -17,7 +17,7 @@ import altair as alt import pandas as pd -print(ee.Array([pow(math.e, -1), 1, math.e]).log().getInfo()) # [-1,0,1] +display(ee.Array([pow(math.e, -1), 1, math.e]).log()) # [-1,0,1] start = 0.1 end = 6 diff --git a/samples/python/apidocs/ee_array_log10.py b/samples/python/apidocs/ee_array_log10.py index ec37f21d1..01a9e3424 100644 --- a/samples/python/apidocs/ee_array_log10.py +++ b/samples/python/apidocs/ee_array_log10.py @@ -16,7 +16,7 @@ import altair as alt import pandas as pd -print(ee.Array([0.1, 1, 10, 100]).log10().getInfo()) # [-1,0,1,2] +display(ee.Array([0.1, 1, 10, 100]).log10()) # [-1,0,1,2] start = 0.1 end = 100 diff --git a/samples/python/apidocs/ee_array_lt.py b/samples/python/apidocs/ee_array_lt.py index a50d5a6a4..f1d7a9667 100644 --- a/samples/python/apidocs/ee_array_lt.py +++ b/samples/python/apidocs/ee_array_lt.py @@ -14,11 +14,11 @@ # [START earthengine__apidocs__ee_array_lt] empty = ee.Array([], ee.PixelType.int8()) -print(empty.lt(empty).getInfo()) # [] +display(empty.lt(empty)) # [] -print(ee.Array([0]).lt([0]).getInfo()) # [0] -print(ee.Array([1]).lt([2]).getInfo()) # [1] -print(ee.Array([2]).lt([1]).getInfo()) # [0] +display(ee.Array([0]).lt([0])) # [0] +display(ee.Array([1]).lt([2])) # [1] +display(ee.Array([2]).lt([1])) # [0] -print(ee.Array([-1, 0, 1]).lt([-2, 1, 0]).getInfo()) # [0, 1, 0] +display(ee.Array([-1, 0, 1]).lt([-2, 1, 0])) # [0, 1, 0] # [END earthengine__apidocs__ee_array_lt] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_lte.py b/samples/python/apidocs/ee_array_lte.py index f0db9e822..b0478a044 100644 --- a/samples/python/apidocs/ee_array_lte.py +++ b/samples/python/apidocs/ee_array_lte.py @@ -14,11 +14,11 @@ # [START earthengine__apidocs__ee_array_lte] empty = ee.Array([], ee.PixelType.int8()) -print(empty.lte(empty).getInfo()) # [] +display(empty.lte(empty)) # [] -print(ee.Array([0]).lte([0]).getInfo()) # [1] -print(ee.Array([1]).lte([2]).getInfo()) # [1] -print(ee.Array([2]).lte([1]).getInfo()) # [0] +display(ee.Array([0]).lte([0])) # [1] +display(ee.Array([1]).lte([2])) # [1] +display(ee.Array([2]).lte([1])) # [0] -print(ee.Array([-1, 0, 1]).lte([-2, 1, 1]).getInfo()) # [0, 1, 1] +display(ee.Array([-1, 0, 1]).lte([-2, 1, 1])) # [0, 1, 1] # [END earthengine__apidocs__ee_array_lte] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_mask.py b/samples/python/apidocs/ee_array_mask.py index 44acd3973..611a66367 100644 --- a/samples/python/apidocs/ee_array_mask.py +++ b/samples/python/apidocs/ee_array_mask.py @@ -13,18 +13,18 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_mask] -print(ee.Array([1]).mask([0]).getInfo()) # [] -print(ee.Array([1]).mask([1]).getInfo()) # [1] +display(ee.Array([1]).mask([0])) # [] +display(ee.Array([1]).mask([1])) # [1] -print(ee.Array([0, 1, 2, 3]).mask([0, 4, -1, 1.2]).getInfo()) # [1, 2, 3] +display(ee.Array([0, 1, 2, 3]).mask([0, 4, -1, 1.2])) # [1, 2, 3] -print(ee.Array([[1, 2, 3, 4]]).mask([[0, 0, 0, 0]]).getInfo()) # [[]] -print(ee.Array([[1, 2, 3, 4]]).mask([[1, 0, 1, 1]]).getInfo()) # [[1, 3, 4]] +display(ee.Array([[1, 2, 3, 4]]).mask([[0, 0, 0, 0]])) # [[]] +display(ee.Array([[1, 2, 3, 4]]).mask([[1, 0, 1, 1]])) # [[1, 3, 4]] array = ee.Array([[1], [2], [3], [4]]) -print(array.mask([[0], [0], [0], [0]]).getInfo()) # [] -print(array.mask([[1], [0], [1], [1]]).getInfo()) # [[1], [3], [4]] +display(array.mask([[0], [0], [0], [0]])) # [] +display(array.mask([[1], [0], [1], [1]])) # [[1], [3], [4]] empty = ee.Array([], ee.PixelType.int8()) -print(empty.mask(empty).getInfo()) # [] +display(empty.mask(empty)) # [] # [END earthengine__apidocs__ee_array_mask] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_max.py b/samples/python/apidocs/ee_array_max.py index 2711bef6c..d62a57d6f 100644 --- a/samples/python/apidocs/ee_array_max.py +++ b/samples/python/apidocs/ee_array_max.py @@ -14,9 +14,9 @@ # [START earthengine__apidocs__ee_array_max] empty = ee.Array([], ee.PixelType.int8()) -print(empty.max(empty).getInfo()) # [] +display(empty.max(empty)) # [] array1 = ee.Array([0, -3, 5, 3]) array2 = ee.Array([0, -1, 2, 4]) -print(array1.max(array2).getInfo()) # [0, -1, 5, 4] +display(array1.max(array2)) # [0, -1, 5, 4] # [END earthengine__apidocs__ee_array_max] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_min.py b/samples/python/apidocs/ee_array_min.py index 66712fc0c..9e33bb033 100644 --- a/samples/python/apidocs/ee_array_min.py +++ b/samples/python/apidocs/ee_array_min.py @@ -14,8 +14,8 @@ # [START earthengine__apidocs__ee_array_min] empty = ee.Array([], ee.PixelType.int8()) -print(empty.min(empty).getInfo()) # [] +display(empty.min(empty)) # [] # [-1, 1, 0, 2] -print(ee.Array([0, 1, 2, 3]).min(ee.Array([-1, 3, 0, 2])).getInfo()) +display(ee.Array([0, 1, 2, 3]).min(ee.Array([-1, 3, 0, 2]))) # [END earthengine__apidocs__ee_array_min] diff --git a/samples/python/apidocs/ee_array_mod.py b/samples/python/apidocs/ee_array_mod.py index ed3882ed8..5224a349b 100644 --- a/samples/python/apidocs/ee_array_mod.py +++ b/samples/python/apidocs/ee_array_mod.py @@ -17,26 +17,26 @@ import pandas as pd empty = ee.Array([], ee.PixelType.int8()) -print(empty.mod(empty).getInfo()) # [] +display(empty.mod(empty)) # [] -print(ee.Array([0, 0]).mod(ee.Array([-1, 2])).getInfo()) # [0,0] +display(ee.Array([0, 0]).mod(ee.Array([-1, 2]))) # [0,0] # [0,0,0,0,0] -print(ee.Array([0, 1, 2, 3, 4]).mod(ee.Array([1, 1, 1, 1, 1])).getInfo()) +display(ee.Array([0, 1, 2, 3, 4]).mod(ee.Array([1, 1, 1, 1, 1]))) # [0,1,0,1,0] -print(ee.Array([0, 1, 2, 3, 4]).mod(ee.Array([2, 2, 2, 2, 2])).getInfo()) +display(ee.Array([0, 1, 2, 3, 4]).mod(ee.Array([2, 2, 2, 2, 2]))) # [0,1,7,0,1] -print(ee.Array([0, 1, 7, 8, 9]).mod(ee.Array([8, 8, 8, 8, 8])).getInfo()) +display(ee.Array([0, 1, 7, 8, 9]).mod(ee.Array([8, 8, 8, 8, 8]))) # [-1,-7,0,-1] -print(ee.Array([-1, -7, -8, -9]).mod(ee.Array([8, 8, 8, 8])).getInfo()) +display(ee.Array([-1, -7, -8, -9]).mod(ee.Array([8, 8, 8, 8]))) # [0,1,0,8] -print(ee.Array([8, 8, 8, 8]).mod(ee.Array([-1, -7, -8, -9])).getInfo()) +display(ee.Array([8, 8, 8, 8]).mod(ee.Array([-1, -7, -8, -9]))) -print(ee.Array([2.5]).mod(ee.Array([1.2])).getInfo()) # [0.10000000000000009] +display(ee.Array([2.5]).mod(ee.Array([1.2]))) # [0.10000000000000009] # Generate a square wave graph using mod. start = -10 diff --git a/samples/python/apidocs/ee_array_multiply.py b/samples/python/apidocs/ee_array_multiply.py index 1fa351cbe..839408799 100644 --- a/samples/python/apidocs/ee_array_multiply.py +++ b/samples/python/apidocs/ee_array_multiply.py @@ -13,18 +13,18 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_multiply] -print(ee.Array([1]).multiply(0).getInfo()) # [0] -print(ee.Array([1]).multiply(1).getInfo()) # [1] +display(ee.Array([1]).multiply(0)) # [0] +display(ee.Array([1]).multiply(1)) # [1] -print(ee.Array([1]).multiply([0]).getInfo()) # [0] -print(ee.Array([1]).multiply([1]).getInfo()) # [1] +display(ee.Array([1]).multiply([0])) # [0] +display(ee.Array([1]).multiply([1])) # [1] # [-1, 8, -2, 4.8] -print(ee.Array([1, -2, 2, 4]).multiply([-1, -4, -1, 1.2]).getInfo()) +display(ee.Array([1, -2, 2, 4]).multiply([-1, -4, -1, 1.2])) # [-1, 2, -2, -3] -print(ee.Array([1, -2, 2, 3]).multiply(-1).getInfo()) +display(ee.Array([1, -2, 2, 3]).multiply(-1)) empty = ee.Array([], ee.PixelType.int8()) -print(empty.multiply(empty).getInfo()) # [] +display(empty.multiply(empty)) # [] # [END earthengine__apidocs__ee_array_multiply] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_neq.py b/samples/python/apidocs/ee_array_neq.py index 9b16f912b..808e80177 100644 --- a/samples/python/apidocs/ee_array_neq.py +++ b/samples/python/apidocs/ee_array_neq.py @@ -14,15 +14,15 @@ # [START earthengine__apidocs__ee_array_neq] empty = ee.Array([], ee.PixelType.int8()) -print(empty.neq(empty).getInfo()) # [] +display(empty.neq(empty)) # [] -print(ee.Array([0]).neq(ee.Array([1])).getInfo()); # 1 -print(ee.Array([1]).neq(ee.Array([1])).getInfo()); # 0 +display(ee.Array([0]).neq(ee.Array([1]))); # 1 +display(ee.Array([1]).neq(ee.Array([1]))); # 0 -print(ee.Array([1.1]).neq(ee.Array([1.1])).getInfo()) # 0 -print(ee.Array([1.1]).float().neq(ee.Array([1.1])).getInfo()) # 1 -print(ee.Array([1.1]).double().neq(ee.Array([1.1])).getInfo()) # 0 +display(ee.Array([1.1]).neq(ee.Array([1.1]))) # 0 +display(ee.Array([1.1]).float().neq(ee.Array([1.1]))) # 1 +display(ee.Array([1.1]).double().neq(ee.Array([1.1]))) # 0 -print(ee.Array([1]).int8().neq(ee.Array([1])).getInfo()) # 0 -print(ee.Array([1]).int8().neq(ee.Array([1]).int32()).getInfo()) # 0 +display(ee.Array([1]).int8().neq(ee.Array([1]))) # 0 +display(ee.Array([1]).int8().neq(ee.Array([1]).int32())) # 0 # [END earthengine__apidocs__ee_array_neq] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_not.py b/samples/python/apidocs/ee_array_not.py index 716c5e3e8..0fbafaf06 100644 --- a/samples/python/apidocs/ee_array_not.py +++ b/samples/python/apidocs/ee_array_not.py @@ -14,10 +14,10 @@ # [START earthengine__apidocs__ee_array_not] empty = ee.Array([], ee.PixelType.int8()) -print(empty.Not().getInfo()) # [] +display(empty.Not()) # [] -print(ee.Array([0]).Not().getInfo()) # [1] -print(ee.Array([1]).Not().getInfo()) # [0] +display(ee.Array([0]).Not()) # [1] +display(ee.Array([1]).Not()) # [0] -print(ee.Array([-1, -0.1, 0, 0.1, 1]).Not().getInfo()) # [0, 0, 1, 0, 0] +display(ee.Array([-1, -0.1, 0, 0.1, 1]).Not()) # [0, 0, 1, 0, 0] # [END earthengine__apidocs__ee_array_not] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_or.py b/samples/python/apidocs/ee_array_or.py index c986e600b..a18b7d66e 100644 --- a/samples/python/apidocs/ee_array_or.py +++ b/samples/python/apidocs/ee_array_or.py @@ -14,8 +14,8 @@ # [START earthengine__apidocs__ee_array_or] empty = ee.Array([], ee.PixelType.int8()) -print(empty.Or(empty).getInfo()) # [] +display(empty.Or(empty)) # [] # [0, 1, 1, 1] -print(ee.Array([0, 0, 1, 1]).Or(ee.Array([0, 1, 0, 1])).getInfo()) +display(ee.Array([0, 0, 1, 1]).Or(ee.Array([0, 1, 0, 1]))) # [END earthengine__apidocs__ee_array_or] diff --git a/samples/python/apidocs/ee_array_pow.py b/samples/python/apidocs/ee_array_pow.py index ad7dd020c..540c0624f 100644 --- a/samples/python/apidocs/ee_array_pow.py +++ b/samples/python/apidocs/ee_array_pow.py @@ -14,25 +14,25 @@ # [START earthengine__apidocs__ee_array_pow] empty = ee.Array([], ee.PixelType.int8()) -print(empty.pow(empty).getInfo()) # [] +display(empty.pow(empty)) # [] # [0.25, -0.5, 1, -2, 4, -8] -print(ee.Array([-2, -2, -2, -2, -2, -2]).pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([-2, -2, -2, -2, -2, -2]).pow([-2, -1, 0, 1, 2, 3])) # [1, -1, 1, -1, 1, -1] -print(ee.Array([-1, -1, -1, -1, -1, -1]).pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([-1, -1, -1, -1, -1, -1]).pow([-2, -1, 0, 1, 2, 3])) # ['Infinity', 'Infinity', 1, 0, 0, 0] -print(ee.Array([0, 0, 0, 0, 0, 0]).pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([0, 0, 0, 0, 0, 0]).pow([-2, -1, 0, 1, 2, 3])) # [1, 0, 0, 0] -print(ee.Array([0, 0, 0, 0]).pow([0, 1, 2, 3]).getInfo()) +display(ee.Array([0, 0, 0, 0]).pow([0, 1, 2, 3])) # [1, 1, 1, 1, 1, 1] -print(ee.Array([1, 1, 1, 1, 1, 1]).pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([1, 1, 1, 1, 1, 1]).pow([-2, -1, 0, 1, 2, 3])) # [0.25, 0.5, 1, 2, 4, 8] -print(ee.Array([2, 2, 2, 2, 2, 2]).pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([2, 2, 2, 2, 2, 2]).pow([-2, -1, 0, 1, 2, 3])) # [0.009999999776482582, # 0.10000000149011612, @@ -40,7 +40,7 @@ # 10, # 100, # 1000] -print(ee.Array([10, 10, 10, 10, 10, 10]).pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([10, 10, 10, 10, 10, 10]).pow([-2, -1, 0, 1, 2, 3])) # [0.009999999776482582, # 0.10000000149011612, @@ -48,6 +48,6 @@ # 10, # 100, # 1000] -print(ee.Array([10, 10, 10, 10, 10, 10], ee.PixelType.int32()) - .pow([-2, -1, 0, 1, 2, 3]).getInfo()) +display(ee.Array([10, 10, 10, 10, 10, 10], ee.PixelType.int32()) + .pow([-2, -1, 0, 1, 2, 3])) # [END earthengine__apidocs__ee_array_pow] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_sin.py b/samples/python/apidocs/ee_array_sin.py index 4e7725170..955b1cc07 100644 --- a/samples/python/apidocs/ee_array_sin.py +++ b/samples/python/apidocs/ee_array_sin.py @@ -19,11 +19,11 @@ π = math.pi -print(ee.Array([-π]).sin().getInfo()) # [Almost zero] -print(ee.Array([-π / 2.0]).sin().getInfo()) # [-1] -print(ee.Array([0]).sin().getInfo()) # [0] -print(ee.Array([π / 2.0]).sin().getInfo()) # [1] -print(ee.Array([π]).sin().getInfo()) # [Almost zero] +display(ee.Array([-π]).sin()) # [Almost zero] +display(ee.Array([-π / 2.0]).sin()) # [-1] +display(ee.Array([0]).sin()) # [0] +display(ee.Array([π / 2.0]).sin()) # [1] +display(ee.Array([π]).sin()) # [Almost zero] start = -π end = π diff --git a/samples/python/apidocs/ee_array_sinh.py b/samples/python/apidocs/ee_array_sinh.py index 9ad120b48..a16701f2c 100644 --- a/samples/python/apidocs/ee_array_sinh.py +++ b/samples/python/apidocs/ee_array_sinh.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([-5]).sinh().getInfo()) # [~ -74.20] -print(ee.Array([0]).sinh().getInfo()) # [0] -print(ee.Array([5]).sinh().getInfo()) # [~ 74.20] +display(ee.Array([-5]).sinh()) # [~ -74.20] +display(ee.Array([0]).sinh()) # [0] +display(ee.Array([5]).sinh()) # [~ 74.20] start = -5 end = 5 diff --git a/samples/python/apidocs/ee_array_slice.py b/samples/python/apidocs/ee_array_slice.py index 24ee18abe..06c5ead51 100644 --- a/samples/python/apidocs/ee_array_slice.py +++ b/samples/python/apidocs/ee_array_slice.py @@ -14,45 +14,45 @@ # [START earthengine__apidocs__ee_array_slice] array1x6 = ee.Array([1, 2, 3, 4, 5, 6]) -print(array1x6.slice().getInfo()) # [1, 2, 3, 4, 5, 6] -print(array1x6.slice(0).getInfo()) # [1, 2, 3, 4, 5, 6] -print(array1x6.slice(0, 0, 6, 1).getInfo()) # [1, 2, 3, 4, 5, 6] -print(array1x6.slice(0, 0, 10, 1).getInfo()) # [1, 2, 3, 4, 5, 6] +display(array1x6.slice()) # [1, 2, 3, 4, 5, 6] +display(array1x6.slice(0)) # [1, 2, 3, 4, 5, 6] +display(array1x6.slice(0, 0, 6, 1)) # [1, 2, 3, 4, 5, 6] +display(array1x6.slice(0, 0, 10, 1)) # [1, 2, 3, 4, 5, 6] -print(array1x6.slice(0, 2).getInfo()) # [3, 4, 5, 6] -print(array1x6.slice(0, 5).getInfo()) # [6] -print(array1x6.slice(0, 6).getInfo()) # [] -print(array1x6.slice(0, 0, 2).getInfo()) # [1, 2] -print(array1x6.slice(0, 0, 0).getInfo()) # [] +display(array1x6.slice(0, 2)) # [3, 4, 5, 6] +display(array1x6.slice(0, 5)) # [6] +display(array1x6.slice(0, 6)) # [] +display(array1x6.slice(0, 0, 2)) # [1, 2] +display(array1x6.slice(0, 0, 0)) # [] # Negative start and end. -print(array1x6.slice(0, 0, -3).getInfo()) # [1, 2, 3] -print(array1x6.slice(0, -2, 6).getInfo()) # [5, 6] +display(array1x6.slice(0, 0, -3)) # [1, 2, 3] +display(array1x6.slice(0, -2, 6)) # [5, 6] -print(array1x6.slice(0, 0, 6, 2).getInfo()) # [1, 3, 5] -print(array1x6.slice(0, 0, 6, 3).getInfo()) # [1, 4] -print(array1x6.slice(0, 0, 6, 4).getInfo()) # [1, 5] -print(array1x6.slice(0, 0, 6, 6).getInfo()) # [1] +display(array1x6.slice(0, 0, 6, 2)) # [1, 3, 5] +display(array1x6.slice(0, 0, 6, 3)) # [1, 4] +display(array1x6.slice(0, 0, 6, 4)) # [1, 5] +display(array1x6.slice(0, 0, 6, 6)) # [1] -print(array1x6.slice(0, 2, 6, 2).getInfo()) # [3, 5] +display(array1x6.slice(0, 2, 6, 2)) # [3, 5] array3x2 = ee.Array([[1, 2], [3, 4], [5, 6]]) -print(array3x2.slice().getInfo()) # [[1, 2], [3, 4], [5, 6]] -print(array3x2.slice(0).getInfo()) # [[1, 2], [3, 4], [5, 6]] -print(array3x2.slice(0, 0).getInfo()) # [[1, 2],[3, 4],[5, 6]] -print(array3x2.slice(0, 0, 1).getInfo()) # [[1, 2]] -print(array3x2.slice(0, 0, 2).getInfo()) # [[1, 2], [3, 4]] -print(array3x2.slice(0, 0, 3, 1).getInfo()) # [[1, 2], [3, 4], [5, 6]] -print(array3x2.slice(0, 0, 3, 2).getInfo()) # [[1, 2], [5, 6]] -print(array3x2.slice(0, 1, 3, 2).getInfo()) # [[3, 4]] -print(array3x2.slice(0, 0, 3, 3).getInfo()) # [[1, 2]] - -print(array3x2.slice(1).getInfo()) # [[1, 2], [3, 4], [5, 6]] -print(array3x2.slice(1, 1).getInfo()) # [[2], [4], [6]] -print(array3x2.slice(1, 0, 1).getInfo()) # [[1], [3], [5]] +display(array3x2.slice()) # [[1, 2], [3, 4], [5, 6]] +display(array3x2.slice(0)) # [[1, 2], [3, 4], [5, 6]] +display(array3x2.slice(0, 0)) # [[1, 2],[3, 4],[5, 6]] +display(array3x2.slice(0, 0, 1)) # [[1, 2]] +display(array3x2.slice(0, 0, 2)) # [[1, 2], [3, 4]] +display(array3x2.slice(0, 0, 3, 1)) # [[1, 2], [3, 4], [5, 6]] +display(array3x2.slice(0, 0, 3, 2)) # [[1, 2], [5, 6]] +display(array3x2.slice(0, 1, 3, 2)) # [[3, 4]] +display(array3x2.slice(0, 0, 3, 3)) # [[1, 2]] + +display(array3x2.slice(1)) # [[1, 2], [3, 4], [5, 6]] +display(array3x2.slice(1, 1)) # [[2], [4], [6]] +display(array3x2.slice(1, 0, 1)) # [[1], [3], [5]] empty = ee.Array([], ee.PixelType.int8()) -print(empty.slice().getInfo()) # [] -print(empty.slice(0).getInfo()) # [] -print(empty.slice(0, 0, 0, 1).getInfo()) # [] +display(empty.slice()) # [] +display(empty.slice(0)) # [] +display(empty.slice(0, 0, 0, 1)) # [] # [END earthengine__apidocs__ee_array_slice] \ No newline at end of file diff --git a/samples/python/apidocs/ee_array_subtract.py b/samples/python/apidocs/ee_array_subtract.py index ad8d1b9b9..e06d556f5 100644 --- a/samples/python/apidocs/ee_array_subtract.py +++ b/samples/python/apidocs/ee_array_subtract.py @@ -13,11 +13,11 @@ # limitations under the License. # [START earthengine__apidocs__ee_array_subtract] -print(ee.Array([10]).subtract(1).getInfo()) # [9] +display(ee.Array([10]).subtract(1)) # [9] -print(ee.Array([-1, 0, 1]).subtract(2).getInfo()) # [-3, -2, -1] -print(ee.Array([-1, 0, 1]).subtract([-5, 6, 7]).getInfo()) # [4, -6, -6] +display(ee.Array([-1, 0, 1]).subtract(2)) # [-3, -2, -1] +display(ee.Array([-1, 0, 1]).subtract([-5, 6, 7])) # [4, -6, -6] empty = ee.Array([], ee.PixelType.int8()) -print(empty.subtract(empty).getInfo()) # [] +display(empty.subtract(empty)) # [] # [END earthengine__apidocs__ee_array_subtract] diff --git a/samples/python/apidocs/ee_array_tan.py b/samples/python/apidocs/ee_array_tan.py index e34ad624a..70ce09e19 100644 --- a/samples/python/apidocs/ee_array_tan.py +++ b/samples/python/apidocs/ee_array_tan.py @@ -18,9 +18,9 @@ import pandas as pd π = math.pi -print(ee.Array([-π / 4]).tan().getInfo()) # [Almost -1] -print(ee.Array([0]).tan().getInfo()) # [0] -print(ee.Array([π / 4]).tan().getInfo()) # [Almost 1] +display(ee.Array([-π / 4]).tan()) # [Almost -1] +display(ee.Array([0]).tan()) # [0] +display(ee.Array([π / 4]).tan()) # [Almost 1] start = -π / 3 end = π / 3 diff --git a/samples/python/apidocs/ee_array_tanh.py b/samples/python/apidocs/ee_array_tanh.py index 0b1d897d8..446b41a1d 100644 --- a/samples/python/apidocs/ee_array_tanh.py +++ b/samples/python/apidocs/ee_array_tanh.py @@ -16,9 +16,9 @@ import altair as alt import pandas as pd -print(ee.Array([-5]).tanh().getInfo()) # [~ -1] -print(ee.Array([0]).tanh().getInfo()) # [0] -print(ee.Array([5]).tanh().getInfo()) # [~ 1] +display(ee.Array([-5]).tanh()) # [~ -1] +display(ee.Array([0]).tanh()) # [0] +display(ee.Array([5]).tanh()) # [~ 1] start = -5 end = 5