fork download
  1. import matplotlib.pyplot as plt
  2. import seaborn as sns
  3. import pandas as pd
  4.  
  5. # Sample data for inflation and unemployment rates (hypothetical data)
  6. data = {
  7. 'Year': [2018, 2019, 2020, 2021, 2022, 2023],
  8. 'Inflation Rate (%)': [3.4, 3.7, 6.2, 5.5, 7.0, 6.5],
  9. 'Unemployment Rate (%)': [6.1, 5.8, 7.1, 7.2, 7.5, 8.0],
  10. }
  11.  
  12. # Create a DataFrame
  13. df = pd.DataFrame(data)
  14.  
  15. # Set up the matplotlib figure
  16. plt.figure(figsize=(10, 6))
  17.  
  18. # Create a scatter plot for the Phillips Curve
  19. sns.regplot(x='Unemployment Rate (%)', y='Inflation Rate (%)', data=df, marker='o', color='blue')
  20.  
  21. # Set the title and labels
  22. plt.title('Phillips Curve: Inflation vs. Unemployment in India (2018-2023)')
  23. plt.xlabel('Unemployment Rate (%)')
  24. plt.ylabel('Inflation Rate (%)')
  25.  
  26. # Show grid
  27. plt.grid()
  28.  
  29. # Show the plot
  30. plt.show()
  31.  
Success #stdin #stdout 2.88s 121292KB
stdin
Standard input is empty
stdout
Standard output is empty