https://github.com/shrunga92/5g_qos_data_transformation_python
Resource Allocation in 5G Network Service
https://github.com/shrunga92/5g_qos_data_transformation_python
5g-nr data-analysis python
Last synced: about 1 month ago
JSON representation
Resource Allocation in 5G Network Service
- Host: GitHub
- URL: https://github.com/shrunga92/5g_qos_data_transformation_python
- Owner: shrunga92
- Created: 2025-04-04T18:00:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-05T02:46:28.000Z (about 1 year ago)
- Last Synced: 2025-04-09T19:38:37.261Z (about 1 year ago)
- Topics: 5g-nr, data-analysis, python
- Language: Jupyter Notebook
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 5G_QoS_Data_transformation_python
``` python
import pandas as pd
import os
pwd = os.getcwd()
print(f'path is {pwd} now ')
df = pd.read_csv('Quality_of_Service_5G.csv')
df
```

## 1. Data Pre-Processing :
``` python
df.info()
```

``` python
df.isna().sum()
```

``` python
df.duplicated().sum()
```
np.int64(0)
``` python
df['Resource_Allocation'] = df['Resource_Allocation'].str.replace('%','')
df
```

``` python
df['User_ID'] = df['User_ID'].str.replace('User_','')
df
```

``` python
# Bandwidth contains 2 units : Kbps and Mbps, where Kbps=1000*Mbps
# Mbps : Convert to Kbps
# Kbps : Leave as it is
def mbps_to_kbps(value):
if 'Mbps' in value:
n = float(value.replace(' Mbps',''))
return str(n*1000)+' Kbps'
else:
return value
df['Required_Bandwidth'] = df['Required_Bandwidth'].map(mbps_to_kbps)
df['Allocated_Bandwidth'] = df['Allocated_Bandwidth'].map(mbps_to_kbps)
df['Required_Bandwidth'] = df['Required_Bandwidth'].str.replace(' Kbps','')
df['Allocated_Bandwidth'] = df['Allocated_Bandwidth'].str.replace(' Kbps','')
df['Latency'] = df['Latency'].str.replace(' ms','')
df['Signal_Strength'] = df['Signal_Strength'].str.replace(' dBm','')
df
```

``` python
#Convert datatypes
df['Timestamp'] = pd.to_datetime(df['Timestamp'])
df['User_ID'] = df['User_ID'].astype('int')
df['Application_Type'] = df['Application_Type'].astype('str')
df['Signal_Strength'] = df['Signal_Strength'].astype('int')
df['Latency'] = df['Latency'].astype('int')
df['Required_Bandwidth'] = df['Required_Bandwidth'].astype('float')
df['Allocated_Bandwidth'] = df['Allocated_Bandwidth'].astype('float')
df['Resource_Allocation'] = df['Resource_Allocation'].astype('int')
df.info()
```

``` python
df.head(10)
df.tail()
new_df = df
new_df.to_csv("5G_QoS_modified.csv", index=False)
```