Urban Residents पड़ोस और आर्ट का प्लॉट बनाना
अब आप जानते हैं कि ज़्यादातर आर्ट Urban Residents पड़ोस में है। इस अभ्यास में, आप उसी पड़ोस की आर्ट का प्लॉट बनाएँगे। पहले आप neighborhood_art में से सिर्फ़ urban_art का subset लेंगे और neighborhoods में से urban_polygon का subset लेंगे। फिर आप पहले polygon का प्लॉट ax के रूप में बनाएँगे, और उसके बाद आर्ट का प्लॉट जोड़ेंगे।
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Geospatial Data का Visualization
अभ्यास निर्देश
.loc[]एक्सेसर का उपयोग करके"Urban Residents"पड़ोस की केवल आर्ट लेने के लिएurban_artनाम का एक GeoDataFrame बनाएँ।.loc[]का फिर से उपयोग करकेneighborhoodsसे केवल"Urban Residents"वाला polygon लेकरurban_polygonनाम का GeoDataFrame बनाएँ।urban_polygonकोaxके रूप में प्लॉट करें औरcolorकोlightgreenसेट करें।urban_artमें आर्ट को प्लॉट करें। तीन आर्ग्युमेंट पास करें: इस प्लॉट कोurban_polygonमें जोड़ने के लिएax = axसेट करें, पॉइंट्स को लेबल करने के लिएtypeउपयोग करें, औरlegend = Trueसेट करें।
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Create urban_art from neighborhood_art where the neighborhood name is Urban Residents
urban_art = neighborhood_art.loc[neighborhood_art.name == ____]
# Get just the Urban Residents neighborhood polygon and save it as urban_polygon
urban_polygon = neighborhoods.loc[____.____ == "Urban Residents"]
# Plot the urban_polygon as ax
ax = ____.____(color = 'lightgreen')
# Add a plot of the urban_art and show it
urban_art.plot( ax = ax, ____ = 'type', legend = True);
plt.show()