replace CODE by code
Browse files- queries/process_invunit.py +5 -5
- queries/process_mrbts.py +3 -3
queries/process_invunit.py
CHANGED
|
@@ -45,7 +45,7 @@ def process_invunit_data(file_path: str) -> pd.DataFrame:
|
|
| 45 |
df_invunit.columns = df_invunit.columns.str.replace(r"[ ]", "", regex=True)
|
| 46 |
|
| 47 |
df_invunit = df_invunit[df_invunit["MRBTS"].apply(lambda x: str(x).isnumeric())]
|
| 48 |
-
df_invunit["
|
| 49 |
df_invunit = df_invunit[["MRBTS", "inventoryUnitType"]]
|
| 50 |
|
| 51 |
df_invunit = (
|
|
@@ -74,12 +74,12 @@ def process_invunit_data(file_path: str) -> pd.DataFrame:
|
|
| 74 |
}
|
| 75 |
)
|
| 76 |
df_invunit = create_invunit_summary(df_invunit)
|
| 77 |
-
df_invunit["
|
| 78 |
-
df_invunit = df_invunit[["MRBTS", "
|
| 79 |
# df_invunit = df_invunit.sort_values(
|
| 80 |
-
# by=["MRBTS", "
|
| 81 |
# )
|
| 82 |
-
# df_invunit["MRBTS_NUM"] = df_invunit.groupby("
|
| 83 |
# df_invunit["MRBTS_NUM"] = "MRBTS_" + df_invunit["MRBTS_NUM"].astype(str)
|
| 84 |
|
| 85 |
UtilsVars.all_db_dfs.append(df_invunit)
|
|
|
|
| 45 |
df_invunit.columns = df_invunit.columns.str.replace(r"[ ]", "", regex=True)
|
| 46 |
|
| 47 |
df_invunit = df_invunit[df_invunit["MRBTS"].apply(lambda x: str(x).isnumeric())]
|
| 48 |
+
df_invunit["code"] = df_invunit["MRBTS"].apply(extract_code_from_mrbts)
|
| 49 |
df_invunit = df_invunit[["MRBTS", "inventoryUnitType"]]
|
| 50 |
|
| 51 |
df_invunit = (
|
|
|
|
| 74 |
}
|
| 75 |
)
|
| 76 |
df_invunit = create_invunit_summary(df_invunit)
|
| 77 |
+
df_invunit["code"] = df_invunit["MRBTS"].apply(extract_code_from_mrbts)
|
| 78 |
+
df_invunit = df_invunit[["MRBTS", "code", "invunit_summary"]]
|
| 79 |
# df_invunit = df_invunit.sort_values(
|
| 80 |
+
# by=["MRBTS", "code"],
|
| 81 |
# )
|
| 82 |
+
# df_invunit["MRBTS_NUM"] = df_invunit.groupby("code").cumcount() + 1
|
| 83 |
# df_invunit["MRBTS_NUM"] = "MRBTS_" + df_invunit["MRBTS_NUM"].astype(str)
|
| 84 |
|
| 85 |
UtilsVars.all_db_dfs.append(df_invunit)
|
queries/process_mrbts.py
CHANGED
|
@@ -24,10 +24,10 @@ def process_mrbts_data(file_path: str) -> pd.DataFrame:
|
|
| 24 |
|
| 25 |
# Create an explicit copy of the filtered DataFrame to avoid SettingWithCopyWarning
|
| 26 |
df_mrbts = df_mrbts[df_mrbts["MRBTS"].apply(lambda x: str(x).isnumeric())].copy()
|
| 27 |
-
|
| 28 |
# Now use .loc to set values in the DataFrame
|
| 29 |
-
df_mrbts.loc[:, "
|
| 30 |
-
df_mrbts = df_mrbts[["MRBTS", "
|
| 31 |
|
| 32 |
UtilsVars.all_db_dfs.append(df_mrbts)
|
| 33 |
UtilsVars.all_db_dfs_names.append("MRBTS")
|
|
|
|
| 24 |
|
| 25 |
# Create an explicit copy of the filtered DataFrame to avoid SettingWithCopyWarning
|
| 26 |
df_mrbts = df_mrbts[df_mrbts["MRBTS"].apply(lambda x: str(x).isnumeric())].copy()
|
| 27 |
+
|
| 28 |
# Now use .loc to set values in the DataFrame
|
| 29 |
+
df_mrbts.loc[:, "code"] = df_mrbts["MRBTS"].apply(extract_code_from_mrbts)
|
| 30 |
+
df_mrbts = df_mrbts[["MRBTS", "code", "name", "btsName"]]
|
| 31 |
|
| 32 |
UtilsVars.all_db_dfs.append(df_mrbts)
|
| 33 |
UtilsVars.all_db_dfs_names.append("MRBTS")
|