16. Four series objects Tempi, Temp2, Temp3 and Temp4 store the temperatures of week1, week2, week3 and week4 respectively. Create a dataframe from these four series objects where the indexes should be ‘Sunday’, ‘Monday’, … , ‘Saturday’, and columns should be ‘Week1’, ‘Week2’, ‘Week3’ and ‘Week4’.
import pandas as pd Temp1 = pd.Series([98, 99, 99, 96, 90, 94, 95]) Temp2 = pd.Series([92, 96, 92, 93, 97, 93, 93]) Temp3 = pd.Series([93, 91, 94, 96, 95, 92, 90]) Temp4 = pd.Series([95, 90, 99, 95, 96, 91, 95]) df = pd.DataFrame({‘Week1’:Temp1, ‘Week2’:Temp2, ‘Week3’:Temp3, ‘Week4’:Temp4}) # Adding each Series as a column in our […]