Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Visualizing Geospatial Data in Python

Cursus bekijken

Oefeninstructies

  • Print and inspect the values in the title column of the urban_art DataFrame.
  • Print and inspect the values in the desc column of the urban_art DataFrame.
  • Use the fillna() method to replace the NaN values in the desc column with empty strings, and use .str.replace to replace the apostrophes (') with back-ticks (`).
  • Print the descriptions again to verify your work.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# 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)
Code bewerken en uitvoeren