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

>>>

5 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Thank you so much.

    ReplyDelete
  2. data is not defined here
    it will display error

    ReplyDelete
    Replies
    1. check the second line where data is defined

      Delete
  3. it is defined in second line

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post