Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assignment 3 and python related. All questions are worth the same number of points except question 1 which is worth 1 7 % of the
Assignment and python related. All questions are worth the same number of points except question which is worth of the assignment grade. Note: Questions rely on your question answer. : import pandas as pd import numpy as np # Filter all warnings. If you would like to see the warnings, please comment the two lines below. import warnings warnings.filterwarningsignore Question Country 'Energy Supply', 'Energy Supply per Capita', Renewable Convert Energy Supply to gigajoules Note: there are gigajoules in a petajoule For all countries which have missing data eg data with make sure this is reflected as np NaN values. Rename the following list of countries for use in later questions: Next, load the GDP data from the file assetsworldbank.csv which is a csv containing countries' GDP from to from World Bank. Call this DataFrame GDP Make sure to skip the header, and rename the following list of countries: "Korea, Rep.": "South Korea", "Iran, Islamic Rep.": "Iran", "Hong Kong SAR, China": "Hong Kong" This function should return a DataFrame with columns and entries, and the rows of the DataFrame should be sorted by "Rank". def answerone: assert typeanswerone pdDataFrame, Q: You should return a DataFrame!" assert answeroneshape : Your DataFrame should have columns and entries!"
Assignment
and python related. All questions are worth the same number of points except question which is worth of the assignment grade.
Note: Questions rely on your question answer.
: import pandas as pd
import numpy as np
# Filter all warnings. If you would like to see the warnings, please comment the two lines below.
import warnings
warnings.filterwarningsignore
Question
Country 'Energy Supply', 'Energy Supply per Capita', Renewable
Convert Energy Supply to gigajoules Note: there are gigajoules in a petajoule For all countries which have missing data eg data with make sure this is reflected as np NaN values.
Rename the following list of countries for use in later questions:
Next, load the GDP data from the file assetsworldbank.csv which is a csv containing countries' GDP from to from World Bank. Call this DataFrame GDP
Make sure to skip the header, and rename the following list of countries:
"Korea, Rep.": "South Korea", "Iran, Islamic Rep.": "Iran", "Hong Kong SAR, China": "Hong Kong"
This function should return a DataFrame with columns and entries, and the rows of the DataFrame should be sorted by "Rank".
def answerone:
assert typeanswerone pdDataFrame, Q: You should return a DataFrame!"
assert answeroneshape : Your DataFrame should have columns and entries!"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started