Q. Create the following DataFrame Sales containing year wise sales figures for five sales persons in INR. Use the years as column labels, and sales perso names as row labels.

 

2014

2015

2016

2017

Madhu

100.5

12000

20000

50000

Kusum

150.8

18000

50000

60000

Kinshuk

200.9

22000

70000

70000

Ankit

30000

30000

100000

80000

Shruti

40000

45000

125000

90000


 

 

 

 

 

 

Answer :-


import pandas as pd
inr2014=[700,2100,1300,878,987]
inr2015=[700,2100,1310,878,978]
inr2016=[5000,2100,1350,878,977]
inr2017=[700,2150,1370,878,987]

label=['Madhu','Kusum','Kinshuk','Ankit','shruti']
dic={'2014':inr2014,'2015':inr2015,'2016':inr2016,'2017':inr2017}
Sales  = pd.DataFrame(dic,index=label)
print(Sales)

2 Comments

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

Post a Comment

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

Previous Post Next Post