본문 바로가기

Data Analysis/Kaggle

[Kaggle] Zomato Bangalore Restaurants 데이터 분석 1 (데이터 확인 / 질문하기)

728x90

Zomato Bangalore Restaurants 데이터 분석

데이터 출처 :  https://www.kaggle.com/himanshupoddar/zomato-bangalore-restaurants

 

Zomato Bangalore Restaurants

Restaurants of Bengaluru

www.kaggle.com

1. 데이터 확인

# 기본 패키지 불러오기

import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
plt.style.use("seaborn") 
sns.set(font_scale = 1)
sns.set_style("whitegrid")

import plotly.express as px

import chart_studio.plotly as py
import cufflinks as cf
cf.go_offline(connected=True)

import plotly.graph_objects as go
import plotly.offline as pyo
pyo.init_notebook_mode()

from plotly.subplots import make_subplots

import missingno as msno

import warnings # 경고 메세지 숨기기
warnings.filterwarnings(action='ignore')

plt.rcParams['font.family'] = 'S-Core Dream' # 한글 폰트 가져오기 (WIN)
# plt.rc("font", family = "AppleGothic") # 한글 폰트 가져오기(MAC)
plt.rcParams['axes.unicode_minus'] = False # - 기호 깨짐 해결

 

# 데이터 불러오기

zomato = pd.read_csv("data/zomato.csv")

print(zomato.shape)
zomato.head()

<컬럼 설명>  
- url : Zomato 사이트의 URL
- address : 식당 주소
- name : 식당 이름
- online_order : 온라인 주문 가능 여부(Yes/No)
- book_table : 테이블 예약 가능 여부(Yes/No)
- rate : 식당 평점(5점 만점)
- votes : 평점 참여 횟수
- phone : 식당 전화번호
- location : 식당 위치
- rest_type : 레스토랑 타입
- dish_liked : 인기 메뉴
- cuisines : 메뉴 타입
- approx_cost(for two people) : 대략적인 가격(두 사람 기준)
- reviews_list : 평점과 리뷰로 구성된 후기 정보
- menu_item : 레스토랑에서 주문 가능한 메뉴
- listed_in(type) : 식사 종류
- listed_in(city) : 레스토랑 위치

 

 

# 데이터 정보 확인

zomato.info()

 

 

# 수치형 데이터 통계치 확인

zomato.describe()

 

 

# 범주형 데이터 통계치 확인

zomato.describe(include = np.object_)

 

 

# 결측치 확인

zomato.isnull().sum()

 

 

# 결측치 시각화

msno.bar(zomato)

dish_liked 컬럼에 결측치가 상당히 많고, rate 컬럼에도 결측치가 눈에 띄게 있다는 것을 알 수 있습니다.

 

 

# 데이터 내용 간단히 정리

print("총 데이터 개수:", zomato.shape[0] * zomato.shape[1])
print("총 결측치 수: {} = 전체 데이터의 {:.2f}%".format(zomato.isnull().sum().sum(), (zomato.isnull().sum().sum()*100)/(zomato.shape[0]*zomato.shape[1])))
print("전체 식당 수:", zomato['name'].nunique())

총 데이터 개수: 879189

총 결측치 수: 37700 = 전체 데이터의 4.29%

전체 식당 수: 8792

2. 질문하기

- 방갈로르에 가장 많은 레스토랑은?  
- 방갈로르의 레스토랑 운영 형태는?  
- 방갈로르의 어느 위치에 레스토랑이 가장 많은가?  
- 온라인 주문과 테이블 예약이 가능한 식당 비율은?   
- 온라인 주문/테이블 예약이 금액과 평점에 영향을 주는가?  
- 레스토랑의 종류 별로 메뉴가 다를까?

728x90