awacke1 commited on
Commit
4c7a0d0
·
1 Parent(s): de8b7b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -2
app.py CHANGED
@@ -1,11 +1,29 @@
1
  import streamlit as st
2
-
3
  import pandas as pd
4
  import numpy as np
5
  import altair as alt
6
  import pydeck as pdk
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
- import streamlit as st
9
 
10
  # callback to update query param on selectbox change
11
  def update_params():
 
1
  import streamlit as st
 
2
  import pandas as pd
3
  import numpy as np
4
  import altair as alt
5
  import pydeck as pdk
6
+ import random
7
+
8
+
9
+ def build_dataframe(rows_count=100):
10
+ """
11
+ Creates columns with random data.
12
+ """
13
+ data = {
14
+ 'impressions': np.random.randint(low=111, high=10000, size=rows_count),
15
+ 'clicks': np.random.randint(low=0, high=1000, size=rows_count),
16
+ 'customer': random.choices(['ShirtsInc', 'ShoesCom'], k=rows_count)
17
+ }
18
+ df = pd.DataFrame(data)
19
+ # add a date column and calculate the weekday of each row
20
+ df['date'] = pd.date_range(start='05/25/2022', periods=rows_count)
21
+ return df
22
+
23
+ data_df = build_dataframe()
24
+ st.title('Streamlit routing dashboard')
25
+ st.dataframe(data_df)
26
 
 
27
 
28
  # callback to update query param on selectbox change
29
  def update_params():