I get this error when executing my code do you have an idea how to fix it? here is the image and the code of the first lines of my csv file, the file is too big to display it entirely. the code is complete. i try to display the points on a map with geoplotlib
enter image description here
import geoplotlib
import csv
import pandas as pd
data = pd.read_csv('E:Projet de Memoir sur les tics/humdataAL.csv')
geoplotlib.dot(data)
geoplotlib.show()
It returns the following error:
Traceback (most recent call last):
File "C:Users
samaPycharmProjectspythonProjectamara_projectvenvlibsite-packagesgeoplotlib\__init__.py", line 32, in _runapp
app.start()
File "C:Users
samaPycharmProjectspythonProjectamara_projectvenvlibsite-packagesgeoplotlibcore.py", line 364, in start
self.proj.fit(BoundingBox.from_bboxes([l.bbox() for l in self.geoplotlib_config.layers]),
File "C:Users
samaPycharmProjectspythonProjectamara_projectvenvlibsite-packagesgeoplotlibcore.py", line 364, in <listcomp>
self.proj.fit(BoundingBox.from_bboxes([l.bbox() for l in self.geoplotlib_config.layers]),
File "C:Users
samaPycharmProjectspythonProjectamara_projectvenvlibsite-packagesgeoplotliblayers.py", line 159, in bbox
return BoundingBox.from_points(lons=self.data['lon'], lats=self.data['lat'])
File "C:Users
samaPycharmProjectspythonProjectamara_projectvenvlibsite-packagespandascoreframe.py", line 3024, in __getitem__
indexer = self.columns.get_loc(key)
File "C:Users
samaPycharmProjectspythonProjectamara_projectvenvlibsite-packagespandascoreindexesase.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 'lon'
question from:
https://stackoverflow.com/questions/65863922/raise-keyerrorkey-python 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…