0

Attempting to create a map that has light pollution data.

from scipy.ndimage import imread 

Getting an error from "import scipy import imread"

Error says : Import "scipy" could not be resolvedPylance (reportMissingImports)

import folium
from folium import plugins
from scipy.ndimage import imread 


# boundary of the image on the map
min_lon = -123.5617
max_lon = -121.0617
min_lat = 37.382166
max_lat = 39.048834

# create the map
map_ = folium.Map(location=[38.2, -122],
                  tiles='Stamen Terrain', zoom_start = 8)

# read in png file to numpy array
data = imread('./ii_overlay.png')

# Overlay the image
map_.add_children(plugins.ImageOverlay(data, opacity=0.8, \
        bounds =[[min_lat, min_lon], [max_lat, max_lon]]))
map_

Full code for those interested ^

kaptnpy
  • 13
  • 4
  • This might help: https://stackoverflow.com/questions/72322120/vscode-import-x-could-not-be-resolved-even-though-listed-under-helpmodules – moist_wrist3 Jun 09 '22 at 23:10

1 Answers1

0

Have you installed scipy on your python installation? if not then install it using pip by using python3 -m pip install scipy for linux / mac or py -3 -m pip install scipy for windows

if you have it installed but it still does not work then try and compare the version of python you installed the module to and the version vscode is looking at, you can check which version you installed to by typing pip -VV in the terminal and for vs code the version its using shows up at the bottom left just make sure those are same (you can change in vs code by clicking version on bottom left or typing Python: Select Interpreter in the command pallet