i am trying to handle data in python using pandas , I have this data
import folium
import pandas
mapp = folium.Map(location=[19.997454,73.789803], zoom_start=6, tiles="Stamen Terrain" )
fg = folium.FeatureGroup(name="my map")
df=pandas.read_csv("volcanoes.txt")
cordinates="[" + df["LAT"].astype(str) + "," + df["LON"].astype(str) +"]"
for i in cordinates:
fg.add_child(folium.Marker(location=i,popup="hey jayesh , welcome to Nashik",icon=folium.Icon(color="green")))
mapp.add_child(fg)
mapp.save("jay1.html")
> Windows PowerShell Copyright (C) Microsoft Corporation. All rights
> reserved.
>
> Try the new cross-platform PowerShell https://aka.ms/pscore6
>
> PS C:\Users\DELL\OneDrive\Desktop\python\volcano> &
> C:/Users/DELL/AppData/Local/Programs/Python/Python39/python.exe
> c:/Users/DELL/OneDrive/Desktop/python/volcano/jayesh.py Traceback
> (most recent call last): File
> "c:\Users\DELL\OneDrive\Desktop\python\volcano\jayesh.py", line 10, in
> <module>
> fg.add_child(folium.Marker(location=i,popup="hey jayesh , welcome to Nashik",icon=folium.Icon(color="green"))) File
> "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\folium\map.py",
> line 277, in __init__
> self.location = validate_location(location) if location else None File
> "C:\Users\DELL\AppData\Local\Programs\Python\Python39\lib\site-packages\folium\utilities.py",
> line 50, in validate_location
> raise ValueError('Expected two (lat, lon) values for location, ' ValueError: Expected two (lat, lon) values for location, instead got:
> '[48.7767982,-121.810997]'. PS
> C:\Users\DELL\OneDrive\Desktop\python\volcano>