Python folium heatmap representation on sample data and original data

Viewed 26

Whenever I put in the code the map goes blank and does not show anything:

lat_long = zip(list(file.Start_Lng), list(file.Start_Lat)) 
map1 = folium.Map() HeatMap(lat_long).add_to(map1) 
map1

On the other hand when I change the code as below the map start to display the data:

sample_file = file.sample(int(0.1 * len(file)))
lat_lon_pairs = zip(list(sample_file.Start_Lat), list(sample_file.Start_Lng))
map1 = folium.Map() HeatMap(lat_lon_pairs).add_to(map1)
map1

Can someone tell me why? P.S: Also if anyone is curious then this is the dataset I am working on:

https://www.kaggle.com/datasets/sobhanmoosavi/us-accidents

0 Answers
Related