Spaces:
Sleeping
Sleeping
import streamlit as st | |
import pandas as pd | |
import numpy as np | |
st.set_page_config(layout="wide") | |
# Custom CSS for larger font | |
st.markdown(""" | |
<style> | |
.stDataFrame { | |
font-size: 20px; | |
} | |
.stMarkdown { | |
font-size: 24px; | |
} | |
</style> | |
""", unsafe_allow_html=True) | |
# Load dataset | |
def load_data(): | |
return pd.read_csv('https://raw.githubusercontent.com/manann/quotes-500k/main/quotes.csv', index_col=0) | |
quotes_data = load_data() | |
# Sidebar | |
st.sidebar.title("π Refresh") | |
if st.sidebar.button("π² New Quotes"): | |
st.rerun() | |
# Main content | |
st.title("π Famous Quotes Generator") | |
st.write("π Here are 10 random famous quotes!") | |
# Generate random list | |
random_list = np.random.choice(quotes_data.index.values, 10, replace=False) | |
random_quotes = quotes_data.loc[random_list] | |
# Display random list | |
st.dataframe(random_quotes[['quote', 'author']], use_container_width=True) | |
st.markdown("π Source: [Kaggle - Quotes 500k](https://www.kaggle.com/datasets/manann/quotes-500k)") |