Troubleshooting data issues
You will be building popups for the downtown art using the title and desc columns from the urban_art DataFrame. Here, you will inspect those columns to identify and clean up any problematic values.
Latihan ini adalah bagian dari kursus
Visualizing Geospatial Data in Python
Petunjuk latihan
- Print and inspect the values in the
titlecolumn of theurban_artDataFrame. - Print and inspect the values in the
desccolumn of theurban_artDataFrame. - Use the
fillna()method to replace theNaNvalues in thedesccolumn with empty strings, and use.str.replaceto replace the apostrophes (') with back-ticks (`). - Print the descriptions again to verify your work.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Print the urban_art titles
print(urban_art.____)
#Print the urban_art descriptions
print(urban_art.____)
# Replace Nan and ' values in description
urban_art.desc.____('', inplace = True)
urban_art.desc = urban_art.desc.____.____("'", "`")
#Print the urban_art descriptions again
print(urban_art.desc)