-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain_Page.py
61 lines (37 loc) · 1.31 KB
/
Main_Page.py
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
import streamlit as st
import pandas as pd
import time
import requests
from streamlit_lottie import st_lottie
from streamlit_lottie import st_lottie_spinner
import json
import streamlit.components.v1 as components
st.set_page_config(
page_title="Multipage App",
)
@st.cache()
def load_lottiefile(filepath: str):
with open(filepath, "r") as f:
return json.load(f)
lottie_url_hello = "https://assets5.lottiefiles.com/packages/lf20_V9t630.json"
lottie_url_download = "https://assets4.lottiefiles.com/private_files/lf30_t26law.json"
lottie_ny = load_lottiefile("./90724-travel-world-usa.json")
lottie_uber = load_lottiefile("./34273-mercedes.json")
st.sidebar.success("Select a page above")
st.markdown("<h1 style='text-align: center; color: white;'>TP3 STREAMLIT</h1>", unsafe_allow_html=True)
df_ny = pd.read_csv("/Users/zappy/Downloads/OneDrive_1_14-09-2022/ny-trips-data.csv")
df_tips=pd.read_csv("/Users/zappy/Downloads/OneDrive_1_14-09-2022/tips.csv", delimiter=";")
col1, col2 = st.columns(2)
with col1:
st_lottie(lottie_ny, key="1")
with col2:
st_lottie(lottie_uber, key="2")
st.markdown("***")
col1, col2 = st.columns(2)
with col1:
st.title("ny")
st.dataframe(df_ny)
with col2:
st.title("tips")
st.dataframe(df_tips)
st.write("Please choose one of the TP in the sidebar")