IniziaInizia gratis

Plot all the time series in your dataset

The jobs DataFrame contains 16 time series representing the unemployment rate of various industries between 2001 and 2010. This may seem like a large amount of time series to visualize at the same time, but Chapter 4 introduced you to facetted plots. In this exercise, you will explore some of the time series in the jobs DataFrame and look to extract some meaningful information from these plots.

Questo esercizio fa parte del corso

Visualizing Time Series Data in Python

Visualizza il corso

Istruzioni dell'esercizio

  • Review the first 5 rows of jobs_subset.
  • Create a faceted plot of the new jobs_subset DataFrame using a layout of 2 rows and 2 columns. Make sure to also specify that the subgraphs do not share x-axis and y-axis values.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# A subset of the jobs DataFrame
jobs_subset = jobs[['Finance', 'Information', 'Manufacturing', 'Construction']]

# Print the first 5 rows of jobs_subset
print(____)

# Create a facetted graph with 2 rows and 2 columns
ax = ____(subplots=____,
                      layout=____,
                      sharex=____,
                      sharey=____,
                      linewidth=0.7,
                      fontsize=3,
                      legend=False)

plt.show()
Modifica ed esegui il codice