शुरू करेंमुफ़्त में शुरू करें

GeoDataFrame बनाना और geometry को परखना

आइए देखें कि Nashville में service districts कहाँ हैं। Service district shapefile का path वैरिएबल shapefile_path में स्टोर है।

यह अभ्यास पाठ्यक्रम का हिस्सा है

Python में Geospatial Data का Visualization

पाठ्यक्रम देखें

अभ्यास निर्देश

  • geopandas को इसके सामान्य उपनाम gpd के साथ import करें।
  • geopandas का उपयोग करके service district shapefile पढ़ें और head() मेथड से शुरुआती 5 पंक्तियाँ देखें।
  • पहली पंक्ति (rowname '0') में geometry फ़ील्ड प्रिंट करें ताकि उस फ़ील्ड में मौजूद डेटा देख सकें। इसके लिए आप service_district.loc[0, 'geometry'] को print() फंक्शन में पास करेंगे।

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Import geopandas
import ____ as ____ 

# Read in the services district shapefile and look at the first few rows.
service_district = gpd.____(shapefile_path)
print(service_district.____())

# Print the contents of the service districts geometry in the first row
print(service_district.loc[0, '____'])
कोड संपादित करें और चलाएँ