Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
#
|
23 |
-
|
|
|
|
|
|
|
24 |
if st.button('Search'):
|
25 |
-
quotes_search = quotes[quotes['quote'].str.contains(
|
26 |
-
|
|
|
|
|
|
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)
|