update TRX calculation to reset per BSC+BCF and count in btsId order
Browse files
queries/process_ciq_2g.py
CHANGED
|
@@ -627,9 +627,10 @@ def _build_trx_sheet_from_assigned_sites(
|
|
| 627 |
ordered_cols.append(f"channel{i}Type")
|
| 628 |
|
| 629 |
df_trx = df_trx.sort_values(
|
| 630 |
-
by=["
|
| 631 |
)
|
| 632 |
-
|
|
|
|
| 633 |
df_trx = df_trx[ordered_cols]
|
| 634 |
return df_trx
|
| 635 |
|
|
|
|
| 627 |
ordered_cols.append(f"channel{i}Type")
|
| 628 |
|
| 629 |
df_trx = df_trx.sort_values(
|
| 630 |
+
by=["bscid", "bcfId", "btsId", "_sort_type", "_sort_maio"], kind="stable"
|
| 631 |
)
|
| 632 |
+
# Reset TRX per BSC+BCF and count in btsId order.
|
| 633 |
+
df_trx["TRX"] = df_trx.groupby(["bscid", "bcfId"], sort=False).cumcount() + 1
|
| 634 |
df_trx = df_trx[ordered_cols]
|
| 635 |
return df_trx
|
| 636 |
|