Spaces:
Sleeping
Sleeping
import streamlit as st | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# μ λͺ© | |
st.title("Hugging Faceμ Streamlitμ μ¬μ©ν μ ν리μΌμ΄μ ") | |
# ν μ€νΈ μ λ ₯ | |
user_input = st.text_input("ν μ€νΈλ₯Ό μ λ ₯νμΈμ:", "Streamlitμ μ λ§ λ©μ Έμ!") | |
# μ«μ μ λ ₯ | |
number_input = st.number_input("μ«μλ₯Ό μ λ ₯νμΈμ:", min_value=0.0, max_value=100.0, value=50.0) | |
# μ¬λΌμ΄λ | |
slider_input = st.slider("μ¬λΌμ΄λλ‘ μ«μλ₯Ό μ ννμΈμ:", 0, 100, 25) | |
# νμΌ μ λ‘λ | |
uploaded_file = st.file_uploader("νμΌμ μ λ‘λνμΈμ:", type=["csv", "txt"]) | |
# 체ν¬λ°μ€ | |
if st.checkbox("체ν¬λ°μ€λ₯Ό μ ννμΈμ:"): | |
st.write("체ν¬λ°μ€κ° μ νλμμ΅λλ€!") | |
# λΌλμ€ λ²νΌ | |
radio_choice = st.radio("λΌλμ€ λ²νΌμ μ ννμΈμ:", ("μ΅μ 1", "μ΅μ 2", "μ΅μ 3")) | |
st.write(f"λΉμ μ {radio_choice}μ μ ννμ΅λλ€.") | |
# μ λ νΈλ°μ€ | |
option = st.selectbox("μ λ νΈλ°μ€μμ μ΅μ μ μ ννμΈμ:", ("μ΅μ A", "μ΅μ B", "μ΅μ C")) | |
st.write(f"λΉμ μ {option}μ μ ννμ΅λλ€.") | |
# λ©ν°μ λ νΈ | |
options = st.multiselect("λ©ν°μ λ νΈμμ μ¬λ¬ μ΅μ μ μ ννμΈμ:", ["μ΅μ 1", "μ΅μ 2", "μ΅μ 3", "μ΅μ 4"]) | |
st.write("λΉμ μ ", options, "μ μ ννμ΅λλ€.") | |
# λ²νΌ | |
if st.button("ν΄λ¦νμΈμ!"): | |
st.write("λ²νΌμ΄ ν΄λ¦λμμ΅λλ€!") | |
# λ°μ΄ν° μκ°ν | |
st.subheader("κ°λ¨ν μ°¨νΈ:") | |
# 무μμ λ°μ΄ν° μμ± | |
data = np.random.randn(100) | |
# matplotlibλ₯Ό μ¬μ©ν μ°¨νΈ | |
fig, ax = plt.subplots() | |
ax.hist(data, bins=20) | |
st.pyplot(fig) | |