lynn-twinkl
commited on
Commit
·
df474fc
1
Parent(s):
1a2ef50
Added id col to shortlist preview
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ from streamlit_extras.metric_cards import style_metric_cards
|
|
| 12 |
|
| 13 |
from functions.extract_usage import extract_usage
|
| 14 |
from functions.necessity_index import compute_necessity, index_scaler, qcut_labels
|
| 15 |
-
from functions.column_detection import
|
| 16 |
from functions.shortlist import shortlist_applications
|
| 17 |
import typing
|
| 18 |
|
|
@@ -29,7 +29,7 @@ def load_and_process(raw_csv: bytes) -> typing.Tuple[pd.DataFrame, str]:
|
|
| 29 |
# Read Uploaded Data
|
| 30 |
df_orig = pd.read_csv(BytesIO(raw_csv))
|
| 31 |
# Detect freeform column
|
| 32 |
-
freeform_col =
|
| 33 |
|
| 34 |
#Word Count
|
| 35 |
df_orig['word_count'] = df_orig[freeform_col].fillna('').str.split().str.len()
|
|
@@ -115,6 +115,7 @@ if uploaded_file is not None:
|
|
| 115 |
mode_col.metric("Mode", mode)
|
| 116 |
|
| 117 |
shorltist_cols_to_show = [
|
|
|
|
| 118 |
freeform_col,
|
| 119 |
'Usage',
|
| 120 |
'necessity_index',
|
|
|
|
| 12 |
|
| 13 |
from functions.extract_usage import extract_usage
|
| 14 |
from functions.necessity_index import compute_necessity, index_scaler, qcut_labels
|
| 15 |
+
from functions.column_detection import detect_freeform_col
|
| 16 |
from functions.shortlist import shortlist_applications
|
| 17 |
import typing
|
| 18 |
|
|
|
|
| 29 |
# Read Uploaded Data
|
| 30 |
df_orig = pd.read_csv(BytesIO(raw_csv))
|
| 31 |
# Detect freeform column
|
| 32 |
+
freeform_col = detect_freeform_col(df_orig)
|
| 33 |
|
| 34 |
#Word Count
|
| 35 |
df_orig['word_count'] = df_orig[freeform_col].fillna('').str.split().str.len()
|
|
|
|
| 115 |
mode_col.metric("Mode", mode)
|
| 116 |
|
| 117 |
shorltist_cols_to_show = [
|
| 118 |
+
'Id',
|
| 119 |
freeform_col,
|
| 120 |
'Usage',
|
| 121 |
'necessity_index',
|