<jupyter_start><jupyter_text>Uncomment the following line to install [geemap](https://geemap.org) if needed.<jupyter_code># !pip install geemap
import geemap
import ee

ee.Initialize()
import numpy as np

band1 = np.array([[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]])
band2 = np.array([[1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3, 3]])
band3 = np.array([[3, 3, 3, 3], [2, 2, 2, 2], [1, 1, 1, 1]])
data = np.dstack([band1, band2, band3])
# Test bad input
img = geemap.numpy_to_ee(1)
# Test with only one band:
img = geemap.numpy_to_ee(
    band1, crs='EPSG:4326', transform=[14.5, 0, -125, 0, -8, 49], band_names='a'
)
# Test with multiple bands:
img_multi = geemap.numpy_to_ee(
    data,
    crs='EPSG:4326',
    transform=[14.5, 0, -125, 0, -8, 49],
    band_names=['a', 'b', 'c'],
)
# Add images to a map
Map = geemap.Map()
Map.addLayer(img, {'min': 0, 'max': 11})
Map.addLayer(img_multi, {'min': 0, 'max': 11, 'bands': ['a', 'b', 'c']})
Map<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22153209109730848, 'fraction_numerical': 0.08488612836438923, 'mean_word_length': 4.342541436464089, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '207868', 'license': 'MIT', 'n_tokens_mistral': 491, 'n_tokens_neox': 440, 'n_words': 124, 'path': 'examples/notebooks/numpy_to_ee.ipynb', 'repo_name': 'hanzlan/geemap', 'size': '966'}