# python import json # test pour ouvrir du shapefile import shapefile r = shapefile.Reader("C:/Users/DEBROCKC/Documents/CAMIDEBR/W/PERSO/NUTS/produits_nutsmap.shp") mes_pays=json.load("C:/Users/DEBROCKC/Documents/CAMIDEBR/W/PERSO/NUTS/test_produits.geojson") mes_pays = [ {"Pays_appro":"Italie", "points":[1,2,3,4,3,2,1,4,3,2,4,1]}, {"Pays_appro":"Chine", "points":[2,4,4,1,1,1,1,4,2,3]}, {"Pays_appro":"Allemagne", "points":[1,1,2]}, ] def count_values(les_pays): for pays in les_pays: pays_name = pays["Pays_appro"] points_du_pays = pays["points"] dict_points = {} for point in points_du_pays: if point not in dict_points: dict_points[point] = 0 dict_points[point] += 1 print(pays_name, dict_points) count_values(mes_pays)