{ "cells": [ { "cell_type": "code", "execution_count": 3, "id": "c4dca2df", "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 40, "id": "3668f2b1", "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/splat/venvs/jupyter-notebook/lib/python3.8/site-packages/openpyxl/styles/stylesheet.py:226: UserWarning: Workbook contains no default style, apply openpyxl's default\n", " warn(\"Workbook contains no default style, apply openpyxl's default\")\n" ] } ], "source": [ "df204 = pd.read_excel(\"Usage-443112phone-204.xlsx\").iloc[:,13:]\n", "df205 = pd.read_excel(\"Usage-443112phone-205.xlsx\").iloc[:,13:]" ] }, { "cell_type": "code", "execution_count": 41, "id": "bb7ff445", "metadata": {}, "outputs": [], "source": [ "headers=[\"Number called\", \"Call DateTime\", \"Place called\", \"Call Duration\", \"Full Price\", \"Savings\", \"Jurisdiction\"]\n", "df204.rename(columns = dict(zip(df204.columns, headers)), inplace=True)\n", "df205.rename(columns = dict(zip(df205.columns, headers)), inplace=True)\n" ] }, { "cell_type": "code", "execution_count": 42, "id": "9b1d5d73", "metadata": { "scrolled": true }, "outputs": [], "source": [ "df204.drop(labels=[0,1], inplace=True)\n", "df205.drop(labels=[0,1], inplace=True)" ] }, { "cell_type": "code", "execution_count": 44, "id": "759a3d05", "metadata": {}, "outputs": [], "source": [ "dfphone = df204.append(df205, ignore_index=True)" ] }, { "cell_type": "code", "execution_count": 45, "id": "43edc727", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Number calledCall DateTimePlace calledCall DurationFull PriceSavingsJurisdiction
06189422089919-Sep-2022 18:36Australia122.760.15I
180055900919-Sep-2022 09:48Toll Free100N
\n", "
" ], "text/plain": [ " Number called Call DateTime Place called Call Duration Full Price \\\n", "0 61894220899 19-Sep-2022 18:36 Australia 12 2.76 \n", "1 800559009 19-Sep-2022 09:48 Toll Free 1 0 \n", "\n", " Savings Jurisdiction \n", "0 0.15 I \n", "1 0 N " ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfphone.head(2)" ] }, { "cell_type": "code", "execution_count": 46, "id": "50312d6b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Number calledCall DateTimePlace calledCall DurationFull PriceSavingsJurisdiction
06189422089919-Sep-2022 18:36Australia122.760.15I
86189422089916-Sep-2022 13:46Australia143.220.61I
166189422089915-Sep-2022 11:51Australia143.220.61I
236189422089914-Sep-2022 12:14Australia204.61.99I
706189422089903-Oct-2022 12:34Australia132.990I
1046189422089920-Sep-2022 10:15Australia40.920I
1066189422089920-Sep-2022 08:54Australia20.460I
\n", "
" ], "text/plain": [ " Number called Call DateTime Place called Call Duration Full Price \\\n", "0 61894220899 19-Sep-2022 18:36 Australia 12 2.76 \n", "8 61894220899 16-Sep-2022 13:46 Australia 14 3.22 \n", "16 61894220899 15-Sep-2022 11:51 Australia 14 3.22 \n", "23 61894220899 14-Sep-2022 12:14 Australia 20 4.6 \n", "70 61894220899 03-Oct-2022 12:34 Australia 13 2.99 \n", "104 61894220899 20-Sep-2022 10:15 Australia 4 0.92 \n", "106 61894220899 20-Sep-2022 08:54 Australia 2 0.46 \n", "\n", " Savings Jurisdiction \n", "0 0.15 I \n", "8 0.61 I \n", "16 0.61 I \n", "23 1.99 I \n", "70 0 I \n", "104 0 I \n", "106 0 I " ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfphone[dfphone['Place called']=='Australia']" ] }, { "cell_type": "code", "execution_count": 47, "id": "24883955", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "18.17" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dfphone[dfphone['Place called']=='Australia']['Full Price'].astype(float).sum()" ] }, { "cell_type": "code", "execution_count": 49, "id": "bb6a6844", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Number calledCall DateTimePlace calledCall DurationFull PriceSavingsJurisdiction
102148749715-Sep-2022 15:18Mobile20.630M
1127821133315-Sep-2022 14:44Mobile20.630M
2127396563214-Sep-2022 12:50Mobile10.310M
272148264113-Sep-2022 15:31Mobile10.310M
302148264113-Sep-2022 11:15Mobile72.190M
322148264113-Sep-2022 10:57Mobile103.130M
3727688402111-Sep-2022 09:00Mobile82.50M
3927574487110-Sep-2022 10:26Mobile4815.020M
4127303256508-Sep-2022 10:23Mobile20.630M
4327688402106-Sep-2022 08:36Mobile51.560M
5827688402127-Aug-2022 09:35Mobile10.310M
6027574487126-Aug-2022 13:10Mobile206.260M
6527396563223-Aug-2022 12:35Mobile10.310M
6827688402123-Aug-2022 08:31Mobile41.250M
712162032001-Oct-2022 18:29Mobile10.310M
7821104376528-Sep-2022 09:37Mobile10.310M
8421235513226-Sep-2022 12:32Mobile10.310M
8521104376525-Sep-2022 12:02Mobile10.310M
8627821133324-Sep-2022 18:51Mobile41.250M
8827272697724-Sep-2022 16:17Mobile10.310M
8927688402124-Sep-2022 12:05Mobile51.560M
9127821133323-Sep-2022 14:36Mobile51.560M
9427688402123-Sep-2022 10:02Mobile41.250M
9927587883021-Sep-2022 11:14Mobile10.310M
10027587883021-Sep-2022 11:12Mobile10.310M
\n", "
" ], "text/plain": [ " Number called Call DateTime Place called Call Duration Full Price \\\n", "10 21487497 15-Sep-2022 15:18 Mobile 2 0.63 \n", "11 278211333 15-Sep-2022 14:44 Mobile 2 0.63 \n", "21 273965632 14-Sep-2022 12:50 Mobile 1 0.31 \n", "27 21482641 13-Sep-2022 15:31 Mobile 1 0.31 \n", "30 21482641 13-Sep-2022 11:15 Mobile 7 2.19 \n", "32 21482641 13-Sep-2022 10:57 Mobile 10 3.13 \n", "37 276884021 11-Sep-2022 09:00 Mobile 8 2.5 \n", "39 275744871 10-Sep-2022 10:26 Mobile 48 15.02 \n", "41 273032565 08-Sep-2022 10:23 Mobile 2 0.63 \n", "43 276884021 06-Sep-2022 08:36 Mobile 5 1.56 \n", "58 276884021 27-Aug-2022 09:35 Mobile 1 0.31 \n", "60 275744871 26-Aug-2022 13:10 Mobile 20 6.26 \n", "65 273965632 23-Aug-2022 12:35 Mobile 1 0.31 \n", "68 276884021 23-Aug-2022 08:31 Mobile 4 1.25 \n", "71 21620320 01-Oct-2022 18:29 Mobile 1 0.31 \n", "78 211043765 28-Sep-2022 09:37 Mobile 1 0.31 \n", "84 212355132 26-Sep-2022 12:32 Mobile 1 0.31 \n", "85 211043765 25-Sep-2022 12:02 Mobile 1 0.31 \n", "86 278211333 24-Sep-2022 18:51 Mobile 4 1.25 \n", "88 272726977 24-Sep-2022 16:17 Mobile 1 0.31 \n", "89 276884021 24-Sep-2022 12:05 Mobile 5 1.56 \n", "91 278211333 23-Sep-2022 14:36 Mobile 5 1.56 \n", "94 276884021 23-Sep-2022 10:02 Mobile 4 1.25 \n", "99 275878830 21-Sep-2022 11:14 Mobile 1 0.31 \n", "100 275878830 21-Sep-2022 11:12 Mobile 1 0.31 \n", "\n", " Savings Jurisdiction \n", "10 0 M \n", "11 0 M \n", "21 0 M \n", "27 0 M \n", "30 0 M \n", "32 0 M \n", "37 0 M \n", "39 0 M \n", "41 0 M \n", "43 0 M \n", "58 0 M \n", "60 0 M \n", "65 0 M \n", "68 0 M \n", "71 0 M \n", "78 0 M \n", "84 0 M \n", "85 0 M \n", "86 0 M \n", "88 0 M \n", "89 0 M \n", "91 0 M \n", "94 0 M \n", "99 0 M \n", "100 0 M " ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "4\\7777777777l,,,,21ikldfphone[dfphone['Place called']=='Mobile']" ] }, { "cell_type": "code", "execution_count": null, "id": "7cc9ec38", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" } }, "nbformat": 4, "nbformat_minor": 5 }