Exemple #1
0
import collect
from config import CONFIG
import analyze
import visualize

if __name__ == '__main__':

    # 데이터 수집(collectino)

    collect.crawling_tourspot_visitor(district=CONFIG['district'],
                                      **CONFIG['common'])

    for country in CONFIG['countries']:
        collect.crawling_foreign_visitor(country, **CONFIG['common'])

    # 데이터 분석(analyze)
Exemple #2
0
import collect
import analyze
import visualize
from config import CONFIG

if __name__ == '__main__':
    resultfiles = dict()
    #collect
    resultfiles['tourspot_visitor'] = collect.crawling_tourspot_visitor(
        district=CONFIG['district'],
        # start_year=CONFIG['common']['start_year'],
        # end_year=CONFIG['common']['end_year']
        **CONFIG['common'])

    resultfiles['foreign_visitor'] = []
    for country in CONFIG['countries']:
        rf = collect.crawling_foreign_visitor(country, **CONFIG['common'])
        resultfiles['foreign_visitor'].append(rf)

    # # 1. analysis and visualize
    # result_analysis = analyze.analysis_correlation(resultfiles)
    # print(result_analysis)
    #
    # # 2. analysis and visualize
    # visualize.graph_scatter(result_analysis)

    result_analysis = analyze.analysis_correlation_by_tourspot(
        resultfiles)  # 장소별로 상관계수 구하기기

    visualize.graph_scatter_2(result_analysis)
Exemple #3
0
import collect
import collect
import analyze
import visualize
from config import CONFIG

if __name__ == '__main__':

    resultfiles = dict()  #딕션만들고

    #collect
    resultfiles['tourspot_visitor'] = collect.crawling_tourspot_visitor(  #딕션에저장
        district=CONFIG['district'],  #config에 있는 지역
        **CONFIG['common'])  #커먼에 이쓴 속성을 불러옴,common= 공통적인 속성을 커먼이라는 딕셔너리로 묶음
    #start_year= CONFIG ['common']['start_year'],
    #end_year= CONFIG['common']['end_year'])

    resultfiles['foreign_visitor'] = []
    for country in CONFIG['countries']:
        rf = collect.crawling_foreign_visitor(country,
                                              **CONFIG['common'])  #rf로 받음
        resultfiles['foreign_visitor'].append(rf)  #rf를 resultfile에 추가

    # 1.analysis and visulize
    #result_analysis=analyze.analysis_correlation(resultfiles)
# print(result_analysis)
#print(result_analysis)

#visualize
#visualize.graph_scatter(result_analysis)
Exemple #4
0
import collect
import analyze
import visualize
from config import CONFIG
import pandas as pd
import matplotlib.pyplot as plt

if __name__ == '__main__':
    resultfiles = dict()

    #collect
    resultfiles['tourspot_visitor'] = collect.crawling_tourspot_visitor(
        district=CONFIG['district'], **CONFIG['common'])

    resultfiles['foreign_visitor'] = []
    for country in CONFIG['countries']:
        rf = collect.crawling_foreign_visitor(country, **CONFIG['common'])
        resultfiles['foreign_visitor'].append(rf)

    # 1. analysis and visualize
    # result_analysis = analyze.analysis_correlation(resultfiles)
    # visualize.graph_scatter(result_analysis)

    # 2. analysis and visualize
    result_analysis = analyze.analysis_correlation_by_tourspot(resultfiles)

    graph_table = pd.DataFrame(result_analysis,
                               columns=['tourspot', 'r_중국', 'r_일본', 'r_미국'])
    graph_table = graph_table.set_index('tourspot')

    graph_table.plot(kind='bar')
import collect

if __name__ == '__main__':
    collect.crawling_tourspot_visitor(district='서울특별시',
                                      start_year=2017,
                                      end_year=2017)
Exemple #6
0
import collect
import analyze
import visualize
from config import CONFIG

if __name__ == '__main__':
    resultfiles = {}
    resultfiles['tourspot_visitor'] = []
    resultfiles['foreign_visitor'] = []

    # collection
    returnedFilename = collect.crawling_tourspot_visitor(
        district=CONFIG['district'], **CONFIG['common'])
    resultfiles['tourspot_visitor'].append(returnedFilename)

    for country in CONFIG['countries']:
        returnedFilename = collect.crawling_foreign_visitor(country=country,
                                                            **CONFIG['common'])
        resultfiles['foreign_visitor'].append(returnedFilename)

    # analysis
    results = analyze.analysis_correlation(resultfiles=resultfiles)

    # visualize
    for result in results:
        print(result)
    visualize.graph_scatter(results, showgraph=False)

    # 2. analysis & vsualization
    result_analysis = analyze.analysis_correlation_by_tourspot(
        resultfiles=resultfiles)
Exemple #7
0
import collect
from config import CONFIG

if __name__ == '__main__':
    #collect
    collect.crawling_tourspot_visitor(
        district=CONFIG['district'],
        **CONFIG['common']   #CONFIG['common']['start_year'] 가 가장 무난 딕셔너리로 보내는데 하나로 보내고 싶다면
                             #딕셔너리 형태로 ?
        )

    for country in CONFIG['countries']:
            collect.crawling_foreign_visitor(country,  **CONFIG['common'])



    #analysis



    #visualize
Exemple #8
0
import collect
import analyze
import visualize
import pandas as pd
import matplotlib.pyplot as plt
from config import CONFIG


if __name__== '__main__':
    resultfiles = dict()

    #collect
    resultfiles['tourspot_visitor'] = collect.crawling_tourspot_visitor(    # 서울특별시 데이터 생성후 파일만들기
        district=CONFIG['district'],
        **CONFIG['common'])

    resultfiles['foreign_visitor'] = []
    for country in CONFIG['countries']:
        rf = collect.crawling_foreign_visitor(country, **CONFIG['common'])  # 외국방문 데이터 생성후 파일만들기
        resultfiles['foreign_visitor'].append(rf)

    # 1. analysis and visualize
    result_analysis = analyze.analysis_correlation(resultfiles)
    visualize.graph_scatter(result_analysis)

    # 2. analysis and visualize
    result_analysis = analyze.analysis_correlation_by_tourspot(resultfiles)
    print("result_analysis === " , result_analysis)
    graph_table = pd.DataFrame(result_analysis, columns=['tourspot', 'r_중국', 'r_일본', 'r_미국'])
    print("graph_table === ", graph_table)
    graph_table = graph_table.set_index('tourspot')