Introduction

This project is inspired by the annual reports issued by the “National Instance of Telecommunications of Tunisia”. I used data from 2017 annual report for 2G and 3G networks (:link: Link). I used these main Key Performance Indicators (KPIs):

Data will be plotted by gouvernorate (24) and by Internet Provider Service (IPS). In Tunisia, we have 3 main IPS for cellular data: - “Tunisie Telecom” - Ooredoo - Orange Tunisie

Data preprocessing

import pandas as pd 
from geopy.geocoders import Nominatim

#Importer les données
df = pd.read_excel("2g3g-f.xlsx")

#Définir les régions et les opérateurs.
op = []
reg = []
for i in range(len(df)):
    s = df['gouvernorat'][i]
    l= s.split(": ")
    if(l[1] == "TT"):
        op.append("Tunisie Télécom")
    if(l[1] == "OT"):
        op.append("Orange Tunisie")
    if(l[1] == "OO"):
        op.append("Ooredoo")
    reg.append(l[0])
    
df.gouvernorat = reg
df['opérateur'] = op

# Chercher les longitudes et latitudes.
geolocator = Nominatim(user_agent="https://maps.google.com/")
lat = []
long = []
for i in range(len(df)):
    try:
        location = geolocator.geocode(df.gouvernorat[i])
        lat.append(location.latitude)
        long.append(location.longitude)
    except:
        lat.append("NAN")
        long.append("NAN")
        
df['Longitude'] = long
df['Latitude'] = lat
pd.DataFrame.to_csv(df,"data.csv")

Shiny application