<jupyter_start><jupyter_text>Get the county a city is located in<jupyter_code>filename = "/home/jack/Desktop/COVID-19-Jupyter-Notebooks/SimpleCities/cities-and-counties.csv"
COUNTYdata=[]
cnt=0
filein = open("CountyData.data", "w")
datain = open(filename, "r").read()
DATAin = datain.splitlines()
for line in DATAin:
    cnt=cnt+1
    filein.write(line+"\n")
    line=line.split(",")
    COUNTYdata.append(line)
cnt=0
for line in COUNTYdata:
    cnt=cnt+1
    if "<NAME>" in line[0] and "M" in line[1]:
        print(line)
filein.close()
filein = open("CountyData.data", "r").readlines()
for line in filein:
    print(line)

http://www.statsamerica.org/Covid19.aspx<jupyter_output><empty_output><jupyter_text>https://simplemaps.com/data/us-citiesGreat Resource: https://datausa.io/coronavirus<jupyter_code>import requests as req
response = req.get("https://www2.census.gov/programs-surveys/popest/datasets/2010-2019/counties/totals/co-est2019-alldata.csv")
alldata = response.text

cnt=0
ALLData =alldata.splitlines()
for line in ALLData:
    cnt=cnt+1
    if cnt<20:
        lines = line.split(",")
        print(lines[4:10])
!ls state-data/DATA<jupyter_output><empty_output><jupyter_text>Research<jupyter_code>https://covid19.colorado.gov/data/case-data
May 16th Colorado 1,192
https://www.denverpost.com/2020/05/11/castle-rock-restaurant-closed-coroanvirus-covid/
Info: Castle Rock restaurant opened to large Mother’s Day crowds,(May 11th)
    Castle Rock Restaurant is located in Douglas County, Colorado<jupyter_output><empty_output><jupyter_text>Monitor the Cases of COVID-19 in Douglas County, Colorado<jupyter_code>cnt=0
ALLData =alldata.splitlines()
for line in ALLData:
    lines = line.split(",")
    if lines[5] =="Colorado" and "Douglas" in lines[6]:
            print(lines[4:10])
            
    #print(lines[5],lines[6])        




"""
cnt = 0
for line in ALLData:
    cnt=cnt+1
    #if cnt == 1:print(line)
for i in range(0, len(ALLData)):
    #if ALLData[i][5] =="Douglas" and ALLData[i][6] =="Colorado":
    #   CNT==0
    #print(lines[4:10])
    print(ALLData[i][5],ALLData[i][6])   
"""    
cnt = 0
for line in ALLData:
    cnt=cnt+1
    #if cnt == 1:print(line)
for i in range(0, len(ALLData)):
    if ALLData[i][5] =="Ramsey" and ALLData[i][6] =="Minnesota":
        print(ALLData[i])
import requests as req
import time
DATE = time.strftime("%m-%d-%H_")

# Create an empty list
ALLdata=[]

URL ="https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_deaths_US.csv"

resp = req.get(URL)
content = resp.text

#clean the content, then break the content into lines 
content=content.replace(",,",",Ex,")
content=content.replace("(","")
content=content.replace(")","")
content=content.replace("\"","")
lines= content.splitlines()
print (len(lines))
# loop the lines one line at a time
# split each line at the delimiter ` , ` 
# then append the empty list 'ALLdata' with the line (which is now a list):  [line]  
for line in lines:
    #convert the splitlines to strings
    line= str(line).split(",")
    ALLdata.append(line)
cnt = 0
for line in ALLdata:
    cnt=cnt+1
    if cnt == 1:print(line)
for i in range(0, len(ALLdata)):
    if "Douglas" in ALLdata[i][5] and ALLdata[i][6] =="Colorado":
        print(ALLdata[i])
DATA="""Lane,SD,South Dakota,Jerauld,44.0697,-98.4246,59,49
Willow Lake,SD,South Dakota,Clark,44.6279,-97.6387,240,248
Montrose,SD,South Dakota,McCook,43.7002,-97.1843,442,414
Spearfish,SD,South Dakota,Lawrence,44.4912,-103.8167,12675,272
Emery,SD,South Dakota,Hanson,43.602,-97.6195,455,384
Watertown,SD,South Dakota,Codington,44.9094,-97.1532,21837,475
Buffalo,SD,South Dakota,Harding,45.5864,-103.5434,346,241"""


def getcnty(city,state):
    output = DATA.split("\n")
    for line in output:
        line = line.split(",")
        if city in line[0]:
            if state == line[1] or state in line[2]:
                County = line[3]
                return County
from CountyData import *
city = "Joplin"
state = "MO"
getcnty(city,state)
from CountyData import *
city = "Joplin"
state = "MO"
getlatitude(city,state)
import CountyData
text = CountyData.DATA
for lines in text.split("\n"):
    if "Loren" in lines:
        print(lines)<jupyter_output>San Lorenzo,NM,New Mexico,Grant,32.8086,-107.9221,158,34
Lorena,TX,Texas,McLennan,31.3818,-97.2127,1761,200
Lorenzo,TX,Texas,Crosby,33.6704,-101.5361,1182,478
Lorenzo,NE,Nebraska,Cheyenne,41.0576,-103.0821,18,1
Lorenz Park,NY,New York,Columbia,42.2669,-73.77,2213,478
San Lorenzo,CA,California,Alameda,37.6737,-122.1349,25101,3491
Jagual,PR,Puerto Rico,San Lorenzo,18.161,-65.9993,1216,2169
San Lorenzo,PR,Puerto Rico,San Lorenzo,18.1894,-65.9674,7984,2278
{'fraction_non_alphanumeric': 0.15620376241809342, 'fraction_numerical': 0.07905305432255337, 'mean_word_length': 4.580188679245283, 'pattern_counts': {'":': 3, '<': 18, '<?xml version=': 0, '>': 17, 'https://': 6, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '574879', 'license': 'CC0-1.0', 'n_tokens_mistral': 2029, 'n_tokens_neox': 1805, 'n_words': 358, 'path': '.ipynb_checkpoints/027-get-cities-and-counties-info-checkpoint.ipynb', 'repo_name': 'JupyterJones/Covid-19_Research_Notebooks', 'size': '4733'}