anujkarn commited on
Commit
2e4eaea
·
1 Parent(s): 1a10025

Fixed Related to logic

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -465,7 +465,8 @@ if st.session_state['parsed']:
465
  'LOC':'Non Political Location'})
466
 
467
  # Replace name with zeroth element of related to
468
- df_to_st['Name'] = df_to_st['Related to'].apply(lambda x : x[0])
 
469
 
470
  gb = GridOptionsBuilder.from_dataframe(df_to_st)
471
  gb.configure_pagination(paginationAutoPageSize=True) #Add pagination
 
465
  'LOC':'Non Political Location'})
466
 
467
  # Replace name with zeroth element of related to
468
+ if df_to_st['Related to'].any():
469
+ df_to_st['Name'] = df_to_st['Related to'].apply(lambda x : x[0])
470
 
471
  gb = GridOptionsBuilder.from_dataframe(df_to_st)
472
  gb.configure_pagination(paginationAutoPageSize=True) #Add pagination