QuantEcon / reading-group-2024

A shared repository to support notes and discussion for the Reading Group 2024
2 stars 0 forks source link

Review Suggestions for GDP Lecture #26

Open HumphreyYang opened 5 months ago

HumphreyYang commented 5 months ago

Thanks everyone for putting together this amazing notebook.

I really love those visualizations!

Below are some minor comments regarding styles, code, and content : )

General Comments

start_date = datetime.datetime(1949, 1, 1) end_date = datetime.datetime(2023, 10, 1)

nominal_gdp = web.DataReader('GDP', 'fred', start_date, end_date) real_gdp = web.DataReader('GDPC1', 'fred', start_date, end_date)

plt.figure(figsize=(10, 6)) plt.plot(nominal_gdp.index, nominal_gdp['GDP'], label='Nominal GDP') plt.plot(real_gdp.index, real_gdp['GDPC1'], label='Real GDP', linestyle='--')

plt.xlabel('Year') plt.ylabel('Billions of dollars') plt.legend() plt.show()

Introduction

What is GDP

plt.plot(nominal_gdp.index, nominal_gdp['GDP'], label='Nominal GDP')
plt.plot(real_gdp.index, real_gdp['GDPC1'], label='Real GDP', linestyle='--')

plt.title('Nominal vs. Real GDP of US (1949 - 2023)')
plt.xlabel('Year')
plt.ylabel('Billions of Dollars / Billions of Chained 2017 Dollars')

->

plt.plot(nominal_gdp.index, nominal_gdp['GDP'], label='Nominal GDP')
plt.plot(real_gdp.index, real_gdp['GDPC1'], label='Real GDP in 2017 dollars', linestyle='--')

plt.xlabel('Year')
plt.ylabel('Billions of dollars')

GDP: Unique Factors

for i in range(len(data_lifeexp.gdppc)): if data_lifeexp.gdppc[i] < 28000: gdppc_lowincome.append(data_lifeexp.gdppc[i]) lifeexp_lowincome.append(data_lifeexp.life_exp[i]) else: gdppc_highincome.append(data_lifeexp.gdppc[i]) lifeexp_highincome.append(data_lifeexp.life_exp[i])

See https://python-programming.quantecon.org/pandas.html#select-data-by-conditions.

## 4. GDP and Environment

- [ ] In the line, 

pd.read_excel('Global temp.xlsx', sheet_name='Temperature Anomaly')


`'Global temp.xlsx'` is not found.

- [ ] In the sentence 'The Pearson correlation coefficient for this set of data is 0.9317515940963721 ...' we can round the number to 2 digits. Also, is Pearson correlation a good metric for non-linear correlation like we have shown in the graph? (Hint: search 'linear' in https://en.wikipedia.org/wiki/Correlation)

## When addressing these issues...

When opening the PR addressing a subset of these issues, please add items you addressed in the description. 

It would be a great help for reviewers to see what has been done and what's left on the table.
jstac commented 5 months ago

Many thanks @HumphreyYang for this comprehensive review!

@pgrosser1 @mbek0605 @Jiarui-ZH Could you please implement the changes for your section?

Don't worry too much about the main text because Tom and I will rewrite it. For example, you can skip "Each line should include only one sentence." What's important is getting all the data organize and the figures at their latest versions, hopefully in line with manual.quantecon.org.

I'm CCing @mmcky who can also help you get these changes implemented and merged.