GithubHelp home page GithubHelp logo

statistics-of-singapore-covid-19-cases's People

Contributors

lushl9301 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

statistics-of-singapore-covid-19-cases's Issues

Download html to text

lynx -width=10000000 --dump moh.gov.sg/news-highlights/details/15-more-cases-discharged-75-more-cases-of-covid-19-infection-confirmed 

script to extract the text-based news

Usage

python process_text_day.py day71.txt

Output

2020-04-06.txt
import string
import re
from datetime import datetime
import sys

f = open(sys.argv[1], "r")
while True:
    line = f.readline()
    if not line:
        break
    x = line[0]
    if x.isdigit():
        s = line.rstrip()
        s = s.replace("rd", "")
        s = s.replace("nd", "")
        s = s.replace("th", "")
        s = s.replace("st", "")
        datetime_object = datetime.strptime(s, '%d %b %Y')
        rename = str(datetime_object.date())+".txt"
        fout = open(rename, "w")
        fout.write(re.sub(" +", " ", s))
        line = f.readline()
        x = line[0]
        while x != "M":
            #if (" MINISTRY OF HEALTH" in line):
            #    continue
            #if (" " + rename in line):
            #    continue
            fout.write(re.sub(" +", " ", line))
            line = f.readline()
            x = line[0]
        break

Handling outliers

  1. Repeated/overlapping cases among different clusters

assign the cases to each cluster. Allowing duplicates.

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.