valeriedaash commited on
Commit
07e5f8a
·
1 Parent(s): 0f49c06
Files changed (1) hide show
  1. main.py +19 -0
main.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import random
4
+
5
+ # Load your dataset
6
+ # Replace 'your_dataset.csv' with the actual filename or path
7
+ df = pd.read_csv('data.csv')
8
+
9
+ # Function to display 10 random rows on button click
10
+ def show_random_rows():
11
+ random_rows = df.sample(10)[['author', 'title']]
12
+ st.table(random_rows)
13
+
14
+ # Streamlit app
15
+ st.title('Book recommender app')
16
+
17
+ # Button to trigger displaying random rows
18
+ if st.button('Show some books'):
19
+ show_random_rows()