{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Selenium 사용 동적 크롤링 - 주유소(셀프로 넣는게 더 싼가?)\n", "- 셀프주유소의 기름값을 보자\n", "- 셀프인곳과 아닌곳의 차이를 보는게 목표" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: selenium in c:\\anaconda3\\lib\\site-packages (3.141.0)\n", "Requirement already satisfied: urllib3 in c:\\anaconda3\\lib\\site-packages (from selenium) (1.24.2)\n" ] } ], "source": [ "# Selenium 설치.\n", "!pip install selenium" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import bs4\n", "import time\n", "import os\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from selenium.webdriver.common.keys import Keys\n", "from selenium import webdriver" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 1. 사이트에 들어가서 탐색해 본다" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "1. 먼저 다음 사이트에 들어가서 살펴본다: [Opinet](http://www.opinet.co.kr/user/main/mainView.do)\n", "2. 크롬에서 3점 메뉴 버튼을 누르고 **도구 더보기** ==> **개발자 도구**를 선택해서 개발자 도구를 연다.\n", "3. 개발자 도구 왼쪽 상단의 화살표 버튼을 눌러서 사이트 일부를 서택하고 해당 HTML코드를 볼 수 있다. \"[CTRL] + [SHIFT] + C\" 조합으로 대체할 수 있다." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "os.chdir(r'C:\\Users\\Gram\\Desktop\\myPyCode\\02 데이터 수집과 처리 - 실습')\n", "# 웹드라이버 로딩. \n", "my_driver = webdriver.Chrome('chromedriver.exe') " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# 사이트에 접속. \n", "my_driver.get(\"http://www.opinet.co.kr\") #창 닫으면 안됨" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# 세부 링크로 간다.\n", "my_driver.get(\"http://www.opinet.co.kr/searRgSelect.do\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "http://www.opinet.co.kr/searRgSelect.do\n" ] } ], "source": [ "# 현재 URL 출력해 본다.\n", "print(my_driver.current_url)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 2. 시,도 리스트 가져오기" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['시/도',\n", " '서울',\n", " '부산',\n", " '대구',\n", " '인천',\n", " '광주',\n", " '대전',\n", " '울산',\n", " '세종',\n", " '경기',\n", " '강원',\n", " '충북',\n", " '충남',\n", " '전북',\n", " '전남',\n", " '경북',\n", " '경남',\n", " '제주']" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 시/도 리스트 가져와 본다.\n", "my_sido = my_driver.find_element_by_css_selector(\"#SIDO_NM0\") #ctrl,shift,c들어가서 sido_nmo로 가져오기(지역의 서울 칸)\n", "my_sido_list = my_sido.text.split() #split하고 sido_nmo가 셀렉트태그라 시도리스트로\n", "my_sido_list" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['서울', '부산', '대구', '인천', '광주', '대전', '울산', '세종', '경기', '강원', '충북', '충남', '전북', '전남', '경북', '경남', '제주']\n" ] } ], "source": [ "my_sido_list.pop(0) #첫 번째 값이 '시/도'라 불필요해 버림. #pop하면 마지막값을 버림 #pop(위치)하면 해당위치 버려짐\n", "print(my_sido_list)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 3. 서울시의 시/군/구 리스트 가져오기" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "#시/도 리스트 가져오기\n", "my_sido = my_driver.find_element_by_css_selector(\"#SIDO_NM0\") #ctrl,shift,c들어가서 sido_nmo로 가져오기(지역 서울 칸)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "#시/도에서 서울시를 선택하기\n", "my_sido.send_keys(my_sido_list[0]) #시/도에서 서울시를 선택해야 함 (시도셀렉트 잡아서)\n", " #시도에 가서 만들어놓은걸 샌드키로 넣어줘야함-서울시로가고\n", " #군구가서 리스트로 값을 가져오고 첫번째거 버리면 구 리스트만 나옴\n", " #값을 샌드키로 넣어 그 값을 넣어줌? #값을 직접 대입하면 갑에 해당하는 셀렉터\n", "time.sleep(1)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "#서울시의 시/군/구 리스트 가져오기\n", "my_gu = my_driver.find_element_by_css_selector(\"#SIGUNGU_NM0\") #ctrl,shift,c들어가서 sigungu_NMO가져오기(지역 서울 칸)\n", "my_gu_list = my_gu.text.split() #split하고 sigungu가 셀렉트태그라 시군구리스트로" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['강남구', '강동구', '강북구', '강서구', '관악구', '광진구', '구로구', '금천구', '노원구', '도봉구', '동대문구', '동작구', '마포구', '서대문구', '서초구', '성동구', '성북구', '송파구', '양천구', '영등포구', '용산구', '은평구', '종로구', '중구', '중랑구']\n" ] } ], "source": [ "my_gu_list.pop(0) # 첫 번째 값은 '시/군/구'라 의미 없어 버림 \n", "print(my_gu_list)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "n_gus = len(my_gu_list) #25개" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 4. 서울시의 첫번째 구와 나머지 구 가져오기" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "# 서울시 첫 번째 구.\n", "my_sido = my_driver.find_element_by_css_selector(\"#SIDO_NM0\") #ctrl,shift,c들어가서 sido_nmo로 가져오기(지역 서울 칸)\n", "my_sido.send_keys(my_sido_list[0]) #시도리스트에 첫번째 [0]\n", "time.sleep(1) #sleep해야 쉬었다감\n", "\n", "my_gu = my_driver.find_element_by_css_selector(\"#SIGUNGU_NM0\")\n", "my_gu.send_keys(my_gu_list[0])\n", "time.sleep(1)\n", "\n", "my_download = my_driver.find_element_by_css_selector(\"div.desc_box a\") #클릭을해줘야 정보가 다운됬었음 사이트에서 desc는 함수 \n", "my_download.click() #사이트에서 파일저장버튼 누른것과 같음 #첫번째것이 엑셀로 다운로드됨 #휘발유와 셀프여부만 보면됨\n", "time.sleep(1)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "# 나머지 구.\n", "for i in range(n_gus): #gus은 구군 숫자?\n", " my_gu = my_driver.find_element_by_css_selector(\"#SIGUNGU_NM0\")\n", " \n", " if (i != 0): #첫번째 구는 위에서 다운했으니 스킵하고 2번째거부터\n", " my_gu.send_keys(Keys.DOWN) #키다운내려 하나씩 다운받아감 #구리스트에서 하나씩 값을 넣어줘도됨(샌드키로)\n", " time.sleep(1) \n", " my_download = my_driver.find_element_by_css_selector(\"div.desc_box a\") #버튼누러 \n", " my_download.click() #클릭\n", " time.sleep(1)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "# 다운로드 됬으니 브라우저 닫음\n", "my_driver.close() #미리 닫으면 오류남" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 5. 엑셀 문서를 불러와 데이터프레임으로 통합한다." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "# 엑셀 파일 이름을 모아둔다. \n", "os.chdir(r'C:\\Users\\Gram\\Downloads') #엑셀을 통합할거라 다운받은 경로지정\n", "file_list = os.listdir() #폴더안에 있는 파일들 이름을 리스트로 가져옴\n", "my_excel_files =[] \n", "for x in file_list:\n", " if x[-3:] == 'xls': #파일리스트에서 이름가져오되 마지막 3자리가 xls인거만 \n", " my_excel_files += [x] " ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['desktop.ini',\n", " '지역_위치별(주유소) (1).xls',\n", " '지역_위치별(주유소) (10).xls',\n", " '지역_위치별(주유소) (11).xls',\n", " '지역_위치별(주유소) (12).xls',\n", " '지역_위치별(주유소) (13).xls',\n", " '지역_위치별(주유소) (14).xls',\n", " '지역_위치별(주유소) (15).xls',\n", " '지역_위치별(주유소) (16).xls',\n", " '지역_위치별(주유소) (17).xls',\n", " '지역_위치별(주유소) (18).xls',\n", " '지역_위치별(주유소) (19).xls',\n", " '지역_위치별(주유소) (2).xls',\n", " '지역_위치별(주유소) (20).xls',\n", " '지역_위치별(주유소) (21).xls',\n", " '지역_위치별(주유소) (22).xls',\n", " '지역_위치별(주유소) (23).xls',\n", " '지역_위치별(주유소) (24).xls',\n", " '지역_위치별(주유소) (25).xls',\n", " '지역_위치별(주유소) (26).xls',\n", " '지역_위치별(주유소) (27).xls',\n", " '지역_위치별(주유소) (28).xls',\n", " '지역_위치별(주유소) (29).xls',\n", " '지역_위치별(주유소) (3).xls',\n", " '지역_위치별(주유소) (30).xls',\n", " '지역_위치별(주유소) (31).xls',\n", " '지역_위치별(주유소) (32).xls',\n", " '지역_위치별(주유소) (33).xls',\n", " '지역_위치별(주유소) (34).xls',\n", " '지역_위치별(주유소) (35).xls',\n", " '지역_위치별(주유소) (36).xls',\n", " '지역_위치별(주유소) (37).xls',\n", " '지역_위치별(주유소) (38).xls',\n", " '지역_위치별(주유소) (39).xls',\n", " '지역_위치별(주유소) (4).xls',\n", " '지역_위치별(주유소) (40).xls',\n", " '지역_위치별(주유소) (41).xls',\n", " '지역_위치별(주유소) (42).xls',\n", " '지역_위치별(주유소) (43).xls',\n", " '지역_위치별(주유소) (44).xls',\n", " '지역_위치별(주유소) (45).xls',\n", " '지역_위치별(주유소) (46).xls',\n", " '지역_위치별(주유소) (47).xls',\n", " '지역_위치별(주유소) (48).xls',\n", " '지역_위치별(주유소) (49).xls',\n", " '지역_위치별(주유소) (5).xls',\n", " '지역_위치별(주유소) (50).xls',\n", " '지역_위치별(주유소) (51).xls',\n", " '지역_위치별(주유소) (52).xls',\n", " '지역_위치별(주유소) (53).xls',\n", " '지역_위치별(주유소) (54).xls',\n", " '지역_위치별(주유소) (55).xls',\n", " '지역_위치별(주유소) (56).xls',\n", " '지역_위치별(주유소) (57).xls',\n", " '지역_위치별(주유소) (58).xls',\n", " '지역_위치별(주유소) (59).xls',\n", " '지역_위치별(주유소) (6).xls',\n", " '지역_위치별(주유소) (60).xls',\n", " '지역_위치별(주유소) (61).xls',\n", " '지역_위치별(주유소) (62).xls',\n", " '지역_위치별(주유소) (63).xls',\n", " '지역_위치별(주유소) (64).xls',\n", " '지역_위치별(주유소) (65).xls',\n", " '지역_위치별(주유소) (66).xls',\n", " '지역_위치별(주유소) (67).xls',\n", " '지역_위치별(주유소) (68).xls',\n", " '지역_위치별(주유소) (69).xls',\n", " '지역_위치별(주유소) (7).xls',\n", " '지역_위치별(주유소) (70).xls',\n", " '지역_위치별(주유소) (71).xls',\n", " '지역_위치별(주유소) (72).xls',\n", " '지역_위치별(주유소) (73).xls',\n", " '지역_위치별(주유소) (74).xls',\n", " '지역_위치별(주유소) (75).xls',\n", " '지역_위치별(주유소) (76).xls',\n", " '지역_위치별(주유소) (77).xls',\n", " '지역_위치별(주유소) (78).xls',\n", " '지역_위치별(주유소) (79).xls',\n", " '지역_위치별(주유소) (8).xls',\n", " '지역_위치별(주유소) (80).xls',\n", " '지역_위치별(주유소) (81).xls',\n", " '지역_위치별(주유소) (82).xls',\n", " '지역_위치별(주유소) (83).xls',\n", " '지역_위치별(주유소) (84).xls',\n", " '지역_위치별(주유소) (85).xls',\n", " '지역_위치별(주유소) (86).xls',\n", " '지역_위치별(주유소) (87).xls',\n", " '지역_위치별(주유소) (88).xls',\n", " '지역_위치별(주유소) (89).xls',\n", " '지역_위치별(주유소) (9).xls',\n", " '지역_위치별(주유소) (90).xls',\n", " '지역_위치별(주유소).xls']" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "file_list" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "# 읽어 들여서 하나의 데이터 프레임으로 통합한다.\n", "n_excels = len(my_excel_files)\n", "for i in range(n_excels): \n", " a_df = pd.read_excel(my_excel_files[i],header=2, na_values = [' ', '-'])#헤더가 2: 0,1을(불필요한게 잇었음) 제끼고 3행부터 가져옴\n", " #na_values: 엑셀보면 -있으니 결측치처리\n", " if i == 0:\n", " df = a_df #a 데이터프레임\n", " else:\n", " df = pd.concat([df,a_df], axis=0, ignore_index=True)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1918, 10)" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
지역상호주소상표전화번호셀프여부고급휘발유휘발유경유실내등유
0서울특별시(주)석산에너지서울 강북구 삼양로 316 (수유동)현대오일뱅크02-980-1448NNaN1509.01349.0950.0
1서울특별시북서울고속주유소서울 강북구 삼양로 410 (수유동)S-OIL02-907-5182YNaN1509.01359.0NaN
2서울특별시수유동주유소서울 강북구 도봉로 395 (수유동)GS칼텍스02-902-9470YNaN1509.01349.0NaN
\n", "
" ], "text/plain": [ " 지역 상호 주소 상표 전화번호 셀프여부 고급휘발유 \\\n", "0 서울특별시 (주)석산에너지 서울 강북구 삼양로 316 (수유동) 현대오일뱅크 02-980-1448 N NaN \n", "1 서울특별시 북서울고속주유소 서울 강북구 삼양로 410 (수유동) S-OIL 02-907-5182 Y NaN \n", "2 서울특별시 수유동주유소 서울 강북구 도봉로 395 (수유동) GS칼텍스 02-902-9470 Y NaN \n", "\n", " 휘발유 경유 실내등유 \n", "0 1509.0 1349.0 950.0 \n", "1 1509.0 1359.0 NaN \n", "2 1509.0 1349.0 NaN " ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head(3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 6. 결측치 처리" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "지역 0\n", "상호 0\n", "주소 0\n", "상표 0\n", "전화번호 0\n", "셀프여부 0\n", "고급휘발유 1176\n", "휘발유 36\n", "경유 36\n", "실내등유 1073\n", "dtype: int64" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 결측치 집계.\n", "(df.isnull()).sum(axis=0)" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
지역상호주소상표전화번호셀프여부휘발유경유
0서울특별시(주)석산에너지서울 강북구 삼양로 316 (수유동)현대오일뱅크02-980-1448N1509.01349.0
1서울특별시북서울고속주유소서울 강북구 삼양로 410 (수유동)S-OIL02-907-5182Y1509.01359.0
2서울특별시수유동주유소서울 강북구 도봉로 395 (수유동)GS칼텍스02-902-9470Y1509.01349.0
3서울특별시(주)에프알엔디 직영 송정주유소서울 강북구 인수봉로 185 (수유동)SK에너지02-993-5189N1535.01375.0
4서울특별시현대오일뱅크(주)직영 미아셀프주유소서울 강북구 도봉로 200 (미아동)현대오일뱅크02-945-7999Y1538.01379.0
...........................
1913서울특별시대성석유(주)직영 길동주유소서울 강동구 천호대로 1168GS칼텍스02-474-7222N1648.01498.0
1914서울특별시광성주유소서울 강동구 올림픽로 673 (천호동)S-OIL02-470-5133N1658.01498.0
1915서울특별시SK네트웍스 명일셀프주유소서울 강동구 고덕로 168 (명일동)SK에너지02-3428-1739N1665.01499.0
1916서울특별시(주)삼표에너지 고덕주유소서울 강동구 고덕로 39 (암사동)GS칼텍스02-441-3327N1698.01529.0
1917서울특별시강동주유소서울 강동구 양재대로 1509 (길동)SK에너지02-477-5101N1993.01797.0
\n", "

1918 rows × 8 columns

\n", "
" ], "text/plain": [ " 지역 상호 주소 상표 전화번호 \\\n", "0 서울특별시 (주)석산에너지 서울 강북구 삼양로 316 (수유동) 현대오일뱅크 02-980-1448 \n", "1 서울특별시 북서울고속주유소 서울 강북구 삼양로 410 (수유동) S-OIL 02-907-5182 \n", "2 서울특별시 수유동주유소 서울 강북구 도봉로 395 (수유동) GS칼텍스 02-902-9470 \n", "3 서울특별시 (주)에프알엔디 직영 송정주유소 서울 강북구 인수봉로 185 (수유동) SK에너지 02-993-5189 \n", "4 서울특별시 현대오일뱅크(주)직영 미아셀프주유소 서울 강북구 도봉로 200 (미아동) 현대오일뱅크 02-945-7999 \n", "... ... ... ... ... ... \n", "1913 서울특별시 대성석유(주)직영 길동주유소 서울 강동구 천호대로 1168 GS칼텍스 02-474-7222 \n", "1914 서울특별시 광성주유소 서울 강동구 올림픽로 673 (천호동) S-OIL 02-470-5133 \n", "1915 서울특별시 SK네트웍스 명일셀프주유소 서울 강동구 고덕로 168 (명일동) SK에너지 02-3428-1739 \n", "1916 서울특별시 (주)삼표에너지 고덕주유소 서울 강동구 고덕로 39 (암사동) GS칼텍스 02-441-3327 \n", "1917 서울특별시 강동주유소 서울 강동구 양재대로 1509 (길동) SK에너지 02-477-5101 \n", "\n", " 셀프여부 휘발유 경유 \n", "0 N 1509.0 1349.0 \n", "1 Y 1509.0 1359.0 \n", "2 Y 1509.0 1349.0 \n", "3 N 1535.0 1375.0 \n", "4 Y 1538.0 1379.0 \n", "... ... ... ... \n", "1913 N 1648.0 1498.0 \n", "1914 N 1658.0 1498.0 \n", "1915 N 1665.0 1499.0 \n", "1916 N 1698.0 1529.0 \n", "1917 N 1993.0 1797.0 \n", "\n", "[1918 rows x 8 columns]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 불필요 컬럼 제거.\n", "df = df.drop(columns = ['고급휘발유','실내등유'])\n", "df" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "# 결측치 처리. \n", "df.dropna(axis=0,inplace=True) #행방향으로 없앰" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1882, 8)" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 확인.\n", "df.shape" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Int64Index: 1882 entries, 0 to 1917\n", "Data columns (total 8 columns):\n", "지역 1882 non-null object\n", "상호 1882 non-null object\n", "주소 1882 non-null object\n", "상표 1882 non-null object\n", "전화번호 1882 non-null object\n", "셀프여부 1882 non-null object\n", "휘발유 1882 non-null float64\n", "경유 1882 non-null float64\n", "dtypes: float64(2), object(6)\n", "memory usage: 132.3+ KB\n" ] } ], "source": [ "# 컬럼은 자료형 주목! \n", "df.info() #object아니면 float" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### 7. 분석과 시각화" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "셀프여부\n", "N 1683.801431\n", "Y 1570.857330\n", "Name: 휘발유, dtype: float64" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 셀프여부별 휘발유 평균가격.\n", "df.groupby('셀프여부')['휘발유'].mean() #30원 차이 남" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "셀프여부\n", "N 1522.037567\n", "Y 1406.667539\n", "Name: 경유, dtype: float64" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 셀프여부별 경유 평균가격.\n", "df.groupby('셀프여부')['경유'].mean() #100원 차이남" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEICAYAAACzliQjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAafUlEQVR4nO3dfZRcdZ3n8fenO0YENJ2YGCAJia44J0mTE7B5WHF2Mo6dBuTJmXUGEM0KynaFDKMwA8Zd5cF1zMaHs+rYycAQedKwOKBk9uCmGw/MLDI8dCRDaDJAFDEdYhNIV4CAISTf/ePebipFP6e7b3fdz+ucOl31u7dufW+q8rm/+t1b9yoiMDOzfKjKugAzMxs9Dn0zsxxx6JuZ5YhD38wsRxz6ZmY54tA3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xGxE7gduKik+QGS4UeATwL3j3Zdlc49/QoXEZskXQPcI6kK2EtylM8+4AYlYz5BsvPXbLR9C1hW8vhSYI2kvwF2AJ/JpKoK5tMwmJnliId3zMxyxKFvZpYjDn0zsxxx6JuZ5YhD38wsRxz6ZmY54tA3M8uR/w8bk2M/hMliOwAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# 셀프여부별 휘발유 가격 시각화.\n", "Yes = df[df.셀프여부 == 'Y'].휘발유 #셀프인 곳의 휘발유\n", "No = df[df.셀프여부 == 'N'].휘발유 #셀프아닌 곳의 휘발유\n", "plt.boxplot([Yes,No],0,labels=['Yes','No'])\n", "plt.title('Gasoline Price: Self Yes vs No') #평균은 별 차이 안남(박스플롯) \n", " #오른쪽 박스플록 위에 가격 높은거 3개 => 셀프가 아닌곳은 바가지가 있다는 의미 \n", "plt.show() " ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAEICAYAAACzliQjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAaUklEQVR4nO3df5xddX3n8dd7kkCAADM3ia6E/KAVfJRQHpYOP7bVR4E6M0QlYHepoa5GbU0nwVBc/JHUVX4oPiioXdkYRqgRASGLC0pssUnwUeuylh8DxUCkLAHCJkIlZGYCgQCT5LN/nDPjzc38ztw5k/t9Px+P+5h7vufccz93Mnmf7/2eX4oIzMwsDXVFF2BmZmPHoW9mlhCHvplZQhz6ZmYJceibmSXEoW9mlhCHvvVLUpukL1Rx/XMkhaSJo7S+H0taOBrrqgZJP5X0F2XTX5b0kqR/L7IuS4tDP1GSNkvaJekVSV2Sfi6pVVLv30REtEbEl8ZBjT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swmJklxMM7ZmYJceibmSXEoW9mlhCHvplZQhz6ZmYJceibmSXEoW9mlpD/D4Lqtj9YcIQAAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# 셀프여부별 경유 가격 시각화. \n", "Yes = df[df.셀프여부 == 'Y'].경유\n", "No = df[df.셀프여부 == 'N'].경유\n", "plt.boxplot([Yes,No],0,labels=['Yes','No'])\n", "plt.title('Diesel Price: Self Yes vs No')\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }