Update app.py
Browse files
app.py
CHANGED
|
@@ -364,24 +364,36 @@ def unified_search(bs, bv, bc, cs, cv, cc):
|
|
| 364 |
how="outer"
|
| 365 |
)
|
| 366 |
|
| 367 |
-
# NaN
|
| 368 |
merged = merged.fillna("")
|
| 369 |
-
|
| 370 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
merged[[base_col, comp_col]] = merged.apply(
|
| 372 |
lambda row: apply_diff_row(row, base_col, comp_col),
|
| 373 |
axis=1
|
| 374 |
)
|
| 375 |
-
|
| 376 |
-
#
|
| 377 |
-
merged["
|
| 378 |
merged[base_sec] != "", merged[comp_sec]
|
| 379 |
)
|
| 380 |
-
|
|
|
|
| 381 |
merged = merged.sort_values(
|
| 382 |
-
by="
|
| 383 |
key=lambda col: col.map(natural_sort_key)
|
| 384 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
|
| 386 |
return merged
|
| 387 |
|
|
|
|
| 364 |
how="outer"
|
| 365 |
)
|
| 366 |
|
| 367 |
+
# NaN โ ""
|
| 368 |
merged = merged.fillna("")
|
| 369 |
+
|
| 370 |
+
# ๐ฅ section ์ ๊ทํ
|
| 371 |
+
merged[base_sec] = merged[base_sec].astype(str).str.strip()
|
| 372 |
+
merged[comp_sec] = merged[comp_sec].astype(str).str.strip()
|
| 373 |
+
|
| 374 |
+
# ๐ฅ diff ์ ์ฉ
|
| 375 |
merged[[base_col, comp_col]] = merged.apply(
|
| 376 |
lambda row: apply_diff_row(row, base_col, comp_col),
|
| 377 |
axis=1
|
| 378 |
)
|
| 379 |
+
|
| 380 |
+
# ๐ฅ Section ํตํฉ (ํต์ฌ)
|
| 381 |
+
merged["Section"] = merged[base_sec].where(
|
| 382 |
merged[base_sec] != "", merged[comp_sec]
|
| 383 |
)
|
| 384 |
+
|
| 385 |
+
# ๐ฅ ์ ๋ ฌ ๊ธฐ์ค๋ ํตํฉ๋ section ๊ธฐ์ค
|
| 386 |
merged = merged.sort_values(
|
| 387 |
+
by="Section",
|
| 388 |
key=lambda col: col.map(natural_sort_key)
|
| 389 |
+
)
|
| 390 |
+
|
| 391 |
+
# ๐ฅ ์ต์ข
์ปฌ๋ผ ๊ตฌ์ฑ
|
| 392 |
+
merged = merged[[
|
| 393 |
+
"Section",
|
| 394 |
+
base_col,
|
| 395 |
+
comp_col
|
| 396 |
+
]]
|
| 397 |
|
| 398 |
return merged
|
| 399 |
|