CommencezCommencez gratuitement

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.

Cette activité fait partie du cours

Introduction to Data Science in Python

Voir le cours

Instructions de l’exercice

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

Exercice interactif pratique

Essayez cet exercice en complétant ce code d’exemple.

# 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()
Modifier et exécuter le code