Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,8 @@ def filter_by_keyword(df, keyword):
|
|
18 |
return df[df.apply(lambda row: row.astype(str).str.contains(keyword).any(), axis=1)]
|
19 |
|
20 |
# Load the data
|
21 |
-
small_data = load_jsonl("
|
22 |
-
large_data = load_jsonl("
|
23 |
|
24 |
# Streamlit App
|
25 |
st.title("EDA with Plotly and Seaborn 📊")
|
@@ -34,9 +34,15 @@ if file_option == "small_file.jsonl":
|
|
34 |
else:
|
35 |
data = large_data
|
36 |
|
37 |
-
|
38 |
-
st.
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
# Plotly and Seaborn charts for EDA
|
42 |
if st.button("Generate Charts"):
|
@@ -88,4 +94,3 @@ if st.button("Generate Charts"):
|
|
88 |
fig, ax = plt.subplots()
|
89 |
sns.regplot(x=data.columns[0], y=data.columns[1], data=data)
|
90 |
st.pyplot(fig)
|
91 |
-
|
|
|
18 |
return df[df.apply(lambda row: row.astype(str).str.contains(keyword).any(), axis=1)]
|
19 |
|
20 |
# Load the data
|
21 |
+
small_data = load_jsonl("small_file.jsonl")
|
22 |
+
large_data = load_jsonl("large_file.jsonl")
|
23 |
|
24 |
# Streamlit App
|
25 |
st.title("EDA with Plotly and Seaborn 📊")
|
|
|
34 |
else:
|
35 |
data = large_data
|
36 |
|
37 |
+
# Text input for search keyword
|
38 |
+
search_keyword = st.text_input("Enter a keyword to filter data (e.g., Heart, Lung, Pain, Memory):")
|
39 |
+
|
40 |
+
# Button to trigger search
|
41 |
+
if st.button("Search"):
|
42 |
+
filtered_data = filter_by_keyword(data, search_keyword)
|
43 |
+
st.write(f"Filtered Dataset by '{search_keyword}'")
|
44 |
+
st.dataframe(filtered_data)
|
45 |
+
|
46 |
|
47 |
# Plotly and Seaborn charts for EDA
|
48 |
if st.button("Generate Charts"):
|
|
|
94 |
fig, ax = plt.subplots()
|
95 |
sns.regplot(x=data.columns[0], y=data.columns[1], data=data)
|
96 |
st.pyplot(fig)
|
|