Spaces:
Sleeping
Sleeping
Zai
commited on
Commit
·
da4b8fb
1
Parent(s):
13be287
testing scraping total_impressions
Browse files- .gitignore +1 -0
- .idea/jupyter-settings.xml +17 -0
- app.py +11 -3
- notebook.ipynb +335 -4
- processor.py +3 -0
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
demo.xlsx
|
.idea/jupyter-settings.xml
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
+
<project version="4">
|
| 3 |
+
<component name="JupyterPersistentConnectionParameters">
|
| 4 |
+
<option name="moduleParameters">
|
| 5 |
+
<map>
|
| 6 |
+
<entry key="$PROJECT_DIR$/.idea/slide-demo.iml">
|
| 7 |
+
<value>
|
| 8 |
+
<JupyterConnectionParameters>
|
| 9 |
+
<option name="managed" value="true" />
|
| 10 |
+
<option name="sdkName" value="/opt/anaconda3" />
|
| 11 |
+
</JupyterConnectionParameters>
|
| 12 |
+
</value>
|
| 13 |
+
</entry>
|
| 14 |
+
</map>
|
| 15 |
+
</option>
|
| 16 |
+
</component>
|
| 17 |
+
</project>
|
app.py
CHANGED
|
@@ -11,9 +11,17 @@ if uploaded_file is not None:
|
|
| 11 |
processor = Processor()
|
| 12 |
processor.load_data(uploaded_file)
|
| 13 |
|
| 14 |
-
slide_url = slide.create_presentation("Carching Presentation Testing")
|
|
|
|
| 15 |
|
| 16 |
-
st.write(f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
st.write(processor.df)
|
| 19 |
|
|
|
|
| 11 |
processor = Processor()
|
| 12 |
processor.load_data(uploaded_file)
|
| 13 |
|
| 14 |
+
# slide_url = slide.create_presentation("Carching Presentation Testing")
|
| 15 |
+
# st.write(f"Here's the new slide url {slide_url}")
|
| 16 |
|
| 17 |
+
st.write(f"Total Impressions: {processor.total_impressions}")
|
| 18 |
+
st.write(f"Actual Impressions Percentage: {processor.actual_impressions_percentage}")
|
| 19 |
+
st.write(f"Target Impressions Percentage: {processor.target_impressions_percentage}")
|
| 20 |
+
st.write(f"Distance Travelled: {processor.distance_travelled}")
|
| 21 |
+
st.write(f"Target Travelled: {processor.target_travelled}")
|
| 22 |
+
st.write(f"Actual Travelled: {processor.actual_travelled}")
|
| 23 |
+
st.write(f"Total On Road: {processor.total_on_road}")
|
| 24 |
+
st.write(f"High Traffic Percentage: {processor.high_traffic_percentage}")
|
| 25 |
+
st.write(f"Normal Traffic Percentage: {processor.normal_traffic_percentage}")
|
| 26 |
|
|
|
|
| 27 |
|
notebook.ipynb
CHANGED
|
@@ -2,15 +2,346 @@
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
| 5 |
-
"execution_count": null,
|
| 6 |
"id": "initial_id",
|
| 7 |
"metadata": {
|
| 8 |
-
"collapsed": true
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
"source": [
|
| 12 |
-
""
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 15 |
],
|
| 16 |
"metadata": {
|
|
|
|
| 2 |
"cells": [
|
| 3 |
{
|
| 4 |
"cell_type": "code",
|
|
|
|
| 5 |
"id": "initial_id",
|
| 6 |
"metadata": {
|
| 7 |
+
"collapsed": true,
|
| 8 |
+
"ExecuteTime": {
|
| 9 |
+
"end_time": "2024-11-18T17:27:45.765230Z",
|
| 10 |
+
"start_time": "2024-11-18T17:27:43.764041Z"
|
| 11 |
+
}
|
| 12 |
},
|
| 13 |
+
"source": [
|
| 14 |
+
"import pandas as pd\n",
|
| 15 |
+
"\n",
|
| 16 |
+
"df = pd.read_excel('demo.xlsx')"
|
| 17 |
+
],
|
| 18 |
"outputs": [],
|
| 19 |
+
"execution_count": 2
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"metadata": {
|
| 23 |
+
"ExecuteTime": {
|
| 24 |
+
"end_time": "2024-11-18T18:29:32.919196Z",
|
| 25 |
+
"start_time": "2024-11-18T18:29:32.841076Z"
|
| 26 |
+
}
|
| 27 |
+
},
|
| 28 |
+
"cell_type": "code",
|
| 29 |
+
"source": "df",
|
| 30 |
+
"id": "3fc9b282a2a5215d",
|
| 31 |
+
"outputs": [
|
| 32 |
+
{
|
| 33 |
+
"ename": "KeyError",
|
| 34 |
+
"evalue": "'impression'",
|
| 35 |
+
"output_type": "error",
|
| 36 |
+
"traceback": [
|
| 37 |
+
"\u001B[0;31m---------------------------------------------------------------------------\u001B[0m",
|
| 38 |
+
"\u001B[0;31mKeyError\u001B[0m Traceback (most recent call last)",
|
| 39 |
+
"File \u001B[0;32m/opt/anaconda3/lib/python3.11/site-packages/pandas/core/indexes/base.py:3805\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[0;34m(self, key)\u001B[0m\n\u001B[1;32m 3804\u001B[0m \u001B[38;5;28;01mtry\u001B[39;00m:\n\u001B[0;32m-> 3805\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_engine\u001B[38;5;241m.\u001B[39mget_loc(casted_key)\n\u001B[1;32m 3806\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m \u001B[38;5;28;01mas\u001B[39;00m err:\n",
|
| 40 |
+
"File \u001B[0;32mindex.pyx:167\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[0;34m()\u001B[0m\n",
|
| 41 |
+
"File \u001B[0;32mindex.pyx:196\u001B[0m, in \u001B[0;36mpandas._libs.index.IndexEngine.get_loc\u001B[0;34m()\u001B[0m\n",
|
| 42 |
+
"File \u001B[0;32mpandas/_libs/hashtable_class_helper.pxi:7081\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[0;34m()\u001B[0m\n",
|
| 43 |
+
"File \u001B[0;32mpandas/_libs/hashtable_class_helper.pxi:7089\u001B[0m, in \u001B[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001B[0;34m()\u001B[0m\n",
|
| 44 |
+
"\u001B[0;31mKeyError\u001B[0m: 'impression'",
|
| 45 |
+
"\nThe above exception was the direct cause of the following exception:\n",
|
| 46 |
+
"\u001B[0;31mKeyError\u001B[0m Traceback (most recent call last)",
|
| 47 |
+
"Cell \u001B[0;32mIn[21], line 1\u001B[0m\n\u001B[0;32m----> 1\u001B[0m df[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mimpression\u001B[39m\u001B[38;5;124m'\u001B[39m] \u001B[38;5;241m=\u001B[39m df[\u001B[38;5;124m'\u001B[39m\u001B[38;5;124mimpression\u001B[39m\u001B[38;5;124m'\u001B[39m]\u001B[38;5;241m.\u001B[39mstr\u001B[38;5;241m.\u001B[39mreplace(\u001B[38;5;124m'\u001B[39m\u001B[38;5;124m,\u001B[39m\u001B[38;5;124m'\u001B[39m, \u001B[38;5;124m'\u001B[39m\u001B[38;5;124m'\u001B[39m)\u001B[38;5;241m.\u001B[39mastype(\u001B[38;5;28mint\u001B[39m)\n",
|
| 48 |
+
"File \u001B[0;32m/opt/anaconda3/lib/python3.11/site-packages/pandas/core/frame.py:4102\u001B[0m, in \u001B[0;36mDataFrame.__getitem__\u001B[0;34m(self, key)\u001B[0m\n\u001B[1;32m 4100\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mnlevels \u001B[38;5;241m>\u001B[39m \u001B[38;5;241m1\u001B[39m:\n\u001B[1;32m 4101\u001B[0m \u001B[38;5;28;01mreturn\u001B[39;00m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_getitem_multilevel(key)\n\u001B[0;32m-> 4102\u001B[0m indexer \u001B[38;5;241m=\u001B[39m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39mcolumns\u001B[38;5;241m.\u001B[39mget_loc(key)\n\u001B[1;32m 4103\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m is_integer(indexer):\n\u001B[1;32m 4104\u001B[0m indexer \u001B[38;5;241m=\u001B[39m [indexer]\n",
|
| 49 |
+
"File \u001B[0;32m/opt/anaconda3/lib/python3.11/site-packages/pandas/core/indexes/base.py:3812\u001B[0m, in \u001B[0;36mIndex.get_loc\u001B[0;34m(self, key)\u001B[0m\n\u001B[1;32m 3807\u001B[0m \u001B[38;5;28;01mif\u001B[39;00m \u001B[38;5;28misinstance\u001B[39m(casted_key, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;129;01mor\u001B[39;00m (\n\u001B[1;32m 3808\u001B[0m \u001B[38;5;28misinstance\u001B[39m(casted_key, abc\u001B[38;5;241m.\u001B[39mIterable)\n\u001B[1;32m 3809\u001B[0m \u001B[38;5;129;01mand\u001B[39;00m \u001B[38;5;28many\u001B[39m(\u001B[38;5;28misinstance\u001B[39m(x, \u001B[38;5;28mslice\u001B[39m) \u001B[38;5;28;01mfor\u001B[39;00m x \u001B[38;5;129;01min\u001B[39;00m casted_key)\n\u001B[1;32m 3810\u001B[0m ):\n\u001B[1;32m 3811\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m InvalidIndexError(key)\n\u001B[0;32m-> 3812\u001B[0m \u001B[38;5;28;01mraise\u001B[39;00m \u001B[38;5;167;01mKeyError\u001B[39;00m(key) \u001B[38;5;28;01mfrom\u001B[39;00m \u001B[38;5;21;01merr\u001B[39;00m\n\u001B[1;32m 3813\u001B[0m \u001B[38;5;28;01mexcept\u001B[39;00m \u001B[38;5;167;01mTypeError\u001B[39;00m:\n\u001B[1;32m 3814\u001B[0m \u001B[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001B[39;00m\n\u001B[1;32m 3815\u001B[0m \u001B[38;5;66;03m# InvalidIndexError. Otherwise we fall through and re-raise\u001B[39;00m\n\u001B[1;32m 3816\u001B[0m \u001B[38;5;66;03m# the TypeError.\u001B[39;00m\n\u001B[1;32m 3817\u001B[0m \u001B[38;5;28mself\u001B[39m\u001B[38;5;241m.\u001B[39m_check_indexing_error(key)\n",
|
| 50 |
+
"\u001B[0;31mKeyError\u001B[0m: 'impression'"
|
| 51 |
+
]
|
| 52 |
+
}
|
| 53 |
+
],
|
| 54 |
+
"execution_count": 21
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"metadata": {
|
| 58 |
+
"ExecuteTime": {
|
| 59 |
+
"end_time": "2024-11-18T18:30:20.773902Z",
|
| 60 |
+
"start_time": "2024-11-18T18:30:20.766806Z"
|
| 61 |
+
}
|
| 62 |
+
},
|
| 63 |
+
"cell_type": "code",
|
| 64 |
"source": [
|
| 65 |
+
"# Grab the Column E\n",
|
| 66 |
+
"impression_column = df.iloc[:, 4]\n",
|
| 67 |
+
"total_impressions = impression_column[impression_column.shift(-1).isna()].iloc[0]\n",
|
| 68 |
+
"\n",
|
| 69 |
+
"total_impressions\n"
|
| 70 |
+
],
|
| 71 |
+
"id": "76eb4775dda9b64c",
|
| 72 |
+
"outputs": [
|
| 73 |
+
{
|
| 74 |
+
"data": {
|
| 75 |
+
"text/plain": [
|
| 76 |
+
"71796.3"
|
| 77 |
+
]
|
| 78 |
+
},
|
| 79 |
+
"execution_count": 23,
|
| 80 |
+
"metadata": {},
|
| 81 |
+
"output_type": "execute_result"
|
| 82 |
+
}
|
| 83 |
+
],
|
| 84 |
+
"execution_count": 23
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"metadata": {
|
| 88 |
+
"ExecuteTime": {
|
| 89 |
+
"end_time": "2024-11-18T17:35:53.956689Z",
|
| 90 |
+
"start_time": "2024-11-18T17:35:53.939722Z"
|
| 91 |
+
}
|
| 92 |
+
},
|
| 93 |
+
"cell_type": "code",
|
| 94 |
+
"source": "",
|
| 95 |
+
"id": "388149da2aba2a39",
|
| 96 |
+
"outputs": [
|
| 97 |
+
{
|
| 98 |
+
"data": {
|
| 99 |
+
"text/plain": [
|
| 100 |
+
" Addresses Sum of New Road Duration (Mins) \\\n",
|
| 101 |
+
"27 Total 16041.4 \n",
|
| 102 |
+
"30 Target (Total Campaigns) 144000 \n",
|
| 103 |
+
"34 Target (Total Campaigns) 2400 \n",
|
| 104 |
+
"45 Total 16041.4 \n",
|
| 105 |
+
"52 Total 16041.4 \n",
|
| 106 |
+
"59 Total 16041.4 \n",
|
| 107 |
+
"65 Total 16041.4 \n",
|
| 108 |
+
"73 Total 16041.4 \n",
|
| 109 |
+
"80 Total 15180 \n",
|
| 110 |
+
"88 Total 16041.4 \n",
|
| 111 |
+
"93 Total 16041.4 \n",
|
| 112 |
+
"\n",
|
| 113 |
+
" Sum of New Road Duration (Hours) % Impression %.1 Unnamed: 6 \\\n",
|
| 114 |
+
"27 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 115 |
+
"30 100% NaN NaN NaN NaN \n",
|
| 116 |
+
"34 100 NaN NaN NaN NaN \n",
|
| 117 |
+
"45 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 118 |
+
"52 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 119 |
+
"59 21915.9 115628 400% NaN Total \n",
|
| 120 |
+
"65 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 121 |
+
"73 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 122 |
+
"80 253 100.0% 67497.1 100.0% NaN \n",
|
| 123 |
+
"88 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 124 |
+
"93 267.4 100.0% 71796.3 100.0% NaN \n",
|
| 125 |
+
"\n",
|
| 126 |
+
" Addresses.1 Sum of Idle Final (Mins) Sum of Idle Final (Hours) %.2 \n",
|
| 127 |
+
"27 Total 21915.9 365.3 100.0% \n",
|
| 128 |
+
"30 Idle Time 21915.866667 NaN NaN \n",
|
| 129 |
+
"34 NaN NaN NaN NaN \n",
|
| 130 |
+
"45 Total 21915.9 365.3 100.0% \n",
|
| 131 |
+
"52 Total 21915.9 365.3 100.0% \n",
|
| 132 |
+
"59 16041.4 21915.9 115628 400% \n",
|
| 133 |
+
"65 Total 21915.9 365.3 100.0% \n",
|
| 134 |
+
"73 Total 21915.9 365.3 100.0% \n",
|
| 135 |
+
"80 Total 21228.8 353.8 100.0% \n",
|
| 136 |
+
"88 Total 21915.9 365.3 100.0% \n",
|
| 137 |
+
"93 Total 21915.9 365.3 100.0% "
|
| 138 |
+
],
|
| 139 |
+
"text/html": [
|
| 140 |
+
"<div>\n",
|
| 141 |
+
"<style scoped>\n",
|
| 142 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 143 |
+
" vertical-align: middle;\n",
|
| 144 |
+
" }\n",
|
| 145 |
+
"\n",
|
| 146 |
+
" .dataframe tbody tr th {\n",
|
| 147 |
+
" vertical-align: top;\n",
|
| 148 |
+
" }\n",
|
| 149 |
+
"\n",
|
| 150 |
+
" .dataframe thead th {\n",
|
| 151 |
+
" text-align: right;\n",
|
| 152 |
+
" }\n",
|
| 153 |
+
"</style>\n",
|
| 154 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 155 |
+
" <thead>\n",
|
| 156 |
+
" <tr style=\"text-align: right;\">\n",
|
| 157 |
+
" <th></th>\n",
|
| 158 |
+
" <th>Addresses</th>\n",
|
| 159 |
+
" <th>Sum of New Road Duration (Mins)</th>\n",
|
| 160 |
+
" <th>Sum of New Road Duration (Hours)</th>\n",
|
| 161 |
+
" <th>%</th>\n",
|
| 162 |
+
" <th>Impression</th>\n",
|
| 163 |
+
" <th>%.1</th>\n",
|
| 164 |
+
" <th>Unnamed: 6</th>\n",
|
| 165 |
+
" <th>Addresses.1</th>\n",
|
| 166 |
+
" <th>Sum of Idle Final (Mins)</th>\n",
|
| 167 |
+
" <th>Sum of Idle Final (Hours)</th>\n",
|
| 168 |
+
" <th>%.2</th>\n",
|
| 169 |
+
" </tr>\n",
|
| 170 |
+
" </thead>\n",
|
| 171 |
+
" <tbody>\n",
|
| 172 |
+
" <tr>\n",
|
| 173 |
+
" <th>27</th>\n",
|
| 174 |
+
" <td>Total</td>\n",
|
| 175 |
+
" <td>16041.4</td>\n",
|
| 176 |
+
" <td>267.4</td>\n",
|
| 177 |
+
" <td>100.0%</td>\n",
|
| 178 |
+
" <td>71796.3</td>\n",
|
| 179 |
+
" <td>100.0%</td>\n",
|
| 180 |
+
" <td>NaN</td>\n",
|
| 181 |
+
" <td>Total</td>\n",
|
| 182 |
+
" <td>21915.9</td>\n",
|
| 183 |
+
" <td>365.3</td>\n",
|
| 184 |
+
" <td>100.0%</td>\n",
|
| 185 |
+
" </tr>\n",
|
| 186 |
+
" <tr>\n",
|
| 187 |
+
" <th>30</th>\n",
|
| 188 |
+
" <td>Target (Total Campaigns)</td>\n",
|
| 189 |
+
" <td>144000</td>\n",
|
| 190 |
+
" <td>100%</td>\n",
|
| 191 |
+
" <td>NaN</td>\n",
|
| 192 |
+
" <td>NaN</td>\n",
|
| 193 |
+
" <td>NaN</td>\n",
|
| 194 |
+
" <td>NaN</td>\n",
|
| 195 |
+
" <td>Idle Time</td>\n",
|
| 196 |
+
" <td>21915.866667</td>\n",
|
| 197 |
+
" <td>NaN</td>\n",
|
| 198 |
+
" <td>NaN</td>\n",
|
| 199 |
+
" </tr>\n",
|
| 200 |
+
" <tr>\n",
|
| 201 |
+
" <th>34</th>\n",
|
| 202 |
+
" <td>Target (Total Campaigns)</td>\n",
|
| 203 |
+
" <td>2400</td>\n",
|
| 204 |
+
" <td>100</td>\n",
|
| 205 |
+
" <td>NaN</td>\n",
|
| 206 |
+
" <td>NaN</td>\n",
|
| 207 |
+
" <td>NaN</td>\n",
|
| 208 |
+
" <td>NaN</td>\n",
|
| 209 |
+
" <td>NaN</td>\n",
|
| 210 |
+
" <td>NaN</td>\n",
|
| 211 |
+
" <td>NaN</td>\n",
|
| 212 |
+
" <td>NaN</td>\n",
|
| 213 |
+
" </tr>\n",
|
| 214 |
+
" <tr>\n",
|
| 215 |
+
" <th>45</th>\n",
|
| 216 |
+
" <td>Total</td>\n",
|
| 217 |
+
" <td>16041.4</td>\n",
|
| 218 |
+
" <td>267.4</td>\n",
|
| 219 |
+
" <td>100.0%</td>\n",
|
| 220 |
+
" <td>71796.3</td>\n",
|
| 221 |
+
" <td>100.0%</td>\n",
|
| 222 |
+
" <td>NaN</td>\n",
|
| 223 |
+
" <td>Total</td>\n",
|
| 224 |
+
" <td>21915.9</td>\n",
|
| 225 |
+
" <td>365.3</td>\n",
|
| 226 |
+
" <td>100.0%</td>\n",
|
| 227 |
+
" </tr>\n",
|
| 228 |
+
" <tr>\n",
|
| 229 |
+
" <th>52</th>\n",
|
| 230 |
+
" <td>Total</td>\n",
|
| 231 |
+
" <td>16041.4</td>\n",
|
| 232 |
+
" <td>267.4</td>\n",
|
| 233 |
+
" <td>100.0%</td>\n",
|
| 234 |
+
" <td>71796.3</td>\n",
|
| 235 |
+
" <td>100.0%</td>\n",
|
| 236 |
+
" <td>NaN</td>\n",
|
| 237 |
+
" <td>Total</td>\n",
|
| 238 |
+
" <td>21915.9</td>\n",
|
| 239 |
+
" <td>365.3</td>\n",
|
| 240 |
+
" <td>100.0%</td>\n",
|
| 241 |
+
" </tr>\n",
|
| 242 |
+
" <tr>\n",
|
| 243 |
+
" <th>59</th>\n",
|
| 244 |
+
" <td>Total</td>\n",
|
| 245 |
+
" <td>16041.4</td>\n",
|
| 246 |
+
" <td>21915.9</td>\n",
|
| 247 |
+
" <td>115628</td>\n",
|
| 248 |
+
" <td>400%</td>\n",
|
| 249 |
+
" <td>NaN</td>\n",
|
| 250 |
+
" <td>Total</td>\n",
|
| 251 |
+
" <td>16041.4</td>\n",
|
| 252 |
+
" <td>21915.9</td>\n",
|
| 253 |
+
" <td>115628</td>\n",
|
| 254 |
+
" <td>400%</td>\n",
|
| 255 |
+
" </tr>\n",
|
| 256 |
+
" <tr>\n",
|
| 257 |
+
" <th>65</th>\n",
|
| 258 |
+
" <td>Total</td>\n",
|
| 259 |
+
" <td>16041.4</td>\n",
|
| 260 |
+
" <td>267.4</td>\n",
|
| 261 |
+
" <td>100.0%</td>\n",
|
| 262 |
+
" <td>71796.3</td>\n",
|
| 263 |
+
" <td>100.0%</td>\n",
|
| 264 |
+
" <td>NaN</td>\n",
|
| 265 |
+
" <td>Total</td>\n",
|
| 266 |
+
" <td>21915.9</td>\n",
|
| 267 |
+
" <td>365.3</td>\n",
|
| 268 |
+
" <td>100.0%</td>\n",
|
| 269 |
+
" </tr>\n",
|
| 270 |
+
" <tr>\n",
|
| 271 |
+
" <th>73</th>\n",
|
| 272 |
+
" <td>Total</td>\n",
|
| 273 |
+
" <td>16041.4</td>\n",
|
| 274 |
+
" <td>267.4</td>\n",
|
| 275 |
+
" <td>100.0%</td>\n",
|
| 276 |
+
" <td>71796.3</td>\n",
|
| 277 |
+
" <td>100.0%</td>\n",
|
| 278 |
+
" <td>NaN</td>\n",
|
| 279 |
+
" <td>Total</td>\n",
|
| 280 |
+
" <td>21915.9</td>\n",
|
| 281 |
+
" <td>365.3</td>\n",
|
| 282 |
+
" <td>100.0%</td>\n",
|
| 283 |
+
" </tr>\n",
|
| 284 |
+
" <tr>\n",
|
| 285 |
+
" <th>80</th>\n",
|
| 286 |
+
" <td>Total</td>\n",
|
| 287 |
+
" <td>15180</td>\n",
|
| 288 |
+
" <td>253</td>\n",
|
| 289 |
+
" <td>100.0%</td>\n",
|
| 290 |
+
" <td>67497.1</td>\n",
|
| 291 |
+
" <td>100.0%</td>\n",
|
| 292 |
+
" <td>NaN</td>\n",
|
| 293 |
+
" <td>Total</td>\n",
|
| 294 |
+
" <td>21228.8</td>\n",
|
| 295 |
+
" <td>353.8</td>\n",
|
| 296 |
+
" <td>100.0%</td>\n",
|
| 297 |
+
" </tr>\n",
|
| 298 |
+
" <tr>\n",
|
| 299 |
+
" <th>88</th>\n",
|
| 300 |
+
" <td>Total</td>\n",
|
| 301 |
+
" <td>16041.4</td>\n",
|
| 302 |
+
" <td>267.4</td>\n",
|
| 303 |
+
" <td>100.0%</td>\n",
|
| 304 |
+
" <td>71796.3</td>\n",
|
| 305 |
+
" <td>100.0%</td>\n",
|
| 306 |
+
" <td>NaN</td>\n",
|
| 307 |
+
" <td>Total</td>\n",
|
| 308 |
+
" <td>21915.9</td>\n",
|
| 309 |
+
" <td>365.3</td>\n",
|
| 310 |
+
" <td>100.0%</td>\n",
|
| 311 |
+
" </tr>\n",
|
| 312 |
+
" <tr>\n",
|
| 313 |
+
" <th>93</th>\n",
|
| 314 |
+
" <td>Total</td>\n",
|
| 315 |
+
" <td>16041.4</td>\n",
|
| 316 |
+
" <td>267.4</td>\n",
|
| 317 |
+
" <td>100.0%</td>\n",
|
| 318 |
+
" <td>71796.3</td>\n",
|
| 319 |
+
" <td>100.0%</td>\n",
|
| 320 |
+
" <td>NaN</td>\n",
|
| 321 |
+
" <td>Total</td>\n",
|
| 322 |
+
" <td>21915.9</td>\n",
|
| 323 |
+
" <td>365.3</td>\n",
|
| 324 |
+
" <td>100.0%</td>\n",
|
| 325 |
+
" </tr>\n",
|
| 326 |
+
" </tbody>\n",
|
| 327 |
+
"</table>\n",
|
| 328 |
+
"</div>"
|
| 329 |
+
]
|
| 330 |
+
},
|
| 331 |
+
"execution_count": 10,
|
| 332 |
+
"metadata": {},
|
| 333 |
+
"output_type": "execute_result"
|
| 334 |
+
}
|
| 335 |
+
],
|
| 336 |
+
"execution_count": 10
|
| 337 |
+
},
|
| 338 |
+
{
|
| 339 |
+
"metadata": {},
|
| 340 |
+
"cell_type": "code",
|
| 341 |
+
"outputs": [],
|
| 342 |
+
"execution_count": null,
|
| 343 |
+
"source": "",
|
| 344 |
+
"id": "7e4bdb4279ac698d"
|
| 345 |
}
|
| 346 |
],
|
| 347 |
"metadata": {
|
processor.py
CHANGED
|
@@ -18,6 +18,9 @@ class Processor:
|
|
| 18 |
def load_data(self, file):
|
| 19 |
self.df = pd.read_excel(file)
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
def process(self):
|
| 23 |
pass
|
|
|
|
| 18 |
def load_data(self, file):
|
| 19 |
self.df = pd.read_excel(file)
|
| 20 |
|
| 21 |
+
impression_column = self.df.iloc[:, 4]
|
| 22 |
+
self.total_impressions = impression_column[impression_column.shift(-1).isna()].iloc[0]
|
| 23 |
+
|
| 24 |
|
| 25 |
def process(self):
|
| 26 |
pass
|