jupyter 생성 파일을 jsp파일로 변경후 vscode에 iframe src="파일명"로 삽입하면 불러올 수 있음.
풀이 예시
chipo.quantity라는 주문수량이 1인 것을 chipo_one_item 객체에 넘겨준다.
chipo_one_item=chipo[chipo.quantity==1]
price_per_item 이라는 객채를 생성한곳에 chipo_one_item의 item_name을 그룹한 후에 min()을통해 최솟값으로 묶어준다.
price_per_item=chipo_one_item.groupby('item_name').min()
객체 price_per_irem 의 정렬한 값 (item_price)를 ascending 내림차순을한다 [:10]0~10번쨰 까지
price_per_item.sort_values(by='item_price',ascending=False)[:10]
가격과 아이템 이름의 그래프
item_name_list 객체에 price_per_item의 객체에있는 index값을 list(배열)로 만든다(이름을 넣어주는것)
item_name_list=price_per_item.index.tolist()
np(넘파이)를 통해 x_pos 객체에 시작값,item_name_list의 길이만큼 넣어준다,++or-- (이름을 넣어주는것)
x_pos=np.arange(len(item_name_list))
item_price 객체에 price_per_item객체에 item의 가격을 배열로 만든다.
item_price=price_per_item['item_price'].tolist()
매트롯 을통해 bar 그래프 생성한다(x_pos 객체,item_price 객체, 가운데정렬)
plt.bar(x_pos,item_price,align='center')
출력문
plt.show()
hist
plt.hist(item_price)
plt.show()
#Veggie Salad Bowl 몇 번 주문되었는지를 계산
#Chicken Bowl을 2개 이상 주문한 합계
#Chicken Bowl을 2개 이상 주문한 고객들의 메뉴Chicken Bowl의 총 주문 수량을 구해라.
print(len(chipo_chicken_result))
chipo_chicken_result.head(5)