Mattral commited on
Commit
6db2cf3
·
verified ·
1 Parent(s): 4112189

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -161,11 +161,13 @@ def main():
161
  st.write(f"____________________")
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
 
161
  st.write(f"____________________")
162
  st.write()
163
 
164
+ if warehouse_df[warehouse_column].dtype != "object" and industry_df[industry_column].dtype != "object":
165
+
166
+ # Calculate correlation
167
+ correlation = warehouse_df[warehouse_column].corr(industry_df[industry_column])
168
+ st.header("Correlation")
169
+ st.write(f"The correlation between {warehouse_column} in warehouse item stocks and {industry_column} in industry item stocks is: {correlation}")
170
+ st.write()
171
 
172
 
173
  # Show correlation plot for each dataset