awacke1 commited on
Commit
dbfa391
·
1 Parent(s): 3e50c29

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -19,8 +19,13 @@ if st.button('Regenerate Quotes'):
19
  quotes_random = quotes.sample(10)
20
  st.write(quotes_random)
21
 
22
- # Search textbox and button with the default value for the quote search to be courage
23
- search_term = st.text_input(label='Search Term', value='courage')
 
 
 
24
  if st.button('Search'):
25
- quotes_search = quotes[quotes['quote'].str.contains(search_term, case=False)].head(1000)
26
- st.write(quotes_search)
 
 
 
19
  quotes_random = quotes.sample(10)
20
  st.write(quotes_random)
21
 
22
+ #add three search buttons to search the dataframe columns
23
+ search_quote = st.text_input(label='Search Quote')
24
+ search_author = st.text_input(label='Search Author')
25
+ search_category = st.text_input(label='Search Category')
26
+
27
  if st.button('Search'):
28
+ quotes_search = quotes[quotes['quote'].str.contains(search_quote, case=False)]
29
+ quotes_search1 = quotes_search[quotes_search['author'].str.contains(search_author, case=False)]
30
+ quotes_search2 = quotes_search1[quotes_search1['category'].str.contains(search_category, case=False)].head(1000)
31
+ st.write(quotes_search2)