find_my_book / app.py
valeriedaash's picture
init
7c84120
raw
history blame
475 Bytes
import streamlit as st
import pandas as pd
import random
# Load your dataset
# Replace 'your_dataset.csv' with the actual filename or path
df = pd.read_csv('data.csv')
# Function to display 10 random rows on button click
def show_random_rows():
random_rows = df.sample(10)[['author', 'title']]
st.table(random_rows)
# Streamlit app
st.title('Book recommender app')
# Button to trigger displaying random rows
if st.button('Show some books'):
show_random_rows()