Umair Khan
commited on
Commit
·
f699a89
1
Parent(s):
591e14d
clean up preview
Browse files
app.py
CHANGED
|
@@ -67,10 +67,12 @@ def _summarize_columns(df, preview_max=VAR_PREVIEW_MAX):
|
|
| 67 |
s = df[col]
|
| 68 |
dtype = str(s.dtype)
|
| 69 |
ex = pd.Series(s.astype(object)).dropna().astype(str).head(preview_max).tolist()
|
| 70 |
-
preview = ", ".join(ex) if ex else "
|
| 71 |
-
if len(preview) >
|
| 72 |
preview = preview[:47] + "..."
|
| 73 |
-
|
|
|
|
|
|
|
| 74 |
choices.append((lbl, col))
|
| 75 |
return choices
|
| 76 |
|
|
|
|
| 67 |
s = df[col]
|
| 68 |
dtype = str(s.dtype)
|
| 69 |
ex = pd.Series(s.astype(object)).dropna().astype(str).head(preview_max).tolist()
|
| 70 |
+
preview = ", ".join(ex) if ex else "(no values)"
|
| 71 |
+
if len(preview) > 47:
|
| 72 |
preview = preview[:47] + "..."
|
| 73 |
+
elif preview != "(no values)":
|
| 74 |
+
preview = preview + "..."
|
| 75 |
+
lbl = f"{col} · {dtype} · {preview}"
|
| 76 |
choices.append((lbl, col))
|
| 77 |
return choices
|
| 78 |
|