Spaces:
Sleeping
Sleeping
File size: 1,010 Bytes
a76c6ff b7addcc a76c6ff b7addcc a76c6ff b7addcc a76c6ff b7addcc a76c6ff b7addcc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
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)") |