cdrs:index
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| cdrs:index [2024/10/08 12:44] – Fixed Overall antonio.andriychuk | cdrs:index [2026/04/09 10:18] (current) – removed sysadm | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== CDRs ====== | ||
| - | <code python> | ||
| - | # In order to let this script work, rename your downloaded file as " | ||
| - | |||
| - | # Importing the library used mainly for this script, to install it use this command string(UNIX only) >> pip3 install pandas datetime | ||
| - | import pandas | ||
| - | import datetime | ||
| - | import numpy as np | ||
| - | |||
| - | |||
| - | # Creating the Dates used to rename the files at the end of the process | ||
| - | today = datetime.date.today() | ||
| - | first = today.replace(day=1) | ||
| - | last_month = first - datetime.timedelta(days=1) | ||
| - | |||
| - | year = last_month.strftime(" | ||
| - | month = last_month.strftime(" | ||
| - | |||
| - | match month: | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case ' | ||
| - | month = ' | ||
| - | case _: | ||
| - | print(" | ||
| - | |||
| - | # Declaring where GTT is included in the Check | ||
| - | gtt_check = input(" | ||
| - | |||
| - | # If " | ||
| - | if gtt_check == ' | ||
| - | gtt_cdr = pandas.read_csv(' | ||
| - | |||
| - | redsun_gtt = (gtt_cdr.loc[(gtt_cdr[' | ||
| - | venistar_gtt = (gtt_cdr.loc[(gtt_cdr[' | ||
| - | prysmian_fr = (gtt_cdr.loc[(gtt_cdr[' | ||
| - | prysmian_br = (gtt_cdr.loc[(gtt_cdr[' | ||
| - | |||
| - | # Dividing the CDR per destination and creating a column with the outbound Traffic cost | ||
| - | |||
| - | # REDSUN - GTT | ||
| - | def redsun_gtt_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif ' | ||
| - | if ' | ||
| - | return row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | |||
| - | |||
| - | redsun_gtt[' | ||
| - | |||
| - | # Venistar | ||
| - | def venistar_gtt_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | venistar_gtt[' | ||
| - | |||
| - | |||
| - | # Retrieving the minutes for Prysmian | ||
| - | # Prysmian France | ||
| - | column_pry_fr = 'Call Duration' | ||
| - | total_pry_fr = prysmian_fr[column_pry_fr].sum() | ||
| - | conversion_pry_fr = total_pry_fr / 60 | ||
| - | minutes_pry_fr = round(conversion_pry_fr, | ||
| - | |||
| - | # Prysmian Brasil | ||
| - | column_pry_br = 'Call Duration' | ||
| - | total_pry_br = prysmian_br[column_pry_br].sum() | ||
| - | conversion_pry_br = total_pry_br / 60 | ||
| - | minutes_pry_br = round(conversion_pry_br, | ||
| - | |||
| - | # Retireving cost for Prysmian | ||
| - | # Prysmian FR | ||
| - | column_pry_fr_cost = ' | ||
| - | cost_pry_fr = prysmian_fr[column_pry_fr_cost].sum() | ||
| - | prysmian_fr_cost = round(cost_pry_fr, | ||
| - | |||
| - | # Prysmian BR | ||
| - | column_pry_br_cost = ' | ||
| - | cost_pry_br= prysmian_br[column_pry_br_cost].sum() | ||
| - | prysmian_br_cost = round(cost_pry_br, | ||
| - | |||
| - | |||
| - | # Calculating the Costs per customer | ||
| - | |||
| - | # Redsun - Cost | ||
| - | column_cost = ' | ||
| - | sum_cost_redsun_gtt = redsun_gtt[column_cost].sum() | ||
| - | redsun_gtt_cost = round(sum_cost_redsun_gtt, | ||
| - | |||
| - | # Redsun - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_redsun_gtt = redsun_gtt[column_cost].sum() | ||
| - | redsun_gtt_resell = round(sum_resell_redsun_gtt, | ||
| - | |||
| - | # Venistar - Cost | ||
| - | column_cost = ' | ||
| - | sum_cost_venistar_gtt = venistar_gtt[column_cost].sum() | ||
| - | venistar_gtt_cost = round(sum_cost_venistar_gtt, | ||
| - | |||
| - | # Venistar - Resell | ||
| - | column_cost = ' | ||
| - | sum_resell_venistar_gtt = venistar_gtt[column_cost].sum() | ||
| - | venistar_gtt_resell = round(sum_resell_venistar_gtt, | ||
| - | |||
| - | # Creating CDR for customers | ||
| - | cdr_columns = [' | ||
| - | redsun_gtt = redsun_gtt[cdr_columns] | ||
| - | venistar_gtt = venistar_gtt[cdr_columns] | ||
| - | |||
| - | rename_columns = {' | ||
| - | redsun_gtt = redsun_gtt.rename(columns=rename_columns) | ||
| - | venistar_gtt = venistar_gtt.rename(columns=rename_columns) | ||
| - | |||
| - | redsun_gtt.to_csv(f" | ||
| - | venistar_gtt.to_csv(f" | ||
| - | |||
| - | print(" | ||
| - | print(f" | ||
| - | |||
| - | |||
| - | # If anything else is typed, the instruction will continue without GTT | ||
| - | else: | ||
| - | pass | ||
| - | |||
| - | # First extraction of the file using pandas library, and creating the object to create the CDR | ||
| - | voxbone_cdr = pandas.read_csv(' | ||
| - | irideos_green_cdr = pandas.read_csv(' | ||
| - | irideos_cdr = pandas.read_csv(' | ||
| - | |||
| - | # TOLL-FREE | ||
| - | |||
| - | e80_green_vox = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | e80_green_iri = (irideos_green_cdr.loc[(irideos_green_cdr[' | ||
| - | farmacie_green = (irideos_green_cdr.loc[(irideos_green_cdr[' | ||
| - | metanonord_green = (irideos_green_cdr.loc[(irideos_green_cdr[' | ||
| - | oltreta_green = (irideos_green_cdr.loc[(irideos_green_cdr[' | ||
| - | |||
| - | |||
| - | # OUTBOUND | ||
| - | |||
| - | # Alidays | ||
| - | alidays = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | #Beeasy | ||
| - | beeasy_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | beeasidata_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Careapt | ||
| - | careapt = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # E80 | ||
| - | e80_vox = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | e80_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Farmacie Italiane | ||
| - | farmacie = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Fives | ||
| - | fives_vox = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | fives_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Giuffre' | ||
| - | giuffre = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Golilla | ||
| - | golilla = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Lario Reti Holding | ||
| - | lrh = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Nuovo Consorzio Informatico | ||
| - | nci = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # OCME | ||
| - | ocme_vox = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | ocme_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Omega3C - Microdata | ||
| - | omega3c = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Prysmian | ||
| - | prysmian_ib = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | prysmian_uk = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | |||
| - | # RedSun | ||
| - | redsun_vox = (voxbone_cdr.loc[(voxbone_cdr[' | ||
| - | redsun_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # S2C | ||
| - | s2c_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Service Credit | ||
| - | servicecredit = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | # Venistar | ||
| - | venistar_iri = (irideos_cdr.loc[(irideos_cdr[' | ||
| - | |||
| - | |||
| - | # Dividing the CDR per destination and creating a column with the outbound Traffic cost | ||
| - | |||
| - | # E80 - VOXBONE- TOLL-FREE | ||
| - | def e80_green_vox_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | if ' | ||
| - | # MOBILE | ||
| - | if row[' | ||
| - | if row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | e80_green_vox[' | ||
| - | |||
| - | # E80 - IRIDEOS - TOLL-FREE | ||
| - | def e80_green_iri_destinations(row): | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | e80_green_iri[' | ||
| - | |||
| - | def farmacie_green_destinations(row): | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | farmacie_green[' | ||
| - | |||
| - | def metanonord_green_destinations(row): | ||
| - | if ' | ||
| - | | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | metanonord_green[' | ||
| - | |||
| - | |||
| - | def oltreta_green_destinations(row): | ||
| - | if ' | ||
| - | | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | oltreta_green[' | ||
| - | |||
| - | # OUTBOUND | ||
| - | |||
| - | # Alidays | ||
| - | def alidays_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | alidays[' | ||
| - | |||
| - | # Beeasy | ||
| - | def beeasy_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | beeasy_iri[' | ||
| - | |||
| - | # Beeasy - Isidata | ||
| - | def beeasidata_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | beeasidata_iri[' | ||
| - | |||
| - | # Careapt | ||
| - | def careapt_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | careapt[' | ||
| - | |||
| - | #E80 - VOXBONE | ||
| - | |||
| - | def e80_vox_destination(row): | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | e80_vox[' | ||
| - | |||
| - | |||
| - | # E80 - IRIDEOS | ||
| - | def e80_iri_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | e80_iri[' | ||
| - | |||
| - | # Farmacie | ||
| - | def farmacie_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | farmacie[' | ||
| - | |||
| - | # FIVES - VOXBONE | ||
| - | def fives_vox_destinations(row): | ||
| - | if ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | fives_vox[' | ||
| - | |||
| - | |||
| - | # Fives - IRIDEOS | ||
| - | def fives_iri_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | fives_iri[' | ||
| - | |||
| - | # Giuffré | ||
| - | def giuffre_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | giuffre[' | ||
| - | |||
| - | # Golilla | ||
| - | def golilla_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | golilla[' | ||
| - | |||
| - | # LRH | ||
| - | def lrh_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | lrh[' | ||
| - | |||
| - | # NCI | ||
| - | if nci.empty == False: | ||
| - | def nci_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | nci[' | ||
| - | else: | ||
| - | pass | ||
| - | |||
| - | # OCME - VOXBONE | ||
| - | |||
| - | def ocme_vox_destinations(row): | ||
| - | if isinstance(row[' | ||
| - | if row[' | ||
| - | return float(row[' | ||
| - | elif row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif isinstance(row[' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif isinstance(row[' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif isinstance(row[' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif isinstance(row[' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif isinstance(row[' | ||
| - | if row[' | ||
| - | return float(row[' | ||
| - | elif row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return row[' | ||
| - | elif isinstance(row[' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | ocme_vox[' | ||
| - | |||
| - | # OCME - IRIDEOS | ||
| - | def ocme_iri_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | ocme_iri[' | ||
| - | |||
| - | |||
| - | # Omega3c | ||
| - | def omega3c_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | omega3c[' | ||
| - | |||
| - | |||
| - | # REDSUN - VOXBONE | ||
| - | def redsun_vox_destinations(row): | ||
| - | if ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | if isinstance(row[' | ||
| - | return float(row[' | ||
| - | elif isinstance(row[' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | redsun_vox[' | ||
| - | |||
| - | # REDSUN - IRIDEOS | ||
| - | def redsun_iri_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | redsun_iri[' | ||
| - | |||
| - | # S2C | ||
| - | def s2c_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | s2c_iri[' | ||
| - | |||
| - | # ServiceCredit | ||
| - | def servicecredit_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | servicecredit[' | ||
| - | |||
| - | # VENISTAR - IRIDEOS | ||
| - | def venistar_iri_destinations(row): | ||
| - | if ' | ||
| - | if ' | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | elif ' | ||
| - | return float(row[' | ||
| - | else: | ||
| - | return float(row[' | ||
| - | |||
| - | venistar_iri[' | ||
| - | |||
| - | # Calculating the Costs per customer | ||
| - | # E80 - VOXBONE - TOLL-FREE - Cost | ||
| - | column_cost = ' | ||
| - | e80_green_vox[column_cost] = pandas.to_numeric(e80_green_vox[column_cost], | ||
| - | sum_cost_e80_green_vox = e80_green_vox[column_cost].sum() | ||
| - | e80_green_vox_cost = round(sum_cost_e80_green_vox, | ||
| - | |||
| - | # E80 - VOXBONE - TOLL-FREE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_e80_green_vox = e80_green_vox[column_cost].sum() | ||
| - | e80_green_resell_vox = round(sum_resell_e80_green_vox, | ||
| - | |||
| - | # E80 - IRIDEOS - TOLL-FREE - Cost | ||
| - | column_cost = ' | ||
| - | e80_green_iri[column_cost] = pandas.to_numeric(e80_green_iri[column_cost], | ||
| - | sum_cost_e80_green_iri = e80_green_iri[column_cost].sum() | ||
| - | e80_green_cost_iri = round(sum_cost_e80_green_iri, | ||
| - | |||
| - | # E80 - IRIDEOS - TOLL-FREE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_e80_green_iri = e80_green_iri[column_cost].sum() | ||
| - | e80_green_resell_iri = round(sum_resell_e80_green_iri, | ||
| - | |||
| - | # Farmacie - TOLL-FREE - Cost | ||
| - | column_cost = ' | ||
| - | farmacie_green[column_cost] = pandas.to_numeric(farmacie_green[column_cost], | ||
| - | sum_cost_farmacie_green = farmacie_green[column_cost].sum() | ||
| - | farmacie_green_cost = round(sum_cost_farmacie_green, | ||
| - | |||
| - | # Farmacie - TOLL-FREE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_farmacie_green = farmacie_green[column_cost].sum() | ||
| - | farmacie_green_resell = round(sum_resell_farmacie_green, | ||
| - | |||
| - | # MetanoNord - TOLL-FREE - Cost | ||
| - | column_cost = ' | ||
| - | metanonord_green[column_cost] = pandas.to_numeric(metanonord_green[column_cost], | ||
| - | sum_cost_metanonord_green = metanonord_green[column_cost].sum() | ||
| - | metanonord_green_cost = round(sum_cost_metanonord_green, | ||
| - | |||
| - | # MetanoNord - TOLL-FREE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_metanonord_green = metanonord_green[column_cost].sum() | ||
| - | metanonord_green_resell = round(sum_resell_metanonord_green, | ||
| - | |||
| - | # Oltreta - TOLL-FREE - Cost | ||
| - | column_cost = ' | ||
| - | oltreta_green[column_cost] = pandas.to_numeric(oltreta_green[column_cost], | ||
| - | sum_cost_oltreta_green = oltreta_green[column_cost].sum() | ||
| - | oltreta_green_cost = round(sum_cost_oltreta_green, | ||
| - | |||
| - | # Oltreta - TOLL-FREE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_oltreta_green = oltreta_green[column_cost].sum() | ||
| - | oltreta_green_resell = round(sum_resell_oltreta_green, | ||
| - | |||
| - | |||
| - | # OUTBOUND | ||
| - | |||
| - | # Alidays - Cost | ||
| - | column_cost = ' | ||
| - | alidays[column_cost] = pandas.to_numeric(alidays[column_cost], | ||
| - | sum_cost_alidays = alidays[column_cost].sum() | ||
| - | alidays_cost = round(sum_cost_alidays, | ||
| - | |||
| - | # Alidays - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_alidays = alidays[column_cost].sum() | ||
| - | alidays_resell = round(sum_resell_alidays, | ||
| - | |||
| - | |||
| - | # Beeasy - Cost | ||
| - | column_cost = ' | ||
| - | beeasy_iri[column_cost] = pandas.to_numeric(beeasy_iri[column_cost], | ||
| - | sum_cost_beeasy = beeasy_iri[column_cost].sum() | ||
| - | beeasy_cost = round(sum_cost_beeasy, | ||
| - | |||
| - | # Beeasy - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_beeasy = beeasy_iri[column_cost].sum() | ||
| - | beeasy_resell = round(sum_resell_beeasy, | ||
| - | |||
| - | |||
| - | # Beeasy - Isidata - Cost | ||
| - | column_cost = ' | ||
| - | beeasidata_iri[column_cost] = pandas.to_numeric(beeasidata_iri[column_cost], | ||
| - | sum_cost_beeasidata = beeasidata_iri[column_cost].sum() | ||
| - | beeasidata_cost = round(sum_cost_beeasidata, | ||
| - | |||
| - | # Beeasy - Isidata - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_beeasidata = beeasidata_iri[column_cost].sum() | ||
| - | beeasidata_resell = round(sum_resell_beeasidata, | ||
| - | |||
| - | |||
| - | # Careapt - Cost | ||
| - | column_cost = ' | ||
| - | careapt[column_cost] = pandas.to_numeric(careapt[column_cost], | ||
| - | sum_cost_careapt = careapt[column_cost].sum() | ||
| - | careapt_cost = round(sum_cost_careapt, | ||
| - | |||
| - | # Careapt - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_careapt = careapt[column_cost].sum() | ||
| - | careapt_resell = round(sum_resell_careapt, | ||
| - | |||
| - | |||
| - | # E80 - VOXBONE - Cost | ||
| - | column_cost = ' | ||
| - | e80_vox[column_cost] = pandas.to_numeric(e80_vox[column_cost], | ||
| - | sum_cost_e80_vox = e80_vox[column_cost].sum() | ||
| - | e80_vox_cost = round(sum_cost_e80_vox, | ||
| - | |||
| - | # E80 - VOXBONE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_e80_vox = e80_vox[column_cost].sum() | ||
| - | e80_vox_resell = round(sum_resell_e80_vox, | ||
| - | |||
| - | # E80 - IRIDEOS - Cost | ||
| - | column_cost = ' | ||
| - | e80_iri[column_cost] = pandas.to_numeric(e80_iri[column_cost], | ||
| - | sum_cost_e80_iri = e80_iri[column_cost].sum() | ||
| - | e80_iri_cost = round(sum_cost_e80_iri, | ||
| - | |||
| - | # E80 - IRIDEOS - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_e80_iri = e80_iri[column_cost].sum() | ||
| - | e80_iri_resell = round(sum_resell_e80_iri, | ||
| - | |||
| - | |||
| - | # Farmacie - Cost | ||
| - | column_cost = ' | ||
| - | farmacie[column_cost] = pandas.to_numeric(farmacie[column_cost], | ||
| - | sum_cost_farmacie = farmacie[column_cost].sum() | ||
| - | farmacie_cost = round(sum_cost_farmacie, | ||
| - | |||
| - | # Farmacie - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_farmacie = farmacie[column_cost].sum() | ||
| - | farmacie_resell = round(sum_resell_farmacie, | ||
| - | |||
| - | |||
| - | # Fives - VOXBONE - Cost | ||
| - | column_cost = ' | ||
| - | fives_vox[column_cost] = pandas.to_numeric(fives_vox[column_cost], | ||
| - | sum_cost_fives_vox = fives_vox[column_cost].sum() | ||
| - | fives_vox_cost = round(sum_cost_fives_vox, | ||
| - | |||
| - | # Fives - VOXBONE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_fives_vox = fives_vox[column_cost].sum() | ||
| - | fives_vox_resell = round(float(sum_resell_fives_vox), | ||
| - | |||
| - | |||
| - | # Fives - IRIDEOS - Cost | ||
| - | column_cost = ' | ||
| - | fives_iri[column_cost] = pandas.to_numeric(fives_iri[column_cost], | ||
| - | sum_cost_fives_iri = fives_iri[column_cost].sum() | ||
| - | fives_iri_cost = round(sum_cost_fives_iri, | ||
| - | |||
| - | # Fives - IRIDEOS - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_fives_iri = fives_iri[column_cost].sum() | ||
| - | fives_iri_resell = round(sum_resell_fives_iri, | ||
| - | |||
| - | |||
| - | # Giuffre - Cost | ||
| - | column_cost = ' | ||
| - | giuffre[column_cost] = pandas.to_numeric(giuffre[column_cost], | ||
| - | sum_cost_giuffre = giuffre[column_cost].sum() | ||
| - | giuffre_cost = round(sum_cost_giuffre, | ||
| - | |||
| - | # Giuffre - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_giuffre = giuffre[column_cost].sum() | ||
| - | giuffre_resell = round(sum_resell_giuffre, | ||
| - | |||
| - | |||
| - | # Golilla - Cost | ||
| - | column_cost = ' | ||
| - | golilla[column_cost] = pandas.to_numeric(golilla[column_cost], | ||
| - | sum_cost_golilla = golilla[column_cost].sum() | ||
| - | golilla_cost = round(sum_cost_golilla, | ||
| - | |||
| - | # Golilla - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_golilla = golilla[column_cost].sum() | ||
| - | golilla_resell = round(sum_resell_golilla, | ||
| - | |||
| - | |||
| - | # LRH - Cost | ||
| - | column_cost = ' | ||
| - | lrh[column_cost] = pandas.to_numeric(lrh[column_cost], | ||
| - | sum_cost_lrh = lrh[column_cost].sum() | ||
| - | lrh_cost = round(sum_cost_lrh, | ||
| - | |||
| - | # LRH - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_lrh = lrh[column_cost].sum() | ||
| - | lrh_resell = round(sum_resell_lrh, | ||
| - | |||
| - | |||
| - | if nci.empty == False: | ||
| - | # NCI - Cost | ||
| - | column_cost = ' | ||
| - | nci[column_cost] = pandas.to_numeric(nci[column_cost], | ||
| - | sum_cost_nci = nci[column_cost].sum() | ||
| - | nci_cost = round(sum_cost_nci, | ||
| - | |||
| - | # NCI - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_nci = nci[column_cost].sum() | ||
| - | nci_resell = round(sum_resell_nci, | ||
| - | else: | ||
| - | nci_cost = 0 | ||
| - | nci_resell = 0 | ||
| - | |||
| - | # OCME - VOXBONE - Cost | ||
| - | column_cost = ' | ||
| - | ocme_vox[column_cost] = pandas.to_numeric(ocme_vox[column_cost], | ||
| - | sum_cost_ocme_vox = ocme_vox[column_cost].sum() | ||
| - | ocme_vox_cost = round(sum_cost_ocme_vox, | ||
| - | |||
| - | # OCME - VOXBONE - Reselling | ||
| - | column_cost = ' | ||
| - | numeric_values = pandas.to_numeric(ocme_vox[column_cost], | ||
| - | sum_resell_ocme_vox = np.sum(numeric_values) | ||
| - | ocme_vox_resell = round(sum_resell_ocme_vox, | ||
| - | |||
| - | # OCME - IRIDEOS - Cost | ||
| - | column_cost = ' | ||
| - | ocme_iri[column_cost] = pandas.to_numeric(ocme_iri[column_cost], | ||
| - | sum_cost_ocme_iri = ocme_iri[column_cost].sum() | ||
| - | ocme_iri_cost = round(sum_cost_ocme_iri, | ||
| - | |||
| - | # OCME - IRIDEOS - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_ocme_iri = ocme_iri[column_cost].sum() | ||
| - | ocme_iri_resell = round(sum_resell_ocme_iri, | ||
| - | |||
| - | |||
| - | # Omega3c - Cost | ||
| - | column_cost = ' | ||
| - | omega3c[column_cost] = pandas.to_numeric(omega3c[column_cost], | ||
| - | sum_cost_omega3c = omega3c[column_cost].sum() | ||
| - | omega3c_cost = round(sum_cost_omega3c, | ||
| - | |||
| - | # omega3c - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_omega3c = omega3c[column_cost].sum() | ||
| - | omega3c_resell = round(sum_resell_omega3c, | ||
| - | |||
| - | |||
| - | # RedSun - VOXBONE - Cost | ||
| - | column_cost = ' | ||
| - | redsun_vox[column_cost] = pandas.to_numeric(redsun_vox[column_cost], | ||
| - | sum_cost_redsun_vox = redsun_vox[column_cost].sum() | ||
| - | redsun_vox_cost = round(sum_cost_redsun_vox, | ||
| - | |||
| - | # RedSun - VOXBONE - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_redsun_vox = redsun_vox[column_cost].sum() | ||
| - | redsun_vox_resell = round(sum_resell_redsun_vox, | ||
| - | |||
| - | # RedSun - IRIDEOS - Cost | ||
| - | column_cost = ' | ||
| - | redsun_iri[column_cost] = pandas.to_numeric(redsun_iri[column_cost], | ||
| - | sum_cost_redsun_iri = redsun_iri[column_cost].sum() | ||
| - | redsun_iri_cost = round(sum_cost_redsun_iri, | ||
| - | |||
| - | # RedSun - IRIDEOS - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_redsun_iri = redsun_iri[column_cost].sum() | ||
| - | redsun_iri_resell = round(sum_resell_redsun_iri, | ||
| - | |||
| - | |||
| - | # S2C - Cost | ||
| - | column_cost = ' | ||
| - | s2c_iri[column_cost] = pandas.to_numeric(s2c_iri[column_cost], | ||
| - | sum_cost_s2c_iri = s2c_iri[column_cost].sum() | ||
| - | s2c_iri_cost = round(sum_cost_s2c_iri, | ||
| - | |||
| - | # S2C - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_s2c_iri = s2c_iri[column_cost].sum() | ||
| - | s2c_iri_resell = round(sum_resell_s2c_iri, | ||
| - | |||
| - | |||
| - | # ServiceCredit - Cost | ||
| - | column_cost = ' | ||
| - | servicecredit[column_cost] = pandas.to_numeric(servicecredit[column_cost], | ||
| - | sum_cost_servicecredit = servicecredit[column_cost].sum() | ||
| - | servicecredit_cost = round(sum_cost_servicecredit, | ||
| - | |||
| - | # ServiceCredit - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_servicecredit = servicecredit[column_cost].sum() | ||
| - | servicecredit_resell = round(sum_resell_servicecredit, | ||
| - | |||
| - | |||
| - | # Venistar - IRIDEOS - Cost | ||
| - | column_cost = ' | ||
| - | venistar_iri[column_cost] = pandas.to_numeric(venistar_iri[column_cost], | ||
| - | sum_cost_venista_iri = venistar_iri[column_cost].sum() | ||
| - | venistar_iri_cost = round(sum_cost_venista_iri, | ||
| - | |||
| - | # Venistar - IRIDEOS - Reselling | ||
| - | column_cost = ' | ||
| - | sum_resell_venistar_iri = venistar_iri[column_cost].sum() | ||
| - | venistar_iri_resell = round(sum_resell_venistar_iri, | ||
| - | |||
| - | |||
| - | # MINUTES | ||
| - | |||
| - | # Prysmian IB | ||
| - | |||
| - | column_cost = ' | ||
| - | prysmian_ib[column_cost] = pandas.to_numeric(prysmian_ib[column_cost], | ||
| - | sum_cost_prysmian_ib = prysmian_ib[column_cost].sum() | ||
| - | cost_pry_ib = round(sum_cost_prysmian_ib, | ||
| - | |||
| - | column_minutes = ' | ||
| - | prysmian_ib[column_cost] = pandas.to_numeric(prysmian_ib[column_minutes], | ||
| - | seconds_pry_ib = prysmian_ib[column_cost].sum() | ||
| - | minutes_pry_ib = seconds_pry_ib / 60 | ||
| - | sum_minutes_pry_ib = round(minutes_pry_ib) | ||
| - | |||
| - | |||
| - | # Prysmian UK | ||
| - | |||
| - | column_cost = ' | ||
| - | prysmian_uk[column_cost] = pandas.to_numeric(prysmian_uk[column_cost], | ||
| - | sum_cost_prysmian_uk = prysmian_uk[column_cost].sum() | ||
| - | cost_pry_uk = round(sum_cost_prysmian_uk, | ||
| - | |||
| - | |||
| - | column_minutes = ' | ||
| - | prysmian_uk[column_cost] = pandas.to_numeric(prysmian_uk[column_minutes], | ||
| - | seconds_pry_uk = prysmian_uk[column_cost].sum() | ||
| - | minutes_pry_uk = seconds_pry_uk / 60 | ||
| - | sum_minutes_pry_uk = round(minutes_pry_uk) | ||
| - | |||
| - | |||
| - | # CLEARING THE DURATION != 0 FOR THE CDR ONLY | ||
| - | |||
| - | e80_vox = e80_vox.loc[(e80_vox[' | ||
| - | fives_vox = fives_vox.loc[(fives_vox[' | ||
| - | ocme_vox = ocme_vox.loc[(ocme_vox[' | ||
| - | redsun_vox = redsun_vox.loc[(redsun_vox[' | ||
| - | |||
| - | |||
| - | # Creating CDR for customers | ||
| - | cdr_columns = [' | ||
| - | cdr_columns_redsun = [' | ||
| - | e80_vox = e80_vox[cdr_columns] | ||
| - | e80_green_vox = e80_green_vox[cdr_columns] | ||
| - | fives_vox = fives_vox[cdr_columns] | ||
| - | ocme_vox = ocme_vox[cdr_columns] | ||
| - | redsun_vox = redsun_vox[cdr_columns_redsun] | ||
| - | |||
| - | cdr_columns_green = [' | ||
| - | e80_green_iri = e80_green_iri[cdr_columns_green] | ||
| - | farmacie_green = farmacie_green[cdr_columns_green] | ||
| - | metanonord_green = metanonord_green[cdr_columns_green] | ||
| - | oltreta_green = oltreta_green[cdr_columns_green] | ||
| - | |||
| - | rename_columns_green = {' | ||
| - | e80_green_iri = e80_green_iri.rename(columns=rename_columns_green) | ||
| - | farmacie_green = farmacie_green.rename(columns=rename_columns_green) | ||
| - | metanonord_green = metanonord_green.rename(columns=rename_columns_green) | ||
| - | oltreta_green = oltreta_green.rename(columns=rename_columns_green) | ||
| - | |||
| - | e80_green_iri.to_csv(f" | ||
| - | farmacie_green.to_csv(f" | ||
| - | metanonord_green.to_csv(f" | ||
| - | oltreta_green.to_csv(f" | ||
| - | |||
| - | rename_columns = {' | ||
| - | rename_columns_redsun_vox = {' | ||
| - | |||
| - | e80_vox = e80_vox.rename(columns=rename_columns) | ||
| - | e80_green_vox = e80_green_vox.rename(columns=rename_columns) | ||
| - | fives_vox = fives_vox.rename(columns=rename_columns) | ||
| - | ocme_vox = ocme_vox.rename(columns=rename_columns) | ||
| - | redsun_vox = redsun_vox.rename(columns=rename_columns_redsun_vox) | ||
| - | |||
| - | # RENAMING THE CSV FILE | ||
| - | e80_vox.to_csv(f" | ||
| - | e80_green_vox.to_csv(f" | ||
| - | fives_vox.to_csv(f" | ||
| - | ocme_vox.to_csv(f" | ||
| - | redsun_vox.to_csv(f" | ||
| - | |||
| - | cdr_columns = [' | ||
| - | alidays = alidays[cdr_columns] | ||
| - | beeasy_iri = beeasy_iri[cdr_columns] | ||
| - | beeasidata_iri = beeasidata_iri[cdr_columns] | ||
| - | careapt = careapt[cdr_columns] | ||
| - | e80_iri = e80_iri[cdr_columns] | ||
| - | farmacie = farmacie[cdr_columns] | ||
| - | fives_iri = fives_iri[cdr_columns] | ||
| - | giuffre = giuffre[cdr_columns] | ||
| - | golilla = golilla[cdr_columns] | ||
| - | lrh = lrh[cdr_columns] | ||
| - | if nci.empty == False: | ||
| - | nci = nci[cdr_columns] | ||
| - | else: | ||
| - | pass | ||
| - | ocme_iri = ocme_iri[cdr_columns] | ||
| - | omega3c = omega3c[cdr_columns] | ||
| - | redsun_iri = redsun_iri[cdr_columns] | ||
| - | s2c_iri = s2c_iri[cdr_columns] | ||
| - | servicecredit = servicecredit[cdr_columns] | ||
| - | venistar_iri = venistar_iri[cdr_columns] | ||
| - | |||
| - | |||
| - | # IRIDEOS | ||
| - | rename_columns = {' | ||
| - | |||
| - | alidays = alidays.rename(columns=rename_columns) | ||
| - | beeasy_iri = beeasy_iri.rename(columns=rename_columns) | ||
| - | beeasidata_iri = beeasidata_iri.rename(columns=rename_columns) | ||
| - | careapt = careapt.rename(columns=rename_columns) | ||
| - | e80_iri = e80_iri.rename(columns=rename_columns) | ||
| - | farmacie = farmacie.rename(columns=rename_columns) | ||
| - | fives_iri = fives_iri.rename(columns=rename_columns) | ||
| - | giuffre = giuffre.rename(columns=rename_columns) | ||
| - | golilla = golilla.rename(columns=rename_columns) | ||
| - | lrh = lrh.rename(columns=rename_columns) | ||
| - | nci = nci.rename(columns=rename_columns) | ||
| - | ocme_iri = ocme_iri.rename(columns=rename_columns) | ||
| - | omega3c = omega3c.rename(columns=rename_columns) | ||
| - | redsun_iri = redsun_iri.rename(columns=rename_columns) | ||
| - | s2c_iri = s2c_iri.rename(columns=rename_columns) | ||
| - | servicecredit = servicecredit.rename(columns=rename_columns) | ||
| - | venistar_iri = venistar_iri.rename(columns=rename_columns) | ||
| - | |||
| - | alidays.to_csv(f" | ||
| - | beeasy_iri.to_csv(f" | ||
| - | beeasidata_iri.to_csv(f" | ||
| - | careapt.to_csv(f" | ||
| - | e80_iri.to_csv(f" | ||
| - | farmacie.to_csv(f" | ||
| - | fives_iri.to_csv(f" | ||
| - | giuffre.to_csv(f" | ||
| - | golilla.to_csv(f" | ||
| - | lrh.to_csv(f" | ||
| - | # | ||
| - | ocme_iri.to_csv(f" | ||
| - | omega3c.to_csv(f" | ||
| - | redsun_iri.to_csv(f" | ||
| - | s2c_iri.to_csv(f" | ||
| - | servicecredit.to_csv(f" | ||
| - | venistar_iri.to_csv(f" | ||
| - | |||
| - | # Printing the Values: | ||
| - | |||
| - | print(f" | ||
| - | print(f" | ||
| - | print(f" | ||
| - | |||
| - | print(f" | ||
| - | print(" | ||
| - | print(f" | ||
| - | print(f" | ||
| - | print(f" | ||
| - | |||
| - | exit | ||
| - | </ | ||
cdrs/index.1728391477.txt.gz · Last modified: by antonio.andriychuk
