pavellakov commited on
Commit
8aa1a98
·
verified ·
1 Parent(s): a2a5b49

Upload 4 files

Browse files
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Simple Data Dashboard
3
+ emoji: 📊
4
+ colorFrom: purple
5
+ colorTo: blue
6
+ sdk: streamlit
7
+ python_version: 3.11
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+ # Simple Data Dashboard (Streamlit)
13
+
14
+ A lightweight Streamlit dashboard for exploring a CSV file: preview, summary stats, filtering, and a quick line chart.
15
+
16
+ ## Features
17
+ - Upload any `.csv` file
18
+ - Preview the first rows
19
+ - Summary statistics (`describe()`)
20
+ - Filter rows by selecting:
21
+ - a column
22
+ - a value from that column
23
+ - Generate a simple line chart using selected X and Y columns (on the filtered data)
24
+
25
+ ## Tech Stack
26
+ - Python
27
+ - Streamlit
28
+ - Pandas / NumPy
29
+ - Matplotlib (imported; Streamlit chart used for the plot)
30
+
31
+ ## Run Locally
32
+
33
+ ### 1) Create a virtual environment (recommended)
34
+ ```bash
35
+ python -m venv .venv
36
+ source .venv/bin/activate # macOS/Linux
37
+ # .venv\Scripts\activate # Windows
38
+ ```
39
+
40
+ ### 2) Install dependencies
41
+ ```bash
42
+ pip install streamlit pandas numpy matplotlib
43
+ ```
44
+
45
+ ### 3) Start the app
46
+ ```bash
47
+ streamlit run app.py
48
+ ```
49
+
50
+ Then open the local URL shown in the terminal (usually http://localhost:8501).
51
+
52
+ ## Project Structure (suggested for GitHub)
53
+ ```
54
+ simple-data-dashboard/
55
+ main.py
56
+ README.md
57
+ requirements.txt
58
+ ```
59
+
60
+ ### Example `requirements.txt`
61
+ ```txt
62
+ streamlit
63
+ pandas
64
+ numpy
65
+ matplotlib
66
+ ```
67
+
68
+ ## Tips
69
+ - For best results, pick numeric columns for the Y-axis.
70
+ - If your X column is not unique or not sorted, the line chart may look messy—try using an index-like column.
71
+
72
+ ## License
73
+ Add a license if you plan to publish publicly (MIT is common for small demo projects).
Sample_Data_for_Plotting_and_Filtering.csv ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Date,City,Temperature,Humidity,Wind Speed,Rainfall
2
+ 2023-01-01,Chicago,22.166129392299855,61.93649511543435,6.263552806187275,0
3
+ 2023-01-02,New York,13.28269599707907,61.28813196279497,4.748310171715538,0
4
+ 2023-01-03,Phoenix,28.870106264448683,55.40084471967545,12.64672909121614,15
5
+ 2023-01-04,New York,22.26673645955334,60.02155301041372,13.449880261249078,5
6
+ 2023-01-05,Phoenix,20.234445371198504,58.470538600275106,11.732904331803471,10
7
+ 2023-01-06,Phoenix,31.33665579234697,73.22960858860029,11.013979834091764,5
8
+ 2023-01-07,New York,18.662412530391666,61.94813576100409,14.205508268975656,0
9
+ 2023-01-08,Los Angeles,23.993583025399108,50.35632259306495,10.775298134363133,5
10
+ 2023-01-09,Los Angeles,30.96758045207047,56.74813678541643,10.153407777162691,10
11
+ 2023-01-10,New York,21.16968310509066,63.80235389649399,7.413056755597967,0
12
+ 2023-01-11,New York,17.47367936052598,54.14980316044958,10.63789409805333,0
13
+ 2023-01-12,Los Angeles,31.280418635733515,66.6828878135053,8.198707807351441,5
14
+ 2023-01-13,New York,31.490992131523196,48.434822409612046,11.853212676398881,5
15
+ 2023-01-14,New York,22.942918304361605,65.73014921627954,12.127231595268691,0
16
+ 2023-01-15,Chicago,28.81768593129745,52.15219303357924,7.945732342335329,0
17
+ 2023-01-16,Los Angeles,22.14476553231419,61.67428049932768,9.569584767845562,0
18
+ 2023-01-17,Chicago,19.58080530671381,66.2251383305259,7.819780214083182,0
19
+ 2023-01-18,Houston,20.426997424859877,71.28984033436139,8.07682315140769,0
20
+ 2023-01-19,Chicago,22.395663825903686,59.96197464292912,10.26472017937551,0
21
+ 2023-01-20,Houston,30.97874704797812,68.88669585374834,11.703986777985815,0
22
+ 2023-01-21,Phoenix,22.99196807212576,79.43967605534046,11.666510573744464,0
23
+ 2023-01-22,Chicago,23.284182805780343,47.90882188149915,8.893333928147973,15
24
+ 2023-01-23,Los Angeles,22.291572885076903,42.375944399930574,11.106956531028331,0
25
+ 2023-01-24,Phoenix,33.709239659202886,70.14491563570775,8.40391048067789,0
26
+ 2023-01-25,Los Angeles,20.452633838520413,64.33965768561997,13.324607129102878,0
27
+ 2023-01-26,Los Angeles,26.886885795616408,53.905601095495925,12.148040626901441,0
28
+ 2023-01-27,Los Angeles,28.998914598313505,57.68692733421215,7.5512139991588505,0
29
+ 2023-01-28,Los Angeles,23.83083565593751,59.7611883151882,7.5407522478819295,0
30
+ 2023-01-29,Los Angeles,22.310851601307775,57.40437344508312,11.561052594705895,0
31
+ 2023-01-30,Phoenix,29.71815206553181,60.625762009976874,7.51834217108585,0
32
+ 2023-01-31,Los Angeles,29.238100861368626,52.3334236028117,7.293771520140986,0
33
+ 2023-02-01,Chicago,23.8385638468339,69.05851849718222,11.602639117035668,0
34
+ 2023-02-02,New York,17.782895400605753,45.16463352800746,11.019408938016998,0
35
+ 2023-02-03,Los Angeles,24.794123287091082,64.67551340939997,10.303619550692627,0
36
+ 2023-02-04,Houston,20.67164606280725,53.818736345141566,10.055543945039776,0
37
+ 2023-02-05,Houston,29.7010690745091,41.93709129057614,11.872667348758739,0
38
+ 2023-02-06,Los Angeles,26.94574399012889,51.77333151743474,12.100174356560778,0
39
+ 2023-02-07,Houston,20.135175743290304,66.36530335801572,12.97230120199516,15
40
+ 2023-02-08,Los Angeles,23.236745088040166,58.51768491921674,8.009956733967968,5
41
+ 2023-02-09,New York,26.75400089514104,64.9076923886483,13.94509186199778,0
42
+ 2023-02-10,Phoenix,30.68764543809697,80.63395176253289,8.394657041421633,15
43
+ 2023-02-11,Chicago,25.46355698227373,63.22294622361077,12.066604748930153,15
44
+ 2023-02-12,Houston,34.39951107349792,56.87223318765508,7.767000734463014,15
45
+ 2023-02-13,Los Angeles,24.240931734183278,52.60866717840071,9.500639625690859,0
46
+ 2023-02-14,New York,25.326344179958895,43.33302161211304,8.669177994816867,10
47
+ 2023-02-15,Los Angeles,20.77278457116569,60.04031027022848,9.565296112183901,15
48
+ 2023-02-16,Chicago,23.501980363912956,79.65728136547257,11.920675317313803,10
49
+ 2023-02-17,Chicago,22.547292548883416,64.73623388107006,9.961108266082663,0
50
+ 2023-02-18,Phoenix,25.56224540247249,66.31800635621929,11.272388609701336,0
51
+ 2023-02-19,Los Angeles,28.212822934533012,57.93827852321966,11.504828336779882,15
52
+ 2023-02-20,Chicago,28.301615595357752,65.23157562806085,10.08508624080603,15
53
+ 2023-02-21,Phoenix,33.73484322901722,74.44898403643246,6.513940363482025,5
54
+ 2023-02-22,Houston,22.78180911012742,53.29443460382488,15.392267354121945,0
55
+ 2023-02-23,Houston,32.07897323204049,71.63634660575994,8.255667216375011,0
56
+ 2023-02-24,Phoenix,21.22041259233911,77.10642703209982,10.460364750225192,5
57
+ 2023-02-25,Los Angeles,25.6503143527392,60.92139960247888,12.132505662142243,0
58
+ 2023-02-26,New York,34.24099712743694,68.7837004732068,8.84557055289277,0
59
+ 2023-02-27,Chicago,35.58065798042077,68.33905835103783,14.941864894731824,0
60
+ 2023-02-28,Houston,21.38845886433065,68.05301655554507,9.249001706165522,0
61
+ 2023-03-01,Phoenix,18.57857662729868,59.26255276728639,10.303622087141614,0
62
+ 2023-03-02,New York,27.78318701225198,75.61540459894039,10.958971257293056,0
63
+ 2023-03-03,Chicago,24.47152037782313,50.42521677431462,11.697968652638677,0
64
+ 2023-03-04,Houston,27.588405714271182,58.752624079548234,10.647455406523102,0
65
+ 2023-03-05,Chicago,23.533103922608923,54.99527297092039,10.904307592373941,15
66
+ 2023-03-06,Phoenix,28.564312656429113,53.20408907690814,10.200492182569288,10
67
+ 2023-03-07,Chicago,27.7917361998388,58.906355159192266,6.716245358999711,0
68
+ 2023-03-08,Chicago,22.441171242102232,80.41147485067162,7.125539249868353,15
69
+ 2023-03-09,Houston,19.662075201330843,64.7528945092662,6.317799319900916,0
70
+ 2023-03-10,New York,28.377220845817558,45.39739987229625,5.8015538705551934,0
71
+ 2023-03-11,Houston,27.526170975614786,71.85159156750274,9.505319267975251,15
72
+ 2023-03-12,Phoenix,29.061579775144686,79.27619967810494,7.329337952008272,0
73
+ 2023-03-13,New York,23.63806175791413,60.220768147586,10.541685454334644,5
74
+ 2023-03-14,New York,26.26770313840215,83.21655780770479,12.006356591113322,5
75
+ 2023-03-15,New York,23.35267773301912,64.16326605674125,13.703430330699424,0
76
+ 2023-03-16,Phoenix,23.83070197379315,66.0287362937163,12.244086217554376,0
77
+ 2023-03-17,New York,25.090430451672155,69.45005417112255,14.626630301164898,15
78
+ 2023-03-18,Los Angeles,34.873641376500366,58.76625368939364,11.980980556408715,0
79
+ 2023-03-19,New York,30.210445236227862,64.61431184255107,7.866131920161983,0
80
+ 2023-03-20,Phoenix,19.599707616668006,75.97104741556748,9.395775217388408,0
81
+ 2023-03-21,Chicago,21.75049488123086,80.39886195936377,9.607555822694813,0
82
+ 2023-03-22,New York,29.91059714530647,50.50994096965006,10.422303580773212,0
83
+ 2023-03-23,New York,26.455171128310962,76.03147633033515,7.546982882381322,0
84
+ 2023-03-24,Chicago,15.957455901742826,67.11090512888892,11.576206664391158,0
85
+ 2023-03-25,Phoenix,26.14700808295791,71.89572153816914,8.7895068566723,0
86
+ 2023-03-26,New York,27.744313190879616,63.20562593901118,9.481859715768053,5
87
+ 2023-03-27,Los Angeles,32.94360947942622,54.213197906956545,8.278872646573639,10
88
+ 2023-03-28,Chicago,24.975941011468564,61.270415521266926,11.50733353108864,0
89
+ 2023-03-29,Chicago,27.643951058753494,63.35062805139001,11.583157035755496,0
90
+ 2023-03-30,Houston,28.59435160402138,59.17587401500882,7.49293046292792,5
91
+ 2023-03-31,Houston,25.72575894028392,66.46258041253938,14.393726138215694,5
92
+ 2023-04-01,Houston,24.110641334092605,58.0793768597286,11.83100373092753,0
93
+ 2023-04-02,Los Angeles,16.69740729390473,48.03296743437876,10.225476709069362,0
94
+ 2023-04-03,Houston,17.227302542667374,60.05814637466727,7.488556692918331,0
95
+ 2023-04-04,Houston,36.04913222418223,67.34925789163621,12.963234082417602,15
96
+ 2023-04-05,Houston,32.036685253925256,56.55480423871734,10.109569954844083,0
97
+ 2023-04-06,Los Angeles,20.082397909735096,59.873837547836345,10.571573823549521,15
98
+ 2023-04-07,Phoenix,27.1008842284662,64.19535224272846,11.590485895263871,10
99
+ 2023-04-08,New York,26.391347536661844,69.58923799480684,10.76989725341548,0
100
+ 2023-04-09,Phoenix,19.958756134172475,36.87321693983953,8.776450379876023,0
101
+ 2023-04-10,Phoenix,31.049389946342398,62.668237459485674,6.759175114472333,0
app.py ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ import streamlit as st
4
+ import pandas as pd
5
+ import numpy as np
6
+ import matplotlib.pyplot as plt
7
+ from streamlit import columns
8
+
9
+ st.title("Simple Data Dashboard")
10
+
11
+ uploaded_file = st.file_uploader("Choose a CSV File",type="csv")
12
+
13
+
14
+ if uploaded_file is not None:
15
+ df = pd.read_csv(uploaded_file)
16
+
17
+ st.subheader("Data Preview")
18
+ st.write(df.head())
19
+
20
+ st.subheader("Data Summary")
21
+ st.write(df.describe())
22
+
23
+ st.subheader("Filter Data")
24
+ columns = df.columns.tolist()
25
+ selected_column = st.selectbox("Select column to filter by", columns)
26
+ unique_values = df[selected_column].unique()
27
+ selected_value = st.selectbox("Select value", unique_values)
28
+
29
+ filtered_df = df[df[selected_column] == selected_value]
30
+ st.write(filtered_df)
31
+
32
+ st.subheader("Plot Data")
33
+ x_column = st.selectbox("Select x-axis column", columns)
34
+ y_column = st.selectbox("Select y-axis column", columns)
35
+
36
+ if st.button("Generate Plot"):
37
+ st.line_chart(filtered_df.set_index(x_column)[y_column])
38
+ else:
39
+ st.write("Waiting on file upload...")
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ streamlit
2
+ pandas
3
+ numpy
4
+ matplotlib