Spaces:
Runtime error
Runtime error
Commit
·
b28d92a
1
Parent(s):
5e75d35
Update app.py
Browse files
app.py
CHANGED
@@ -110,39 +110,6 @@ if QueryDatabase:
|
|
110 |
|
111 |
st.title("File Upload and Profiling")
|
112 |
|
113 |
-
# uploaded_file = st.file_uploader("Upload a CSV file", type="csv")
|
114 |
-
|
115 |
-
RunProfiler=False
|
116 |
-
if uploaded_file is not None:
|
117 |
-
if RunProfiler:
|
118 |
-
|
119 |
-
# Load the data using pandas
|
120 |
-
df = pd.read_csv(uploaded_file)
|
121 |
-
|
122 |
-
# Generate the pandas profiling report
|
123 |
-
profile = ProfileReport(df, explorative=True)
|
124 |
-
|
125 |
-
# Display the pandas profiling report using streamlit
|
126 |
-
st.header("Data Profiling Report")
|
127 |
-
st.write(profile.to_html(), unsafe_allow_html=True)
|
128 |
-
|
129 |
-
# Display word statistics for each categorical string column
|
130 |
-
cat_cols = df.select_dtypes(include='object').columns
|
131 |
-
st.header("Word Statistics for Categorical Columns")
|
132 |
-
for col in cat_cols:
|
133 |
-
st.subheader(col)
|
134 |
-
word_count = df[col].str.split().apply(len).value_counts().sort_index()
|
135 |
-
st.bar_chart(word_count)
|
136 |
-
|
137 |
-
# Grouped count by each feature
|
138 |
-
num_cols = df.select_dtypes(include=['float', 'int']).columns
|
139 |
-
st.header("Grouped Count by Each Feature")
|
140 |
-
for col in num_cols:
|
141 |
-
st.subheader(col)
|
142 |
-
count_by_feature = df.groupby(col).size().reset_index(name='count')
|
143 |
-
st.bar_chart(count_by_feature)
|
144 |
-
|
145 |
-
|
146 |
# Upload a CSV dataset
|
147 |
uploaded_file = st.file_uploader("Upload your dataset", type=["csv"])
|
148 |
if uploaded_file is not None:
|
|
|
110 |
|
111 |
st.title("File Upload and Profiling")
|
112 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
# Upload a CSV dataset
|
114 |
uploaded_file = st.file_uploader("Upload your dataset", type=["csv"])
|
115 |
if uploaded_file is not None:
|