Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- re = pd.read_excel('food.xlsx')
- #3
- print(re.iloc[21,5])
- print(re['Quantity'][21])
- #4
- print(re.head(4))
- # #5
- print(re['Quantity'][38:44])
- num = 0
- # #a
- for i in re['Quantity'][38:44]:
- num += i
- print(num)
- # #b
- print(sum(re['Quantity'][38:44]))
- # #6
- print(re['TotalPrice'][32:38].min())
- #7
- print(re.sort_values('Category',ascending=False))
- #8
- print(re.iloc[16:25].sort_values('Category',ascending=False))
- #9
- print(re.iloc[20:27].sort_values(['Category','Product'],ascending =[0,1]))
- print(re.iloc[20:27].sort_values(['Category','Product'],ascending = [1,0]))
- print(re.iloc[20:27].sort_values(['Category','Product'],ascending = [1,1]))
- #10
- print(pd.read_excel("food.xlsx", "Restaraunts"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement