Python
Python
Answer-
import pandas as pd
L = pd.Series([25, 22, 28.9, 27.2, 28.1, 29.9, 30.2, 31, 32.69, 32.42, 33.64, 33.8, 32,
30.6, 29.3, 28, 26.9, 26.44, 25.56, 24.398, 24.1, 23, 22.9, 22.13, 21.121, 19.7, 18.5,
17.9, 16.69,15.26])
a = L.head(7)
print(a)
b = L.tail(7)
print(b)
Output-
13. Answer -
import pandas as pd
w= sum(Temp1)/len(Temp1)
x= sum(Temp2)/len(Temp2)
y= sum(Temp3)/len(Temp3)
z= sum(Temp4)/len(Temp4)
total = w+x+y+z
Output-
14. Answer -
import pandas as pd
d = [{'old price': 12, 'new price': 16, 'change': 4}, {'old price': 18, 'new price': 13,
'change': -5}, {'old price': 21, 'new price': 33, 'change': 12}]
df = pd.DataFrame(d)
print(df)
Output -
36. Answer -
import pandas as pd
df = pd.DataFrame(data)
print(p)
Output -