File size: 1,386 Bytes
f51e197
 
c90e96d
f51e197
 
 
 
 
 
 
b1a0d5b
f51e197
b1a0d5b
 
d38ab04
c90e96d
 
 
 
 
d38ab04
c90e96d
d38ab04
c90e96d
 
 
 
 
 
d38ab04
b1a0d5b
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import streamlit as st
import pandas as pd
import numpy as np

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'].astype(str) + ', ' \
                             + np.where(data_caqh['address2'].isnull(),  '' , data_caqh['address2'].astype(str))  \
                             + data_caqh['city'].astype(str) + ', '\
                             + data_caqh['state'].astype(str) + ', ' \
                             + data_caqh['postalcode'].astype(str)

    data_ndb['zip_pls_4_cd'] = data_ndb['zip_pls_4_cd'].astype(str).apply(lambda x: x if (x[-1] != '0' and x[-1] != '1') else '')

    data_ndb['zip_cd_zip_pls_4_cd'] = data_ndb['zip_cd'].astype(str) +\
                                      np.where( data_ndb['zip_pls_4_cd'].isnull() , '', '-' \
                                      + data_ndb['zip_pls_4_cd'].astype(str))

    data_ndb['full-addr'] = data_ndb['adr_ln_1_txt'].astype(str) + ', ' \
                            + data_ndb['st_cd'].astype(str) + ', ' + data_ndb['zip_cd_zip_pls_4_cd']

    st.dataframe(data_caqh)
    st.dataframe(data_ndb)