Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -162,23 +162,22 @@ def main():
|
|
162 |
st.write()
|
163 |
|
164 |
# Calculate correlation
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
st.write()
|
170 |
|
171 |
|
172 |
-
|
173 |
-
|
174 |
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
|
183 |
if __name__ == "__main__":
|
184 |
main()
|
|
|
162 |
st.write()
|
163 |
|
164 |
# Calculate correlation
|
165 |
+
correlation = warehouse_df[warehouse_column].corr(industry_df[industry_column])
|
166 |
+
st.header("Correlation")
|
167 |
+
st.write(f"The correlation between {warehouse_column} in warehouse item stocks and {industry_column} in industry item stocks is: {correlation}")
|
168 |
+
st.write()
|
|
|
169 |
|
170 |
|
171 |
+
# Show correlation plot for each dataset
|
172 |
+
if st.button("Correlation for each dataset"):
|
173 |
|
174 |
+
st.subheader("Correlation Plot for Warehouse Dataset")
|
175 |
+
warehouse_corr_plot = plot_correlation(warehouse_df, warehouse_column)
|
176 |
+
st.pyplot(warehouse_corr_plot)
|
177 |
|
178 |
+
st.subheader("Correlation Plot for Industry Dataset")
|
179 |
+
industry_corr_plot = plot_correlation(industry_df, industry_column)
|
180 |
+
st.pyplot(industry_corr_plot)
|
181 |
|
182 |
if __name__ == "__main__":
|
183 |
main()
|