Logo Pastebin.fr
Pastebin

Retrouvez, créez et partagez vos snippets en temps réel.

yassine

import csv
import folium





import csv
with open('lycee.csv','r', encoding='utf-8') as f:
    premiere_ligne = f.readline()
    print("Les descripteurs de la collection des établissements scolaires :")
    print(premiere_ligne)   
    dialecte_fichier_csv = csv.Sniffer().sniff(premiere_ligne)
    data_lignes = list(csv.reader(f, dialect=dialecte_fichier_csv))
    
ville = input("Entre ta ville")
for city in data_lignes:
        if city[10]== ville:
            lon=city[15]
            lat=city[14]
            break
#création de la carte centrée au point indiqué
ma_carte1=folium.Map(location=[lat,lon],zoom_start=zoom)
for city in data_lignes:
        if city[10]== ville:
            print(city[1],city[14],city[15])
            lon=city[15]
            lat=city[14]
            nom = city[1]
            folium.Marker([lat,lon],popup=nom).add_to(ma_carte1)
zoom='10'


# ligne pour afficher un marqueur à l'endroit indiqué (on peut en ajouter plusieurs)

#ligne pour faire afficher la carte dans ce notebook
ma_carte1

Créé il y a 4 jours.

Rechercher un Pastebin

Aucun paste trouvé.