System save at 13/10/2024 23:59 by user_client2024

This commit is contained in:
user_client2024 2024-10-13 18:29:38 +00:00
parent 9a36694f7f
commit c1627a1c91
3 changed files with 24 additions and 151 deletions

View File

@ -2,72 +2,12 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"id": "90c70e46-71a0-44a6-8090-f53aad3193c3",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Query start time: 2024-10-13 18:13:45.509982\n",
"Query end time: 2024-10-13 18:13:45.944136\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>START_DATE_TIME</th>\n",
" <th>END_DATE_TIME</th>\n",
" <th>FOCAL_ID</th>\n",
" <th>MIN_PRICE</th>\n",
" <th>MAX_PRICE</th>\n",
" <th>PRICE_CHANGE (%)</th>\n",
" <th>PARTICIPANT_VOLUME</th>\n",
" <th>TOTAL_VOLUME</th>\n",
" <th>VOLUME (%)</th>\n",
" <th>PARTICIPANT_VOLUME_PCT</th>\n",
" <th>Segment</th>\n",
" <th>SAR_FLAG</th>\n",
" <th>Risk</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [START_DATE_TIME, END_DATE_TIME, FOCAL_ID, MIN_PRICE, MAX_PRICE, PRICE_CHANGE (%), PARTICIPANT_VOLUME, TOTAL_VOLUME, VOLUME (%), PARTICIPANT_VOLUME_PCT, Segment, SAR_FLAG, Risk]\n",
"Index: []"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"from datetime import datetime\n",
"import pandas as pd\n",
@ -171,35 +111,28 @@
" return final_scenario_df\n",
"\n",
"\n",
"# Instantiate and execute logic\n",
"scenario = Scenario()\n",
"scenario.logic(validation_window=1000)\n"
"\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"id": "caee5554-5254-4388-bf24-029281d77890",
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "unsupported operand type(s) for /: 'NoneType' and 'int'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[6], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m scenario \u001b[38;5;241m=\u001b[39m Scenario()\n\u001b[0;32m----> 2\u001b[0m \u001b[43mscenario\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlogic\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"Cell \u001b[0;32mIn[4], line 60\u001b[0m, in \u001b[0;36mScenario.logic\u001b[0;34m(self, **kwargs)\u001b[0m\n\u001b[1;32m 58\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mlogic\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 59\u001b[0m validation_window \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mvalidation_window\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m---> 60\u001b[0m time_window_s \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mint\u001b[39m(\u001b[43mvalidation_window\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m/\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m1000\u001b[39;49m)\n\u001b[1;32m 62\u001b[0m query_start_time \u001b[38;5;241m=\u001b[39m datetime\u001b[38;5;241m.\u001b[39mnow()\n\u001b[1;32m 63\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mQuery start time:\u001b[39m\u001b[38;5;124m\"\u001b[39m, query_start_time)\n",
"\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for /: 'NoneType' and 'int'"
]
}
],
"outputs": [],
"source": [
"# Instantiate and execute logic\n",
"scenario = Scenario()\n",
"scenario.logic(validation_window=1000)"
"#scenario = Scenario()\n",
"#scenario.logic(validation_window=1000)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1feaf267-88d1-41b8-a8b9-f150b7ff16cd",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {

View File

@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "90c70e46-71a0-44a6-8090-f53aad3193c3",
"metadata": {
"tags": []
@ -116,74 +116,14 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 5,
"id": "caee5554-5254-4388-bf24-029281d77890",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Query start time: 2024-10-13 18:14:29.793521\n",
"Query end time: 2024-10-13 18:14:29.933772\n"
]
},
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>START_DATE_TIME</th>\n",
" <th>END_DATE_TIME</th>\n",
" <th>FOCAL_ID</th>\n",
" <th>MIN_PRICE</th>\n",
" <th>MAX_PRICE</th>\n",
" <th>PRICE_CHANGE (%)</th>\n",
" <th>PARTICIPANT_VOLUME</th>\n",
" <th>TOTAL_VOLUME</th>\n",
" <th>VOLUME (%)</th>\n",
" <th>PARTICIPANT_VOLUME_PCT</th>\n",
" <th>Segment</th>\n",
" <th>SAR_FLAG</th>\n",
" <th>Risk</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [START_DATE_TIME, END_DATE_TIME, FOCAL_ID, MIN_PRICE, MAX_PRICE, PRICE_CHANGE (%), PARTICIPANT_VOLUME, TOTAL_VOLUME, VOLUME (%), PARTICIPANT_VOLUME_PCT, Segment, SAR_FLAG, Risk]\n",
"Index: []"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# Instantiate and execute logic\n",
"scenario = Scenario()\n",
"scenario.logic(validation_window=1000)"
"#scenario = Scenario()\n",
"#scenario.logic(validation_window=1000)"
]
},
{

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# coding: utf-8
# In[3]:
# In[4]:
from datetime import datetime
@ -109,12 +109,12 @@ class Scenario:
# In[2]:
# In[5]:
# Instantiate and execute logic
scenario = Scenario()
scenario.logic(validation_window=1000)
#scenario = Scenario()
#scenario.logic(validation_window=1000)
# In[ ]: