felixz's picture
Update app.py
5919356
raw
history blame
958 Bytes
import streamlit as st
import pandas as pd
st.title('Excel File Uploader')
st.markdown('Upload an Excel file to view the data in a table.')
uploaded_file = st.file_uploader('Choose a file', type='xlsx')
if uploaded_file is not None:
data_caqh = pd.read_excel(uploaded_file, sheet_name='CAQH')
data_ndb = pd.read_excel(uploaded_file, sheet_name='NDB')
data_caqh['full-addr'] = data_caqh['address1'] + ', ' + data_caqh['address2'] + ', ' + data_caqh['city'] + ', '+ data_caqh['state']+ ', ' + data_caqh['postalcode']
data_ndb['zip_cd_zip_pls_4_cd'] = data_ndb['zip_cd'].astype(str) + '-' + data_ndb['zip_pls_4_cd'].astype(str)
data_ndb['zip_cd_zip_pls_4_cd'] = data_ndb['zip_cd_zip_pls_4_cd'].apply(lambda x: x if (x[-1] != '0' and x[-1] != '1') else x[:-1])
data_ndb['full-addr'] = data_ndb['adr_ln_1_txt'] + ', ' + data_ndb['st_cd'] + data_ndb['zip_cd_zip_pls_4_cd']
st.dataframe(data_caqh)
st.dataframe(data_ndb)