Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help coding on Python Jupiter! Please help translate from pseudocode to example code. Step by step each question. Dont worry about the file. I
Please help coding on Python Jupiter! Please help translate from pseudocode to example code. Step by step each question. Dont worry about the file. I just need the concepts to crush the HW. Thank you!
10. Using the same dataframe from problem 9: 1. Display the shape and column names of the dataframe using their respective attributes. 2. Display the data types for all columns in the dataframe using the respective attribute. 3. Use the head method to display the first three rows in the dataframe. 4. Use the unique method on the countriesAndTerritories column to examine the unique country values. 5. Follow these steps: 1. Use the sort index method and set the inplace parameter to True. 2. Display the first five rows using the head method. 11. Using the same dataframe from problem 9: 1. Display the first three rows using the loc attribute. Note: use quotations on the date values when slicing (e.g., ["mm/dd/yyyy" : "mm/dd/yyyy"]). 1. First, subset your dataframe in a new variable to include all the data related to the United States and apply the copy method. 2. Next, subset that new variable to only include all the data related to the United States, where cases are greater than 0 and store it into a dataframe variable. 3. Then display the last five rows in the subset containing cases greater than 0. (use the tail method) 4. Finally, apply the count method on the dateRep column of the same subset. 12. Using the same dataframe from problem 9: 1. Display the first two rows using the iloc attribute. 13. Using the dataframe from problem 9, 6. Apply the same steps as problem 5, but for all the data related to Italy, where cases are greater than 0. 7. In a new dataframe variable: 1. Create one pandas plot using the groupby and plot methods that compares each country's reported cases overtime. Set the legend parameter to True in the plot method. 1. Concatenate both subset dataframes (from problem 5 and 6) using panda's con- catenate function. (use pd.concat(..)) 2. Display the frequencies for each country by using the value_counts() method on the countriesAndTerritories data column from the new dataframe variable in part 7a. Note this will only be one chart with two lines--one for the United States and one for It- aly. The x-axis contains the date information and the y-axis contains the number of cases. 14. Using the dataframe from problem 9, 8. Using the dataframe from problem 7: 1. Change the date reported column's data type using the pd.to datetime function. 2. Next, display the data types for each column using the dtypes attribute on the da- taframe. 1. Use the groupby() and describe() methods to provide the descriptive statistics on reported deaths per country. 2. Explain your results by comparing the count, max, mean, standard deviation be- tween the two countries. Mention the time periods when explaining the result. Limit your explanations to no more than five sentences. 9. Using the dataframe from problem 8: 1. Display the row index values using the index attribute. 2. Next, use the set index method to set the date reported variable as the index (also set the inplace parameter to True). End of document I Note: 1) The inplace=True will make a permanent change to the dataframe without hav- ing to assign it to a new variable. 2) The rest of the problems will refer to the updated dataframe in thisStep 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