Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,14 +78,14 @@ def convert_df(array):
|
|
| 78 |
|
| 79 |
@st.cache_data
|
| 80 |
def calculate_DK_value_frequencies(np_array):
|
| 81 |
-
unique, counts = np.unique(np_array[:
|
| 82 |
frequencies = counts / len(np_array) # Normalize by the number of rows
|
| 83 |
combined_array = np.column_stack((unique, frequencies))
|
| 84 |
return combined_array
|
| 85 |
|
| 86 |
@st.cache_data
|
| 87 |
def calculate_FD_value_frequencies(np_array):
|
| 88 |
-
unique, counts = np.unique(np_array[:
|
| 89 |
frequencies = counts / len(np_array) # Normalize by the number of rows
|
| 90 |
combined_array = np.column_stack((unique, frequencies))
|
| 91 |
return combined_array
|
|
@@ -144,7 +144,7 @@ with tab1:
|
|
| 144 |
st.session_state.working_seed = st.session_state.working_seed[np.isin(st.session_state.working_seed[:, 13], stack_var2)]
|
| 145 |
st.session_state.data_export_display = pd.DataFrame(st.session_state.working_seed[0:1000], columns=column_names)
|
| 146 |
|
| 147 |
-
|
| 148 |
|
| 149 |
elif site_var1 == 'Fanduel':
|
| 150 |
|
|
@@ -153,7 +153,7 @@ with tab1:
|
|
| 153 |
st.session_state.working_seed = st.session_state.working_seed[np.isin(st.session_state.working_seed[:, 12], stack_var2)]
|
| 154 |
st.session_state.data_export_display = pd.DataFrame(st.session_state.working_seed[0:1000], columns=column_names)
|
| 155 |
|
| 156 |
-
|
| 157 |
|
| 158 |
with st.container():
|
| 159 |
if 'data_export_display' in st.session_state:
|
|
|
|
| 78 |
|
| 79 |
@st.cache_data
|
| 80 |
def calculate_DK_value_frequencies(np_array):
|
| 81 |
+
unique, counts = np.unique(np_array[2:10], return_counts=True)
|
| 82 |
frequencies = counts / len(np_array) # Normalize by the number of rows
|
| 83 |
combined_array = np.column_stack((unique, frequencies))
|
| 84 |
return combined_array
|
| 85 |
|
| 86 |
@st.cache_data
|
| 87 |
def calculate_FD_value_frequencies(np_array):
|
| 88 |
+
unique, counts = np.unique(np_array[1:9], return_counts=True)
|
| 89 |
frequencies = counts / len(np_array) # Normalize by the number of rows
|
| 90 |
combined_array = np.column_stack((unique, frequencies))
|
| 91 |
return combined_array
|
|
|
|
| 144 |
st.session_state.working_seed = st.session_state.working_seed[np.isin(st.session_state.working_seed[:, 13], stack_var2)]
|
| 145 |
st.session_state.data_export_display = pd.DataFrame(st.session_state.working_seed[0:1000], columns=column_names)
|
| 146 |
|
| 147 |
+
st.session_state.data_export_freq = calculate_DK_value_frequencies(st.session_state.working_seed)
|
| 148 |
|
| 149 |
elif site_var1 == 'Fanduel':
|
| 150 |
|
|
|
|
| 153 |
st.session_state.working_seed = st.session_state.working_seed[np.isin(st.session_state.working_seed[:, 12], stack_var2)]
|
| 154 |
st.session_state.data_export_display = pd.DataFrame(st.session_state.working_seed[0:1000], columns=column_names)
|
| 155 |
|
| 156 |
+
st.session_state.data_export_freq = calculate_FD_value_frequencies(st.session_state.working_seed)
|
| 157 |
|
| 158 |
with st.container():
|
| 159 |
if 'data_export_display' in st.session_state:
|