Question 1:
An energy consultancy collected data on 10 countries, recording population (in millions), installed renewable capacity (in GW), and the number of solar power projects completed in the last five years:
Country Population (Millions) Renewable Capacity (GW) Solar Projects Completed
Germany 83 120 350
China 1441 900 1200
United States 331 280 850
India 1380 150 600
Brazil 213 140 420
Spain 47 55 310
Australia 26 60 540
Canada 38 65 200
France 67 70 330
United Arab Emirates 10 15 180
Write a python program to
1. Create a Python Dictionary: Construct a Python dictionary called Countries with keys:
o "Country"
o "Population_millions"
o "Renewable_Capacity_GW"
o "Solar_Projects_Completed".
2. Build a Pandas DataFrame: Use this dictionary to create a Pandas DataFrame named DF_Countries and print it.
3. Display Initial Data: Print the first 5 rows of the DataFrame.
4. Create new columns for additional metrics:
o Add a column "Capacity_per_Capita_MW" = (Renewable_Capacity_GW × 1,000) ÷ Population_millions.
o Add a column "Projects_per_Million" = Solar_Projects_Completed ÷ Population_millions.
o Print the header of the augmented DataFrame.
5. Perform data analysis:
o Identify and print countries with Capacity_per_Capita_MW > 1,500 and Projects_per_Million > 10.
o Compute and print the average Solar_Projects_Completed for countries with Renewable_Capacity_GW > 100 GW.
Question 2:
An education research team compiled exam scores for 20 students across 4 subjects. The data is provided in students_scores.xlsx includes
o Student: This includes the student first name.
o Section: This includes the student section (A, B, C or D).
o Math: This is the student’s grade in Math (integer).
o Physics: This is the student’s grade in Physics (integer).
o Chemistry: This is the student’s grade in Chemistry (integer).
o English: This is the student’s grade in English (integer).
Write a python program to
1. Read the data from the excel file into a Pandas DataFrame called StudentsScores.
2. Display the first 5 rows of the DataFrame.
3. Print a summary of the DataFrame using the describe function. The summary should include all types of data.
4. Use the shape attribute of the DataFrame to determine and print its numbers of rows and columns.
5. Conduct data analysis:
o Count Section A students: determine and print how many students belong to Section A.
o Lowest Math score: identify the student with the lowest Math score and print that student’s data.
o Highest English score: identify the student with the highest English score and print that student’s data.
o Lowest total score: compute each student’s total across all four subjects, then identify the student with the lowest total, and print that student’s data.