The problem is quite trivial,
- You’re using a
Pandas.DataFrame. Now when you slice itrep_points['lat'], you get aPandas.Series. - The
gmplot.scatter()is expecting aniterableoffloatsnot aseriesoffloats. - Now if you convert your
Pandas.Seriesto alistby usingrep_points['lat'].tolist()It’ll start working
Below is your updated code:
rep_points = pd.read_csv(r'C:\Users\carrot\Desktop\ss.csv', dtype=float)
latitude_collection = rep_points['lat'].tolist()
longitude_collection = rep_points['long'].tolist()
gmap = gmplot.GoogleMapPlotter(latitude_collection[0], longitude_collection[0], 11)
gmap.plot(min(latitude_collection), min(longitude_collection).lng)
gmap.scatter(latitude_collection,longitude_collection,c='aquamarine')
gmap.circle(latitude_collection,longitude_collection, 100, color='yellow')
gmap.draw("user001_clus_time.html")
Other things that helped to point it out:
type(rep_points['lat'])is aPandas.Seriestype(rep_points['lat'][0])is aNumpy.Float- to iterate over a
Pandas.Seriesyou need to useiteritems