Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Make sure your Python code compiles. Any non - compiling code will receive a very lowmark. Naming : YourDeptStudentNumberInitialNameLastNameAssignmentNumber.py , For example, CoE 6 4
Make sure your Python code compiles. Any noncompiling code will receive a very lowmark.Naming : YourDeptStudentNumberInitialNameLastNameAssignmentNumber.pyFor example, CoEMalekMalkawiApy Not following the naming rule meansZERO You will submit only PythonJupyter files.Carefully read the questions and pay special attention to sentences that involve shouldshould notdo not and other underlinedbold font statements.If you use code from a resource website book, etc. make sure that you reference thoseresources at the top of your source code file in the form of comments. You should givedetails of which part of your code is from what resource. Failing to do so may resultin a plagiarism investigation.Any similarity in your source codes will have serious consequences for both parties.Late Submission Policy: late submissions will NOT be accepted
Question Data Manipulating: Pandas PtsImplement the following tasks by using Pandas library.Task Pts Load the csv file nbacsv into a DataFrame and display the firstten rows.Task Pts Print names of NBA players whose salary is greater than milliondollars.Task Pts In Height column, the heights of NBA players are given in feetand inches. Convert the unit of height to cm updating the same column.Task Pts Create a Data Frame including the names of teams in the firstcolumn and the average height of their players in the second column. Print the result.Task Pts Plot a bar chart using Matplotlib to show the top NBA teamswith the highest average height of their players. Set label names and titles.Task Pts In the College column, some information is missing NaN Remove the rows having NaN values in Collage column.Task Pts In the Salary column, some information is missing NaN Calculate the average salary of all NBA players and fill the NaN values with the averagesalary value.Question Data Manipulating: Pandas PtsImplement the following tasks by using Pandas library.Task Pts Load stateareascsvstateabbrevscsv and statepopulationcsvfiles into separate DataFrames and print them.Task Pts Merge stateabbrevs and stateareas Name the DataFrame asdf Print the result.Task Pts Merge df and statepop using necessary keywords to obtainthe Data Frame given in Figure Name the DataFrame as df Print the result
Figure : Expected result of TaskTask Pts Print the rows of states having NaN values in the population oryear column in df Remove these rows from df and print the result again.Task Pts Obtain a new DataFrame df from df with columns stateyearages and density by calculating density as population per area. Sort dfin ascending order by density. Display the results.Question Matplotlib PtsImplement the following tasks by using Matplotlib library.Task Pts Plot sine cosine, tangent, and cotangent functions as by subplots inside one figure. For all functions, set the range of xaxis between and deg For the sine and cosine, set the range of yaxis between and For the tangent andcotangent, adjust the range of yaxis to avoid extreme values. Split the grids into equal portions in x and y axis. Set different colors for each function graph. Draw tangent and cotangent graphs with dashed lines. Add a legend to the upper right cornerof each subplot. Add title to each subplot.Task Pts Load the csv file californiacitiescsv into a DataFrame. Extractdata of latdlongdareatotalkm and areawaterpercent You are expectedto draw a scatter plot. Set xaxis as latitude and set yaxis as longitude. Set the size ofthe points to represent the total area of cities. Add a legend to the upper right cornerof the figure and show sizes of points for and km Set the colorsof the points to represent the percentage of water in the area. Add a color bar next tothe figure. Set the label
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