Which Python library do we use to get data from an API?
requests
Which pandas function calculates the average value of numbers in a column?
.mean()
What does this line of code do?
df[df["isDaytime"] == True]
Filters rows to show only daytime values
What plot is best for showing change/trend over time?
Line plot
What does marker="o" add to a line plot?
Dots on each data point
What is an endpoint in an API?
A URL to get data
Which pandas function gives you an overview of the statistics for a numerical column?
.describe()
Which pandas function is used to find a specific percentile (such as the 25th or 75th) of a numeric column?
.quantile()
What plot is best for comparing categories?
Bar plot
Which setting controls the width and height of a plot?
figsize=( , )
What function prints dictionaries in a more readable format than print()?
pprint.pprint()
Which pandas function loads a CSV file?
pd.read_csv()
Which pandas function provides multiple summary statistics (such as mean, min, and max) at once?
.agg()
Why should we always use colorblind-friendly colors when making plots?
To be inclusive/make sure all viewers can correctly tell the colors apart
Which setting rotates x-axis labels 45 degrees so they don’t overlap?
plt.xticks(rotation=45)
When an API returns nested JSON, which function in the pandas library can flatten it into an easy-to-read dataframe?
pd.json_normalize()
What does index=False do in this line of code?
df_values.to_csv("values_forecast.csv", index=False)
It tells Python not to include row numbers when writing the CSV file
Which pandas function finds the most common value in a column?
.mode()
What does annot=True do in a heatmap?
It shows the actual numbers inside each cell
Which matplotlib function adjusts spacing so labels and axes don’t get cut off when you save or export a plot?
plt.tight_layout()
What is the purpose of an API?
To allow different apps or systems to communicate and exchange data
What does this line of code do?
df_values["shortForecast"].value_counts()
Shows the frequency of each unique value in the shortForecast column (e.g., frequency of Mostly Sunny, Cloudy, etc.).
Why do we use .isin(["Sunny", "Cloudy"]) instead of ==?
Because .isin() can filter for multiple possible values at once while ==can only check one value at a time
Which matplotlib function creates multiple plots in the same figure?
plt.subplots()
What are three different ways to specify a color when making a plot?
Color names, hex codes, and RGB numbers