Q. Write Python code to create a Series object Temp2 storing temperatures of seven days of week. Its indexes should be ‘Sunday'. Monday'. ‘Saturday’.
You can understand by Watching video :-
Answer =
import pandas as pd data = [20, 30, 25, 35, 40, 39, 28] Temp1 = pd.Series(data,index=['monday','tuesday','\ Wednesday','Thursday','Friday','Saturday','Sunday ']) print(Temp1)
Output :-
monday 20
tuesday 30
Wednesday 25
Thursday 35
Friday 40
Saturday 39
Sunday 28
dtype: int64
>>>
Thank you so much.
ReplyDeleteWelcome : )
Deletedata is not defined here
ReplyDeleteit will display error
check the second line where data is defined
Deleteit is defined in second line
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )