Search for question
Question

Leaflet | © OpenStreetMap contributors = Part 3: Estimate the boundaries for Kansas (use just four lat-lon points) and Nebraska (use just six points). Construct a GeoJSON file from that. Then write a Python program to read that file, form a dictionary, and plot the result. Part 4: Generate at random the "happiness index" for each state in the United States. Provide a choropleth of the United States with that data represented thereon. Part 5: Generate 500 points from the random exponential distribution. Choose your own parameters for that. Use Plotly to plot a histogram of that distribution such that there are at least 15 bins with counts greater than zero./n[431 Part 2: Estimate the latitude and longitude for three points of a triangle that would just cover Africa or come close. (Hint: Rabat, Cape Town, and Mogadishu, for example.) Use folium to demonstrate where the points are on the map so that a person could see at a glance that they do nearly cover Africa. Use Shapely to define a polygon from those three points. Compute the area and perimeter of the triangle assuming flat earth and allowing each degree of latitude and each degree of longitude to be considered one unit of length. m folium.Map(location=(8.7832,34.5085), zoom_start=6) coordinates = [(-6.826478427367874, 34.02729604892884), (18.41817772724579, -33.9278597103012), (45.34187526085094, 2.0358548329554367)] folium. Polyline (locations-coordinates).add_to(m) m.save("Africa_map.html") Python/nPart 1: Using the file capitals_lat_lon.csv, form a DataFrame, and write out an HTML file that when rendered in a browser displays a marker for each capital city. Hint: Use folium. ] import pandas as pd wwwww import numpy as np import geopandas as gpd from matplotlib import pyplot as plt import folium from shapely.geometry import Polygon ] = data pd.read_csv('capitals_lat_lon.csv') ] data.head Python Python Python 0 1 2 3 <bound method NDFrame.head of Abkhazia Afghanistan Country Capital Latitude Longitude Sukhumi 43.001525 41.023415 Aland Islands Kabul Mariehamn 34.575503 60.100000 69.240073 19.933333 Albania Tirana 41.327546 19.818698

Fig: 1

Fig: 2

Fig: 3