Spaces:
Sleeping
Sleeping
File size: 2,487 Bytes
2bab301 4d84794 9473f6e 03e560e 9473f6e 03e560e 2bab301 |
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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
import streamlit as st
import pandas as pd
import numpy as np
import yfinance as yf
import altair as alt
import plotly.figure_factory as ff
import pydeck as pdk
from vega_datasets import data as vds
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
from streamlit_image_comparison import image_comparison
def on_input_change():
user_input = st.session_state.user_input
st.session_state.past.append(user_input)
st.session_state.generated.append(
{"data": "The messages from Bot\nWith new line", "type": "normal"}
)
def on_btn_click():
del st.session_state.past[:]
del st.session_state.generated[:]
def main():
st.title(" Stock Forecasting App")
uploaded_file = st.file_uploader("Choose a file", type=["jpg", "png", "mp3"])
value = st.slider(
" Select Horizon Period", min_value=0, max_value=100, value=50, key=74
)
value = st.slider(" Folds", min_value=0, max_value=100, value=50, key=95)
if st.button(" start"):
st.write("Button clicked!")
st.title(" Training")
(
col1,
col2,
) = st.columns(2)
with col1:
st.table(
{
"Country": ["USA", "Canada", "UK", "Australia"],
"Population (millions)": [331, 38, 66, 25],
"GDP (trillion USD)": [22.675, 1.843, 2.855, 1.488],
}
)
with col2:
data = {"key": "value", "name": "John Doe", "age": 30}
st.json(data)
st.title(" Forecast")
(
col1,
col2,
) = st.columns(2)
with col1:
st.line_chart(
pd.DataFrame(
{
"Apple": yf.download("AAPL", start="2023-01-01", end="2023-07-31")[
"Adj Close"
],
"Google": yf.download(
"GOOGL", start="2023-01-01", end="2023-07-31"
)["Adj Close"],
"Microsoft": yf.download(
"MSFT", start="2023-01-01", end="2023-07-31"
)["Adj Close"],
}
)
)
with col2:
data = pd.DataFrame(
{"X": [1, 2, 3, 4, 5], "Y1": [10, 16, 8, 14, 12], "Y2": [5, 8, 3, 6, 7]}
)
st.area_chart(data)
st.bar_chart(
pd.DataFrame(np.random.randn(20, 3), columns=["Apple", "Banana", "Cherry"])
)
if __name__ == "__main__":
main()
|