ashcodes commited on
Commit
5cdf055
1 Parent(s): 183d39a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -53,8 +53,12 @@ def show_pdf(file_path):
53
  if input_pdf is not None:
54
  table = camelot.read_pdf('input.pdf', flavor='stream',split_text = True,layout_kwargs={'detect_vertical':True},backend='poppler')
55
  df = table[0].df
56
- df = pd.DataFrame(df)
57
- df = df.dropna(axis=1, thresh=int(len(df)*0.7),inplace=True)
 
 
 
 
58
 
59
  st.sidebar.markdown('Extract tables from PDF')
60
  if st.sidebar.button('Extract Table'):
 
53
  if input_pdf is not None:
54
  table = camelot.read_pdf('input.pdf', flavor='stream',split_text = True,layout_kwargs={'detect_vertical':True},backend='poppler')
55
  df = table[0].df
56
+ df = df.dropna(axis=1, thresh=int(len(df)*0.7),inplace=True)
57
+ for i in df.index:
58
+ if df['Alerted'][i]=='o':
59
+ df['Alerted'][i]='NO'
60
+ else:
61
+ df['Alerted'][i]='YES'
62
 
63
  st.sidebar.markdown('Extract tables from PDF')
64
  if st.sidebar.button('Extract Table'):