Running different cell types
DataLab notebooks allow you to run various types of cells, each producing different outputs. In this exercise, you’ll execute Python and SQL cells to produce dataframes, visualizations, and text outputs.
Diese Übung ist Teil des Kurses
Introduction to DataLab
Anleitung zur Übung
Run the following cells:
- A Code cell that loads a dataset.
- A SQL cell that queries the dataset.
Now copy the below code to the empty Code cell and run that cell to create a visualization.
import matplotlib.pyplot as plt
ratings_count = sql_output['rating'].value_counts().sort_index()
plt.figure(figsize=(10, 6))
plt.bar(ratings_count.index, ratings_count.values)
plt.title("Number of movies by rating")
plt.xlabel("Movie Rating")
plt.ylabel("Number of movies")
plt.show()
Observe the different output formats produced. Continue when you've had a play.
Interaktive Übung
In dieser interaktiven Übung kannst du die Theorie in die Praxis umsetzen.
