Aan de slagGa gratis aan de slag

Charting cellphone data

We know that Freddy Frequentist is the one who kidnapped Bayes the Golden Retriever. Now we need to learn where he is hiding.

Our friends at the police station have acquired cell phone data, which gives some of Freddie's locations over the past three weeks. It's stored in the DataFrame cellphone. The x-coordinates are in the column 'x' and the y-coordinates are in the column 'y'.

The matplotlib module has been imported under the alias plt.

Deze oefening maakt deel uit van de cursus

Introduction to Data Science in Python

Cursus bekijken

Oefeninstructies

  • Display the first five rows of the DataFrame and determine which columns to plot.
  • Create a scatter plot of the data in cellphone.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Explore the data
print(cellphone.____)

# Create a scatter plot of the data from the DataFrame cellphone
plt.____(____, ____)

# Add labels
plt.ylabel('Latitude')
plt.xlabel('Longitude')

# Display the plot
plt.show()
Code bewerken en uitvoeren