Git Product home page Git Product logo

covid-19's Introduction

COVID-19 전망

COVID-19 전망 kaggle에서 코로나 현황을 다운 받아 최근 데이터를 추가하여 csv파일로 만들어서 이전 자료를 분석한다.

import csv

stdate = ''  # 팬터믹이 시작된 날짜
eddate = ''  # 팬더믹이 종료된 날짜 
days   = 0   # 펜더믹은 5일이상 100일 이상인 날짜 (시작기준), 펜더믹 종료는 펜더믹 시작 후 5일동안 단 한번도 100명이 증가되지 않는 마지막 100 일 이상일자 

f = open ('covid_19_data_new.csv', encoding="cp949")
data = csv.reader(f) 
next(data)

펜더믹의 시작일 찾기

for row in data :
    if row[4] == '' :
        row[4] = 0

   row[4] = float(row[4])

if days == 5 : 
    break
else : 
    if row[4] >= 100 :  
        if stdate == '' :
            stdate = row[0] 

        days = days + 1
    else :
        if days > 0 :
            stdate = ''
            days = 0

print ("펜데믹 시작일 : %s"%stdate)        

펜데믹 종료일 찾기

days = 0
if stdate  != '' :
    for row in data :
        if row[0] <= stdate :
            continue
       
       row[4] = float(row[4])
        if row[4] >= 100 :
            days = 0
            eddate = ''
        else :
            if eddate == '':
                eddate = row[0]
                
            days = days + 1
        
        if days == 5 : 
            break

    print("펜데믹 종료일 : %s"%eddate)
펜데믹 시작일 : 2020-02-20
펜데믹 종료일 : 2020-04-01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.