Phillips curve using merge_ordered()
There is an economic theory developed by A. W. Phillips which states that inflation and unemployment have an inverse relationship. The theory claims that with economic growth comes inflation, which in turn should lead to more jobs and less unemployment.
You will take two tables of data from the U.S. Bureau of Labor Statistics, containing unemployment and inflation data over different periods, and create a Phillips curve. The tables have different frequencies. One table has a data entry every six months, while the other has a data entry every month. You will need to use the entries where you have data within both tables.
The tables unemployment and inflation have been loaded for you.
Latihan ini adalah bagian dari kursus
Joining Data with pandas
Petunjuk latihan
- Use
merge_ordered()to merge theinflationandunemploymenttables ondatewith an inner join, and save the results asinflation_unemploy. - Print the
inflation_unemploydataframe. - Using
inflation_unemploy, create a scatter plot withunemployment_rateon the horizontal axis andcpi(inflation) on the vertical axis.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Use merge_ordered() to merge inflation, unemployment with inner join
inflation_unemploy = ____
# Print inflation_unemploy
____
# Plot a scatter plot of unemployment_rate vs cpi of inflation_unemploy
inflation_unemploy.plot(____)
plt.show()