Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Dec 27, 2023
1 parent 7298205 commit 7a995d9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions fetch_physicians.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# %%
import camelot
import pandas as pd
import numpy as np
import pandas as pd

url = "https://cpsa.ca/MedicalDirectory/Alphabetical%20Listing.pdf"
tables = camelot.read_pdf(url, pages="all", flavor="stream")
Expand All @@ -28,13 +28,10 @@ def process(tdf):
df = df[~df.apply(lambda row: row.isna().sum() == 4, axis=1)]
df = df.reset_index(drop=True)
for ind in df[df.apply(lambda row: row.isna().sum() == 3, axis=1)].index:

if df.loc[ind]["CITY"] is not np.nan:

df.loc[ind - 1]["CITY"] += f' {df.loc[ind]["CITY"]}'

if df.loc[ind]["NAME"] is not np.nan:

df.loc[ind - 1]["NAME"] += f' {df.loc[ind]["NAME"]}'
df = df[~df.apply(lambda row: row.isna().sum() == 3, axis=1)]
return df
Expand Down
1 change: 0 additions & 1 deletion fetch_ratemds.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from seleniumbase import SB
from tqdm import tqdm


df = pd.read_csv("physicians.csv")


Expand Down
1 change: 0 additions & 1 deletion streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import plotly.express as px
import streamlit as st


st.set_page_config(page_title="ab-physicians", page_icon=":mask:")
_, center, _ = st.columns([2, 1, 2])
with center:
Expand Down

0 comments on commit 7a995d9

Please sign in to comment.