STD testing site lookup


In [1]:
import pandas as pd
import pickle
import numpy as np

In [84]:
df_sites = pd.read_csv("../data/testingsites.csv")

In [88]:
df_sites.dtypes


Out[88]:
zipcode     int64
name       object
dtype: object

In [89]:
zipcode = "02118"

In [90]:
clinic = df_sites[df_sites["zipcode"]==int(zipcode)].name.str.lstrip().str.rstrip().values

In [91]:
if len(clinic):
    words = clinic[0].split()
else:
    words = "free STD testing near"
    words = words.split()

In [92]:
words


Out[92]:
['Boston', 'Medical', 'Center']

In [93]:
len(words)
for word in np.arange(len(words)):
    if word == 0:
        sentence = words[0]
    else:
        sentence = sentence + "+" + words[word]

In [94]:
sentence


Out[94]:
'Boston+Medical+Center'

In [ ]: