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 aniterable
offloats
not aseries
offloats
. - Now if you convert your
Pandas.Series
to alist
by 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.Series
type(rep_points['lat'][0])
is aNumpy.Float
- to iterate over a
Pandas.Series
you need to useiteritems