BaşlayınÜcretsiz Başlayın

Tracking crime statistics

Sergeant Laura wants to do some background research to help her better understand the cultural context for Bayes' kidnapping. She has plotted Burglary rates in three U.S. cities using data from the Uniform Crime Reporting Statistics.

She wants to present this data to her officers, and she wants the image to be as beautiful as possible to effectively tell her data story.

Recall:

  • You can change linestyle to dotted (':'), dashed('--'), or no line ('').
  • You can change the marker to circle ('o'), diamond('d'), or square ('s').

Bu egzersiz

Introduction to Data Science in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Change the color of Phoenix to "DarkCyan".
  • Make the Los Angeles line dotted.
  • Add square markers to Philadelphia.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Change the color of Phoenix to `"DarkCyan"`
plt.plot(data["Year"], data["Phoenix Police Dept"], label="Phoenix", ____)

# Make the Los Angeles line dotted
plt.plot(data["Year"], data["Los Angeles Police Dept"], label="Los Angeles", ____)

# Add square markers to Philedelphia
plt.plot(data["Year"], data["Philadelphia Police Dept"], label="Philadelphia", ____)

# Add a legend
plt.legend()

# Display the plot
plt.show()
Kodu Düzenle ve Çalıştır