Feliks Zaslavskiy commited on
Commit
c90e96d
1 Parent(s): 5919356
Files changed (1) hide show
  1. app.py +13 -4
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import streamlit as st
2
  import pandas as pd
 
3
 
4
  st.title('Excel File Uploader')
5
 
@@ -12,12 +13,20 @@ if uploaded_file is not None:
12
  data_caqh = pd.read_excel(uploaded_file, sheet_name='CAQH')
13
  data_ndb = pd.read_excel(uploaded_file, sheet_name='NDB')
14
 
15
- data_caqh['full-addr'] = data_caqh['address1'] + ', ' + data_caqh['address2'] + ', ' + data_caqh['city'] + ', '+ data_caqh['state']+ ', ' + data_caqh['postalcode']
 
 
 
 
16
 
17
- data_ndb['zip_cd_zip_pls_4_cd'] = data_ndb['zip_cd'].astype(str) + '-' + data_ndb['zip_pls_4_cd'].astype(str)
18
- 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])
19
 
20
- data_ndb['full-addr'] = data_ndb['adr_ln_1_txt'] + ', ' + data_ndb['st_cd'] + data_ndb['zip_cd_zip_pls_4_cd']
 
 
 
 
 
21
 
22
  st.dataframe(data_caqh)
23
  st.dataframe(data_ndb)
 
1
  import streamlit as st
2
  import pandas as pd
3
+ import numpy as np
4
 
5
  st.title('Excel File Uploader')
6
 
 
13
  data_caqh = pd.read_excel(uploaded_file, sheet_name='CAQH')
14
  data_ndb = pd.read_excel(uploaded_file, sheet_name='NDB')
15
 
16
+ data_caqh['full-addr'] = data_caqh['address1'].astype(str) + ', ' \
17
+ + np.where(data_caqh['address2'].isnull(), '' , data_caqh['address2'].astype(str)) \
18
+ + data_caqh['city'].astype(str) + ', '\
19
+ + data_caqh['state'].astype(str) + ', ' \
20
+ + data_caqh['postalcode'].astype(str)
21
 
22
+ 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 '')
 
23
 
24
+ data_ndb['zip_cd_zip_pls_4_cd'] = data_ndb['zip_cd'].astype(str) +\
25
+ np.where( data_ndb['zip_pls_4_cd'].isnull() , '', '-' \
26
+ + data_ndb['zip_pls_4_cd'].astype(str))
27
+
28
+ data_ndb['full-addr'] = data_ndb['adr_ln_1_txt'].astype(str) + ', ' \
29
+ + data_ndb['st_cd'].astype(str) + ', ' + data_ndb['zip_cd_zip_pls_4_cd']
30
 
31
  st.dataframe(data_caqh)
32
  st.dataframe(data_ndb)