Page 1 of 1

Task 2(30 points): (Intro to Data Science: Pandas-dateframes) Write a program that does the following tasks with pandas

Posted: Thu May 05, 2022 12:49 pm
by answerhappygod
Task 2(30 points): (Intro to Data Science: Pandas-dateframes)
Write a program that does
the following tasks with pandas DataFrames (as shown in the slides
"09-02-Data Science.pdf"):
(a) Create a DataFrame named temperatures from a dictionary of
three temperature readings
each for three people 'Maxine', 'James' and 'Amanda'.
(b) Recreate the DataFrame temperatures in Part (a) with custom
indices using the index
keyword argument and a list containing 'Morning', 'Afternoon' and
'Evening'.
(c) Select from temperatures the column of temperature readings for
'Maxine'.
(d) Select from temperatures the row of 'Morning' temperature
readings.
(e) Select from temperatures the rows for 'Morning' and 'Evening'
temperature readings.
(f) Select from temperatures the columns of temperature readings
for 'Amanda' and 'Maxine'.
(g) Select from temperatures the elements for 'Amanda' and 'Maxine'
in the 'Morning' and
'Afternoon'.
(h) Use the describe() method to produce temperatures' descriptive
statistics.
(i) Transpose temperatures (One example can be found at
https://www.geeksforgeeks.org/python-
pandas-dataframe-transpose/).
(j) Sort temperatures so that its column names are in alphabetical
order.