imranjamal commited on
Commit
7f77818
·
verified ·
1 Parent(s): 43ea16b

Upload visualization.py

Browse files
Files changed (1) hide show
  1. visualization.py +42 -0
visualization.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import matplotlib.pyplot as plt
4
+
5
+
6
+ st.title("CSV File Upload and Display")
7
+
8
+ # File uploader
9
+ uploaded_file = st.file_uploader("Upload a CSV file", type=["csv"])
10
+
11
+ if uploaded_file:
12
+ data = pd.read_csv(uploaded_file)
13
+ st.write("Line Chart Example:")
14
+ st.line_chart(data)
15
+ st.write("Bar Chart Example:")
16
+ st.bar_chart(data)
17
+
18
+ st.write("Custom Matplotlib Chart:")
19
+ fig, ax = plt.subplots()
20
+ ax.plot(data.iloc[:, 0], data.iloc[:, 1])
21
+ ax.set_title("Custom Line Plot")
22
+ st.pyplot(fig)
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+