saherPervaiz commited on
Commit
3b208ee
·
verified ·
1 Parent(s): 50d5332

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -16
app.py CHANGED
@@ -77,23 +77,25 @@ if uploaded_file is not None:
77
  mime="text/csv"
78
  )
79
 
80
- # Correlation Heatmap
81
- st.subheader("Correlation Heatmap")
82
- st.write("Visualizing correlations between numeric features...")
83
- heatmap_plot = plot_correlation_heatmap(df_cleaned)
84
- st.pyplot(heatmap_plot)
85
-
86
- # Save and download heatmap as PNG
87
- heatmap_buffer = io.BytesIO()
88
- heatmap_plot.savefig(heatmap_buffer, format="png")
89
- heatmap_buffer.seek(0)
 
 
 
 
 
 
 
 
90
 
91
- st.download_button(
92
- label="Download Correlation Heatmap (PNG)",
93
- data=heatmap_buffer,
94
- file_name="correlation_heatmap.png",
95
- mime="image/png"
96
- )
97
 
98
  # Additional Visualizations
99
  st.subheader("Additional Visualizations")
 
77
  mime="text/csv"
78
  )
79
 
80
+ # Correlation Heatmap
81
+ st.subheader("Correlation Heatmap")
82
+ st.write("Visualizing correlations between numeric features...")
83
+ heatmap_plot = plot_correlation_heatmap(df_cleaned)
84
+ st.pyplot(heatmap_plot)
85
+
86
+ # Save and download heatmap as PNG
87
+ heatmap_buffer = io.BytesIO()
88
+ fig = plt.gcf() # Get the current figure
89
+ fig.savefig(heatmap_buffer, format="png") # Save the figure to the buffer
90
+ heatmap_buffer.seek(0)
91
+
92
+ st.download_button(
93
+ label="Download Correlation Heatmap (PNG)",
94
+ data=heatmap_buffer,
95
+ file_name="correlation_heatmap.png",
96
+ mime="image/png"
97
+ )
98
 
 
 
 
 
 
 
99
 
100
  # Additional Visualizations
101
  st.subheader("Additional Visualizations")