Spaces:
Sleeping
Sleeping
Commit ·
a55ae21
1
Parent(s): 26a34b0
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .DS_Store +0 -0
- .gitattributes +5 -0
- .gitignore +105 -0
- README.md +2 -8
- TODO +1 -0
- __pycache__/modal_intro.cpython-38.pyc +0 -0
- app.py +175 -0
- build/lib/src/__init__.py +0 -0
- build/lib/src/data/__init__.py +0 -0
- build/lib/src/data/data_splitter.py +58 -0
- build/lib/src/data/dataset_reader.py +22 -0
- build/lib/src/data/eda.py +44 -0
- build/lib/src/data/feature_engineering.py +286 -0
- build/lib/src/data/normalization.py +21 -0
- build/lib/src/data/utils.py +30 -0
- build/lib/src/evaluation.py +14 -0
- build/lib/src/models/__init__.py +0 -0
- build/lib/src/models/loss.py +40 -0
- build/lib/src/models/nn.py +50 -0
- build/lib/src/pricing/__init__.py +0 -0
- build/lib/src/pricing/pricing.py +53 -0
- csv_files.txt +8 -0
- data/.DS_Store +0 -0
- data/Question_list.md +54 -0
- data/processed/optimal_prices.csv +0 -0
- data/processed/predictions.csv +0 -0
- data/processed/test.pkl +3 -0
- data/processed/train.pkl +3 -0
- data/raw/.DS_Store +0 -0
- data/raw/Amazon_Sale_Report.csv +3 -0
- data/raw/Cloud Warehouse Compersion Chart.csv +51 -0
- data/raw/Expense IIGF.csv +18 -0
- data/raw/International sale Report.csv +0 -0
- data/raw/May-2022.csv +0 -0
- data/raw/PLMarch2021.csv +0 -0
- data/raw/Sale Report.csv +0 -0
- dist/Relu_project-0.0.0-py3.9.egg +0 -0
- environment.yml +130 -0
- modal_intro.py +14 -0
- notebooks/allbooks.ipynb +1849 -0
- notebooks/amazon_sales copy.ipynb +1245 -0
- notebooks/amazon_sales.ipynb +985 -0
- notebooks/amazon_sales_v2.ipynb +3 -0
- notebooks/dashboard.ipynb +0 -0
- notebooks/data.ipynb +0 -0
- notebooks/fake_data_v0.ipynb +1144 -0
- notebooks/feature_engineering.log +45 -0
- notebooks/flagged/log.csv +2 -0
- notebooks/flagged/output/tmp84kb_gvd.json +1 -0
- reports/log.txt +1012 -0
.DS_Store
ADDED
|
Binary file (8.2 kB). View file
|
|
|
.gitattributes
CHANGED
|
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
data/raw/Amazon_Sale_Report.csv filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
notebooks/amazon_sales_v2.ipynb filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
reports/your_report.html filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
reports/your_report_v2.html filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
reports/your_report_v3.html filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ignore pyc files
|
| 2 |
+
**/*.pyc
|
| 3 |
+
# Byte-compiled / optimized / DLL files
|
| 4 |
+
__pycache__/
|
| 5 |
+
*.py[cod]
|
| 6 |
+
*$py.class
|
| 7 |
+
|
| 8 |
+
.vscode/
|
| 9 |
+
# ignore .pyc files
|
| 10 |
+
*.pyc
|
| 11 |
+
|
| 12 |
+
# C extensions
|
| 13 |
+
*.so
|
| 14 |
+
/.coverage
|
| 15 |
+
/.mypy_cache/
|
| 16 |
+
/.nox/
|
| 17 |
+
/.python-version
|
| 18 |
+
/.pytype/
|
| 19 |
+
/docs/_build/
|
| 20 |
+
/src/*.egg-info/
|
| 21 |
+
__pycache__/
|
| 22 |
+
**/*.csv
|
| 23 |
+
**/*.xlsx
|
| 24 |
+
/*.json
|
| 25 |
+
**/*.xlsx
|
| 26 |
+
**.egg-info/
|
| 27 |
+
|
| 28 |
+
/*.DS_Store
|
| 29 |
+
|
| 30 |
+
# Distribution / packaging
|
| 31 |
+
.Python
|
| 32 |
+
build/
|
| 33 |
+
develop-eggs/
|
| 34 |
+
dist/
|
| 35 |
+
downloads/
|
| 36 |
+
eggs/
|
| 37 |
+
.eggs/
|
| 38 |
+
lib/
|
| 39 |
+
lib64/
|
| 40 |
+
parts/
|
| 41 |
+
sdist/
|
| 42 |
+
var/
|
| 43 |
+
wheels/
|
| 44 |
+
pip-wheel-metadata/
|
| 45 |
+
share/python-wheels/
|
| 46 |
+
*.egg-info/
|
| 47 |
+
.installed.cfg
|
| 48 |
+
*.egg
|
| 49 |
+
MANIFEST
|
| 50 |
+
|
| 51 |
+
# PyInstaller
|
| 52 |
+
# Usually these files are written by a python script from a template
|
| 53 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 54 |
+
*.manifest
|
| 55 |
+
*.spec
|
| 56 |
+
|
| 57 |
+
# Installer logs
|
| 58 |
+
pip-log.txt
|
| 59 |
+
pip-delete-this-directory.txt
|
| 60 |
+
|
| 61 |
+
# Unit test / coverage reports
|
| 62 |
+
htmlcov/
|
| 63 |
+
.tox/
|
| 64 |
+
.nox/
|
| 65 |
+
.coverage
|
| 66 |
+
.coverage.*
|
| 67 |
+
.cache
|
| 68 |
+
nosetests.xml
|
| 69 |
+
coverage.xml
|
| 70 |
+
*.cover
|
| 71 |
+
*.py,cover
|
| 72 |
+
.hypothesis/
|
| 73 |
+
.pytest_cache/
|
| 74 |
+
|
| 75 |
+
# Translations
|
| 76 |
+
*.mo
|
| 77 |
+
*.pot
|
| 78 |
+
|
| 79 |
+
# Django stuff:
|
| 80 |
+
*.log
|
| 81 |
+
local_settings.py
|
| 82 |
+
db.sqlite3
|
| 83 |
+
db.sqlite3-journal
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
# Jupyter Notebook
|
| 87 |
+
.ipynb_checkpoints
|
| 88 |
+
|
| 89 |
+
# IPython
|
| 90 |
+
profile_default/
|
| 91 |
+
ipython_config.py
|
| 92 |
+
|
| 93 |
+
# pyenv
|
| 94 |
+
.python-version
|
| 95 |
+
|
| 96 |
+
# pipenv
|
| 97 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 98 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 99 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 100 |
+
# install all needed dependencies.
|
| 101 |
+
#Pipfile.lock
|
| 102 |
+
|
| 103 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
| 104 |
+
__pypackages__/
|
| 105 |
+
|
README.md
CHANGED
|
@@ -1,12 +1,6 @@
|
|
| 1 |
---
|
| 2 |
title: Relu
|
| 3 |
-
emoji: 🦀
|
| 4 |
-
colorFrom: purple
|
| 5 |
-
colorTo: gray
|
| 6 |
-
sdk: gradio
|
| 7 |
-
sdk_version: 3.36.1
|
| 8 |
app_file: app.py
|
| 9 |
-
|
|
|
|
| 10 |
---
|
| 11 |
-
|
| 12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
title: Relu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
app_file: app.py
|
| 4 |
+
sdk: gradio
|
| 5 |
+
sdk_version: 3.35.2
|
| 6 |
---
|
|
|
|
|
|
TODO
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Update README
|
__pycache__/modal_intro.cpython-38.pyc
ADDED
|
Binary file (529 Bytes). View file
|
|
|
app.py
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# load datasets
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import gradio as gr
|
| 4 |
+
import pandas as pd
|
| 5 |
+
|
| 6 |
+
import random
|
| 7 |
+
import plotly.graph_objs as go
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
predictions = pd.read_csv("/data/processed/predictions.csv")
|
| 11 |
+
optimal_prices = pd.read_csv("/data/processed/optimal_prices.csv")
|
| 12 |
+
amazon = pd.read_csv("/data/raw/Amazon_Sale_Report.csv")
|
| 13 |
+
pl = pd.read_csv("/data/raw/PLMarch2021.csv")
|
| 14 |
+
|
| 15 |
+
predictions = predictions.merge(amazon[['SKU', 'Category']], on='SKU', how='left')
|
| 16 |
+
|
| 17 |
+
# rename sku column to match optimal prices
|
| 18 |
+
pl.rename(columns={'Sku': 'SKU'}, inplace=True)
|
| 19 |
+
|
| 20 |
+
# write and an underscore on whitespace for every column in pl dataframe
|
| 21 |
+
pl.columns = pl.columns.str.replace(' ', '_')
|
| 22 |
+
|
| 23 |
+
pl.Category.rename({'Kurta': 'kurta', 'Kurta Set':'kurta', 'Gown':'Ethnic Dress', 'Tops':'Set','Nill':'Top' }, inplace=True)
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
competitor_columns = ['Amazon_MRP', 'Flipkart_MRP', 'Ajio_MRP', 'Limeroad_MRP', 'Myntra_MRP', 'Paytm_MRP', 'Snapdeal_MRP']
|
| 27 |
+
from src.data.utils import Utils
|
| 28 |
+
# convert to int the competitor_columns in the pl dataframe
|
| 29 |
+
for col in competitor_columns:
|
| 30 |
+
pl[col] = pl[col].apply(Utils.convert_to_int)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
unique_skus = sorted(predictions['SKU'].unique())
|
| 35 |
+
unique_category = sorted(pl['Category'].unique())
|
| 36 |
+
|
| 37 |
+
def plot_demand_curve_gradio(sku):
|
| 38 |
+
# Load the predictions dataframe
|
| 39 |
+
#predictions = pd.read_csv('../data/processed/predictions.csv')
|
| 40 |
+
|
| 41 |
+
# Select the predictions for the given SKU
|
| 42 |
+
sku_predictions = predictions[predictions['SKU'] == sku]
|
| 43 |
+
|
| 44 |
+
# Create a scatter plot of the predicted sales against the price points
|
| 45 |
+
fig = go.Figure()
|
| 46 |
+
fig.add_trace(go.Scatter(x=sku_predictions['price'], y=sku_predictions['predicted_sales_xgboost'], mode='lines+markers'))
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
# Set the plot title and axis labels
|
| 50 |
+
fig.update_layout(title=f'Demand Curve for SKU {sku}', xaxis_title='Price', yaxis_title='Predicted Sales')
|
| 51 |
+
fig.update_xaxes(title_font=dict(size=18), tickfont=dict(size=14))
|
| 52 |
+
fig.update_yaxes(title_font=dict(size=18), tickfont=dict(size=14))
|
| 53 |
+
|
| 54 |
+
# Set the legend font size and position
|
| 55 |
+
fig.update_layout(legend=dict(font=dict(size=14), yanchor='top', y=0.99, xanchor='left', x=0.01), legend_title_text='SKU')
|
| 56 |
+
|
| 57 |
+
# Set the plot background color and grid lines
|
| 58 |
+
fig.update_layout(plot_bgcolor='white', xaxis=dict(showgrid=True, gridcolor='lightgray'), yaxis=dict(showgrid=True, gridcolor='lightgray'))
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
# Return the plot as an HTML div
|
| 62 |
+
return gr.update(value=fig, visible=True)
|
| 63 |
+
|
| 64 |
+
def plot_optimal_prices_gradio(sku):
|
| 65 |
+
# Load the optimal prices dataframe
|
| 66 |
+
#optimal_prices = pd.read_csv('../data/processed/optimal_prices.csv')
|
| 67 |
+
|
| 68 |
+
# Select the optimal prices for the given SKU
|
| 69 |
+
sku_optimal_prices = optimal_prices[optimal_prices['SKU'] == sku]
|
| 70 |
+
|
| 71 |
+
# Create a bar chart of the optimal prices at different price points
|
| 72 |
+
fig = go.Figure()
|
| 73 |
+
fig.add_trace(go.Bar(x=['Base Price', '-10%', '-15%', '+10%', '+15%'], y=sku_optimal_prices['optimal_prices'], name=sku))
|
| 74 |
+
|
| 75 |
+
# Set the plot title and axis labels
|
| 76 |
+
fig.update_layout(title=f'Optimal Prices for SKU {sku}', xaxis_title='Price Point', yaxis_title='Optimal Price', font=dict(size=14))
|
| 77 |
+
fig.update_xaxes(title_font=dict(size=18), tickfont=dict(size=14))
|
| 78 |
+
fig.update_yaxes(title_font=dict(size=18), tickfont=dict(size=14))
|
| 79 |
+
|
| 80 |
+
# Set the plot background color and grid lines
|
| 81 |
+
fig.update_layout(plot_bgcolor='white', xaxis=dict(showgrid=True, gridcolor='lightgray'), yaxis=dict(showgrid=True, gridcolor='lightgray'))
|
| 82 |
+
|
| 83 |
+
# Return the plot as an HTML div
|
| 84 |
+
return gr.update(value=fig, visible=True)
|
| 85 |
+
|
| 86 |
+
def plot_competitors_prices_gradio(category):
|
| 87 |
+
|
| 88 |
+
sku_competitors_results = pl[pl['Category'] == category]
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
# Calculate average prices for each competitor within the selected category
|
| 92 |
+
competitor_columns = ['Amazon_MRP', 'Flipkart_MRP', 'Ajio_MRP', 'Limeroad_MRP', 'Myntra_MRP', 'Paytm_MRP', 'Snapdeal_MRP']
|
| 93 |
+
avg_prices = [sku_competitors_results[col].median() for col in competitor_columns]
|
| 94 |
+
|
| 95 |
+
# Create a bar chart of the average competitors prices
|
| 96 |
+
fig = go.Figure()
|
| 97 |
+
fig.add_trace(go.Bar(x=competitor_columns, y=avg_prices, name=category))
|
| 98 |
+
|
| 99 |
+
# set the plot title and axis labels
|
| 100 |
+
fig.update_layout(title=f'Competitors Prices for Category {category}', xaxis_title='Competitor', yaxis_title='Median Price', font=dict(size=14))
|
| 101 |
+
fig.update_xaxes(title_font=dict(size=18), tickfont=dict(size=14))
|
| 102 |
+
fig.update_yaxes(title_font=dict(size=18), tickfont=dict(size=14))
|
| 103 |
+
|
| 104 |
+
# Set the plot background color and grid lines
|
| 105 |
+
fig.update_layout(plot_bgcolor='white', xaxis=dict(showgrid=True, gridcolor='lightgray'), yaxis=dict(showgrid=True, gridcolor='lightgray'))
|
| 106 |
+
|
| 107 |
+
# return the plot as an HTML div
|
| 108 |
+
return gr.update(value=fig, visible=True)
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
with gr.Blocks() as demo:
|
| 114 |
+
gr.Markdown("""
|
| 115 |
+
# Relu Demand Curve & Optimal Pricing Dashboard 💰 #
|
| 116 |
+
|
| 117 |
+
Version: 1.0.0
|
| 118 |
+
|
| 119 |
+
Enter Values below then click Predict and Pricing Buttons to see results.
|
| 120 |
+
|
| 121 |
+
""")
|
| 122 |
+
with gr.Row(equal_height=True):
|
| 123 |
+
|
| 124 |
+
sku = gr.Dropdown(
|
| 125 |
+
label="Select SKU",
|
| 126 |
+
choices=unique_skus,
|
| 127 |
+
value=lambda: random.choice(unique_skus),
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
with gr.Row(equal_height=True):
|
| 131 |
+
|
| 132 |
+
with gr.Column():
|
| 133 |
+
plot = gr.Plot()
|
| 134 |
+
with gr.Row():
|
| 135 |
+
predict_btn = gr.Button(value="Predict")
|
| 136 |
+
predict_btn.click(
|
| 137 |
+
plot_demand_curve_gradio,
|
| 138 |
+
inputs=[sku],
|
| 139 |
+
|
| 140 |
+
outputs= plot
|
| 141 |
+
|
| 142 |
+
)
|
| 143 |
+
with gr.Column():
|
| 144 |
+
|
| 145 |
+
plot = gr.Plot()
|
| 146 |
+
with gr.Row():
|
| 147 |
+
|
| 148 |
+
optimal_price_btn = gr.Button(value="Optimal Price")
|
| 149 |
+
optimal_price_btn.click(
|
| 150 |
+
plot_optimal_prices_gradio,
|
| 151 |
+
inputs=[sku],
|
| 152 |
+
outputs=plot
|
| 153 |
+
|
| 154 |
+
)
|
| 155 |
+
# return plot_comeptitors_prices_gradio(sku) as a plot for every sku
|
| 156 |
+
with gr.Row(equal_height=True):
|
| 157 |
+
category = gr.Dropdown(
|
| 158 |
+
label="Select Category",
|
| 159 |
+
choices=unique_category,
|
| 160 |
+
value=lambda: random.choice(unique_category))
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
with gr.Column():
|
| 164 |
+
plot = gr.Plot()
|
| 165 |
+
with gr.Row():
|
| 166 |
+
competitor_btn = gr.Button(value="Competitors Prices")
|
| 167 |
+
competitor_btn.click(
|
| 168 |
+
plot_competitors_prices_gradio,
|
| 169 |
+
inputs=[category],
|
| 170 |
+
outputs=plot)
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
demo.launch(share=False)
|
| 175 |
+
|
build/lib/src/__init__.py
ADDED
|
File without changes
|
build/lib/src/data/__init__.py
ADDED
|
File without changes
|
build/lib/src/data/data_splitter.py
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
from datetime import datetime, timedelta
|
| 3 |
+
|
| 4 |
+
class DataSplitter:
|
| 5 |
+
def __init__(self, data, train_months, test_months=None, test_weeks=None):
|
| 6 |
+
if not isinstance(data, pd.DataFrame):
|
| 7 |
+
raise ValueError("data should be a pandas DataFrame")
|
| 8 |
+
if not 'Date' in data.columns:
|
| 9 |
+
raise ValueError("DataFrame must contain a 'Date' column")
|
| 10 |
+
if not 'SKU' in data.columns:
|
| 11 |
+
raise ValueError("DataFrame must contain a 'SKU' column")
|
| 12 |
+
|
| 13 |
+
# Convert 'Date' column to datetime
|
| 14 |
+
data['Date'] = pd.to_datetime(data['Date'])
|
| 15 |
+
|
| 16 |
+
# Store the data and settings
|
| 17 |
+
self.data = data
|
| 18 |
+
self.train_months = train_months
|
| 19 |
+
self.test_months = test_months
|
| 20 |
+
self.test_weeks = test_weeks
|
| 21 |
+
|
| 22 |
+
# Log information about the dataset
|
| 23 |
+
min_date = self.data['Date'].min()
|
| 24 |
+
max_date = self.data['Date'].max()
|
| 25 |
+
total_months = (max_date.year - min_date.year) * 12 + max_date.month - min_date.month
|
| 26 |
+
print(f"Min Date: {min_date}, Max Date: {max_date}, Total Months: {total_months}")
|
| 27 |
+
|
| 28 |
+
def split_data(self):
|
| 29 |
+
# Validate that at least test_months or test_weeks is provided
|
| 30 |
+
if self.test_months is None and self.test_weeks is None:
|
| 31 |
+
raise ValueError("Either test_months or test_weeks should be provided")
|
| 32 |
+
|
| 33 |
+
# Calculate the split date
|
| 34 |
+
max_date = self.data['Date'].max()
|
| 35 |
+
if self.test_months is not None:
|
| 36 |
+
split_date = max_date - pd.DateOffset(months=self.test_months)
|
| 37 |
+
else:
|
| 38 |
+
split_date = max_date - pd.DateOffset(weeks=self.test_weeks)
|
| 39 |
+
|
| 40 |
+
# Split the data into training and testing sets
|
| 41 |
+
train_data = self.data[self.data['Date'] <= split_date].copy()
|
| 42 |
+
test_data = self.data[self.data['Date'] > split_date].copy()
|
| 43 |
+
|
| 44 |
+
# Check that all SKUs in test_data are also present in train_data
|
| 45 |
+
train_skus = set(train_data['SKU'].unique())
|
| 46 |
+
test_skus = set(test_data['SKU'].unique())
|
| 47 |
+
if not test_skus.issubset(train_skus):
|
| 48 |
+
print("Warning: There are SKUs in the test data that are not present in the training data.")
|
| 49 |
+
|
| 50 |
+
# Log data types info
|
| 51 |
+
print("Train data types:")
|
| 52 |
+
print(train_data.dtypes)
|
| 53 |
+
print("\nTest data types:")
|
| 54 |
+
print(test_data.dtypes)
|
| 55 |
+
|
| 56 |
+
# Return the training and testing datasets
|
| 57 |
+
return train_data, test_data
|
| 58 |
+
|
build/lib/src/data/dataset_reader.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class DatasetReader:
|
| 6 |
+
|
| 7 |
+
def __init__(self, data_dir: Path):
|
| 8 |
+
self.data_dir = data_dir
|
| 9 |
+
|
| 10 |
+
def get_data_csv(self, filename: str) -> pd.DataFrame:
|
| 11 |
+
data_path = self.data_dir / filename
|
| 12 |
+
|
| 13 |
+
df = pd.read_csv(data_path)
|
| 14 |
+
|
| 15 |
+
return df
|
| 16 |
+
|
| 17 |
+
def get_data_excel(self, filename: str) -> pd.DataFrame:
|
| 18 |
+
data_path = self.data_dir / filename
|
| 19 |
+
|
| 20 |
+
df = pd.read_excel(data_path)
|
| 21 |
+
|
| 22 |
+
return df
|
build/lib/src/data/eda.py
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
import pandas as pd
|
| 4 |
+
from typing import List
|
| 5 |
+
|
| 6 |
+
import matplotlib.pyplot as plt
|
| 7 |
+
import seaborn as sns
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class Eda:
|
| 11 |
+
def missing_values_table(self, df: pd.DataFrame):
|
| 12 |
+
mis_val = df.isnull().sum()
|
| 13 |
+
mis_val_percent = 100 * mis_val / len(df)
|
| 14 |
+
mis_val_table = pd.concat([mis_val, mis_val_percent], axis=1)
|
| 15 |
+
mis_val_table.columns = ["Missing Values", "% of Total Values"]
|
| 16 |
+
mis_val_table = (
|
| 17 |
+
mis_val_table[mis_val_table["% of Total Values"] != 0]
|
| 18 |
+
.sort_values("% of Total Values", ascending=False)
|
| 19 |
+
.round(1)
|
| 20 |
+
)
|
| 21 |
+
print(
|
| 22 |
+
f"The selected dataframe has {df.shape[1]} columns and {mis_val_table.shape[0]} columns with missing values."
|
| 23 |
+
)
|
| 24 |
+
return mis_val_table
|
| 25 |
+
|
| 26 |
+
def detect_outliers_boxplot(df: pd.DataFrame, features: List[str], fac=1.5):
|
| 27 |
+
if isinstance(features, str):
|
| 28 |
+
features = [features]
|
| 29 |
+
|
| 30 |
+
q1 = df.loc[:, features].quantile(0.25)
|
| 31 |
+
q3 = df.loc[:, features].quantile(0.75)
|
| 32 |
+
iqr = q3 - q1
|
| 33 |
+
lower_threshold = q1 - fac * iqr
|
| 34 |
+
upper_threshold = q3 + fac * iqr
|
| 35 |
+
|
| 36 |
+
outliers = (
|
| 37 |
+
(df[features] < lower_threshold) | (df[features] > upper_threshold)
|
| 38 |
+
).any(axis=1)
|
| 39 |
+
return outliers
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
build/lib/src/data/feature_engineering.py
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
from typing import List, Iterable
|
| 3 |
+
import holidays
|
| 4 |
+
import numpy as np
|
| 5 |
+
from sympy import group
|
| 6 |
+
import logging
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class FeatureEngineeringProcess:
|
| 13 |
+
def __init__(self):
|
| 14 |
+
# Setup logging
|
| 15 |
+
self.logger = logging.getLogger(__name__)
|
| 16 |
+
self.logger.setLevel(logging.INFO)
|
| 17 |
+
|
| 18 |
+
# create a file handler
|
| 19 |
+
handler = logging.FileHandler('feature_engineering.log')
|
| 20 |
+
handler.setLevel(logging.INFO)
|
| 21 |
+
|
| 22 |
+
# create a logging format
|
| 23 |
+
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
| 24 |
+
handler.setFormatter(formatter)
|
| 25 |
+
|
| 26 |
+
# add the handlers to the logger
|
| 27 |
+
self.logger.addHandler(handler)
|
| 28 |
+
|
| 29 |
+
# store parameters
|
| 30 |
+
self.params = {}
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def grouped_feature_eng(
|
| 34 |
+
self,
|
| 35 |
+
df: pd.DataFrame,
|
| 36 |
+
group_features: List[str],
|
| 37 |
+
features: List[str],
|
| 38 |
+
|
| 39 |
+
):
|
| 40 |
+
"""Transform aggregation based on grouping a set of features
|
| 41 |
+
|
| 42 |
+
Args:
|
| 43 |
+
df (pd.DataFrame): DataFrame to be transformed
|
| 44 |
+
group_features (list): List of features selected to group the transformation, ej SKU
|
| 45 |
+
features (list): List of features to be transformed.
|
| 46 |
+
|
| 47 |
+
Returns:
|
| 48 |
+
df: Transformed pd.DataFrame
|
| 49 |
+
"""
|
| 50 |
+
#TODO: add more numerical transformations
|
| 51 |
+
for feature in features:
|
| 52 |
+
for group_feature in group_features:
|
| 53 |
+
df[f"{group_feature}_{feature}_mean"] = df.groupby(group_feature)[feature].transform("mean")
|
| 54 |
+
df[f"{group_feature}_{feature}_min"] = df.groupby(group_feature)[feature].transform("min")
|
| 55 |
+
df[f"{group_feature}_{feature}_max"] = df.groupby(group_feature)[feature].transform("max")
|
| 56 |
+
|
| 57 |
+
return df
|
| 58 |
+
|
| 59 |
+
def compute_gmv(self, df: pd.DataFrame, window: int = 7):
|
| 60 |
+
"""Compute GMV based on the quantity and price of the product
|
| 61 |
+
|
| 62 |
+
Args:
|
| 63 |
+
df (pd.DataFrame): DataFrame to be transformed
|
| 64 |
+
|
| 65 |
+
Returns:
|
| 66 |
+
df: Transformed pd.DataFrame
|
| 67 |
+
"""
|
| 68 |
+
|
| 69 |
+
df["gmv"] = df["quantity"] * df["price"] #TODO hardcoded variables
|
| 70 |
+
#compute gmv per product for the last N days
|
| 71 |
+
df["gmv_last_7_days"] = df.groupby("sku")["gmv"].transform(lambda x: x.rolling(window).sum())
|
| 72 |
+
|
| 73 |
+
return df
|
| 74 |
+
|
| 75 |
+
def datetime_transform(
|
| 76 |
+
self,
|
| 77 |
+
df: pd.DataFrame,
|
| 78 |
+
date_feature: str,
|
| 79 |
+
features: List[str] = ["month", "day"],
|
| 80 |
+
):
|
| 81 |
+
"""Aggregate datetime features
|
| 82 |
+
|
| 83 |
+
Args:
|
| 84 |
+
df (pd.DataFrame):
|
| 85 |
+
date_feature (str): df column to be transformed
|
| 86 |
+
features (List[str]): List of date features to extract from the date_feature column
|
| 87 |
+
country (str): Country code for holiday detection
|
| 88 |
+
|
| 89 |
+
Returns:
|
| 90 |
+
df: Dataframe with date transformations, (month, day, year, hour, minute, second, season, holidays)
|
| 91 |
+
"""
|
| 92 |
+
seasons = {
|
| 93 |
+
1: "Winter",
|
| 94 |
+
2: "Winter",
|
| 95 |
+
3: "Spring",
|
| 96 |
+
4: "Spring",
|
| 97 |
+
5: "Spring",
|
| 98 |
+
6: "Summer",
|
| 99 |
+
7: "Summer",
|
| 100 |
+
8: "Summer",
|
| 101 |
+
9: "Fall",
|
| 102 |
+
10: "Fall",
|
| 103 |
+
11: "Fall",
|
| 104 |
+
12: "Winter",
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
df[date_feature] = pd.to_datetime(df[date_feature])
|
| 109 |
+
|
| 110 |
+
if "month" in features:
|
| 111 |
+
df[date_feature + "_month"] = df[date_feature].dt.month
|
| 112 |
+
if "day" in features:
|
| 113 |
+
df[date_feature + "_day"] = df[date_feature].dt.day
|
| 114 |
+
if "day_name" in features:
|
| 115 |
+
df[date_feature + "_day_name"] = df[date_feature].dt.day_name()
|
| 116 |
+
if "day_of_the_year" in features:
|
| 117 |
+
df[date_feature + "_day_of_the_year"] = df[date_feature].dt.dayofyear
|
| 118 |
+
if "week" in features:
|
| 119 |
+
df[date_feature + "_week"] = df[date_feature].dt.isocalendar().week
|
| 120 |
+
if "year" in features:
|
| 121 |
+
df[date_feature + "_year"] = df[date_feature].dt.year
|
| 122 |
+
if "quarter" in features:
|
| 123 |
+
df[date_feature + "_quarter"] = df[date_feature].dt.quarter
|
| 124 |
+
if "hour" in features:
|
| 125 |
+
df[date_feature + "_hour"] = df[date_feature].dt.hour
|
| 126 |
+
if "minute" in features:
|
| 127 |
+
df[date_feature + "_minute"] = df[date_feature].dt.minute
|
| 128 |
+
if "second" in features:
|
| 129 |
+
df[date_feature + "_second"] = df[date_feature].dt.second
|
| 130 |
+
if "season" in features:
|
| 131 |
+
df[date_feature + "_season"] = df[date_feature].dt.month.map(seasons)
|
| 132 |
+
if "holidays" in features:
|
| 133 |
+
print('updated ___')
|
| 134 |
+
holiday_dates = holidays.CountryHoliday('PL', years=df[date_feature].dt.year)
|
| 135 |
+
df[date_feature + "_holidays"] = df[date_feature].dt.date.map(holiday_dates).notna().astype(int)
|
| 136 |
+
|
| 137 |
+
return df
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
return data
|
| 141 |
+
def price_sales_correlation_features_updated(self, data: pd.DataFrame,
|
| 142 |
+
N: int,
|
| 143 |
+
u_range: Iterable[int],
|
| 144 |
+
v_range: Iterable[int]) -> pd.DataFrame:
|
| 145 |
+
|
| 146 |
+
# Sort data by SKU and date
|
| 147 |
+
data = data.sort_values(by=['SKU', 'Date']) #TODO hardcoded variables
|
| 148 |
+
|
| 149 |
+
# Group the data by SKU
|
| 150 |
+
grouped = data.groupby('SKU')
|
| 151 |
+
|
| 152 |
+
# Placeholder DataFrame for the results
|
| 153 |
+
results = pd.DataFrame()
|
| 154 |
+
|
| 155 |
+
for sku, group in grouped:
|
| 156 |
+
# Loop through each combination of u and v
|
| 157 |
+
for u in u_range:
|
| 158 |
+
for v in v_range:
|
| 159 |
+
# Calculate the numerator part of the formula
|
| 160 |
+
numerator = (group['price']**u * group['sales']**v).rolling(window=N).sum()
|
| 161 |
+
|
| 162 |
+
# Calculate the sum of price to the power of u over the last N days
|
| 163 |
+
sum_price_u = (group['price']**u).rolling(window=N).sum()
|
| 164 |
+
|
| 165 |
+
# Calculate the sum of sales to the power of v over the last N days
|
| 166 |
+
sum_sales_v = (group['sales']**v).rolling(window=N).sum()
|
| 167 |
+
|
| 168 |
+
# Calculate the feature f_corr for this combination of u and v
|
| 169 |
+
f_corr = numerator / (sum_price_u * sum_sales_v)
|
| 170 |
+
|
| 171 |
+
# Add the feature to the group
|
| 172 |
+
group[f'f_corr_{u}_{v}'] = f_corr
|
| 173 |
+
|
| 174 |
+
# Append the group to the results Dataframe
|
| 175 |
+
results = pd.concat([results, group])
|
| 176 |
+
# log and save parameters of the function
|
| 177 |
+
self.logger.info(f"price_sales_correlation_features_updated: N={N}, u_range={u_range}, v_range={v_range}")
|
| 178 |
+
# save parameters of the function
|
| 179 |
+
self.params['price_sales_correlation_features_updated'] = {'N': N, 'u_range': u_range, 'v_range': v_range}
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
return results
|
| 183 |
+
|
| 184 |
+
def normalize_features(
|
| 185 |
+
self,
|
| 186 |
+
data: pd.DataFrame,
|
| 187 |
+
N: int,
|
| 188 |
+
long_period: int ) -> pd.DataFrame:
|
| 189 |
+
# Generate docstring
|
| 190 |
+
""" Normalize features for pricing model.
|
| 191 |
+
Args:
|
| 192 |
+
data (pd.DataFrame): DataFrame
|
| 193 |
+
N (int): represents the number of days for a short-term average.
|
| 194 |
+
This is the window of time over which you calculate the average price and sales.
|
| 195 |
+
For example, if you set N to 7, you calculate the average price and sales over the last 7 days.
|
| 196 |
+
long_period (int): represents the number of days over a longer-term average.
|
| 197 |
+
This is used to calculate the reference price (price0) and reference demand (demand0) which are used to normalize the short-term average.
|
| 198 |
+
For example, if long_period is set to 28, it means that you calculate the average price and average demand over the last 28 days to use as the reference values for normalization.
|
| 199 |
+
Returns:
|
| 200 |
+
data (pd.DataFrame): DataFrame with normalized features.
|
| 201 |
+
"""
|
| 202 |
+
|
| 203 |
+
|
| 204 |
+
# Sort data by SKU and date
|
| 205 |
+
data = data.sort_values(by=['SKU', 'Date'])
|
| 206 |
+
|
| 207 |
+
grouped = data.groupby('SKU')
|
| 208 |
+
|
| 209 |
+
# Placeholder DataFrame for the results
|
| 210 |
+
results = pd.DataFrame()
|
| 211 |
+
|
| 212 |
+
for sku, group in grouped:
|
| 213 |
+
|
| 214 |
+
# Calculate average price and sales for the last N days
|
| 215 |
+
group['avg_price_last_N_days'] = group['price'].rolling(window=N).mean()
|
| 216 |
+
group['avg_sales_last_N_days'] = group['sales'].rolling(window=N).mean()
|
| 217 |
+
|
| 218 |
+
# Calculate reference price and demand
|
| 219 |
+
price0 = group['price'].rolling(window=long_period).mean().replace(0, np.nan)
|
| 220 |
+
demand0 = group['sales'].rolling(window=long_period).mean().replace(0, np.nan)
|
| 221 |
+
|
| 222 |
+
# Normalize average price and sales
|
| 223 |
+
group['normalized_avg_price'] = group['avg_price_last_N_days'] / price0
|
| 224 |
+
group['normalized_avg_sales'] = group['avg_sales_last_N_days'] / demand0
|
| 225 |
+
|
| 226 |
+
# Apply log transformation
|
| 227 |
+
group['normalized_log_avg_price'] = np.log(group['avg_price_last_N_days'] / price0).clip(lower=1e-9)
|
| 228 |
+
group['normalized_log_avg_sales'] = np.log(group['avg_sales_last_N_days'] / demand0).clip(lower=1e-9)
|
| 229 |
+
|
| 230 |
+
# Normalize standard deviation
|
| 231 |
+
group['normalized_std_price'] = group['price'].rolling(window=N).std() / group['avg_price_last_N_days']
|
| 232 |
+
group['normalized_std_sales'] = group['sales'].rolling(window=N).std() / group['avg_sales_last_N_days']
|
| 233 |
+
|
| 234 |
+
# Drop 'avg_price_last_N_days' and 'avg_sales_last_N_days' columns
|
| 235 |
+
group = group.drop(columns=['avg_price_last_N_days', 'avg_sales_last_N_days'])
|
| 236 |
+
|
| 237 |
+
# Append the group to the results Dataframe
|
| 238 |
+
results = pd.concat([results, group])
|
| 239 |
+
# log and save parameters of the function
|
| 240 |
+
self.logger.info(f"normalize_features: N={N}, long_period={long_period}")
|
| 241 |
+
# save parameters of the function
|
| 242 |
+
self.params['normalize_features'] = {'N': N, 'long_period': long_period}
|
| 243 |
+
|
| 244 |
+
return results
|
| 245 |
+
|
| 246 |
+
def filter_stability_periods(self,
|
| 247 |
+
data: pd.DataFrame,
|
| 248 |
+
N: int,
|
| 249 |
+
threshold: float = 0.05,
|
| 250 |
+
removal_percentage: float = 0.98,
|
| 251 |
+
) -> pd.DataFrame:
|
| 252 |
+
|
| 253 |
+
# Sort the data by SKU and date
|
| 254 |
+
data = data.sort_values(by=['SKU', 'Date'])
|
| 255 |
+
|
| 256 |
+
# Calculate the 42-day average price
|
| 257 |
+
data[f'avg_price_last_{N}_days'] = data.groupby('SKU')['price'].transform(lambda x: x.rolling(window=N).mean())
|
| 258 |
+
|
| 259 |
+
# Calculate the absolute percentage difference between the current price and the N-day average price
|
| 260 |
+
data['price_variation'] = abs(data['price'] - data[f'avg_price_last_{N}_days']) / data[f'avg_price_last_{N}_days']
|
| 261 |
+
|
| 262 |
+
# Mark rows where N-day average cannot be calculated due to insufficient data
|
| 263 |
+
data['insufficient_data'] = data[f'avg_price_last_{N}_days'].isna() & data['price'].notna()
|
| 264 |
+
|
| 265 |
+
# Handle NaN in 'price_variation' due to insufficient data differently (e.g. set them to a placeholder value)
|
| 266 |
+
data.loc[data['insufficient_data'], 'price_variation'] = 0 # or some other placeholder value
|
| 267 |
+
|
| 268 |
+
# Identify rows where the price varied by less than the threshold from the 42-day average price
|
| 269 |
+
stability_periods = (data['price_variation'] < threshold) & ~data['insufficient_data']
|
| 270 |
+
|
| 271 |
+
# Randomly select 98% of the stability periods to be removed
|
| 272 |
+
indices_to_remove = data[stability_periods].sample(frac=removal_percentage).index
|
| 273 |
+
|
| 274 |
+
# Remove the selected indices from the data
|
| 275 |
+
data = data.drop(indices_to_remove)
|
| 276 |
+
|
| 277 |
+
# log and save parameters of the function
|
| 278 |
+
self.logger.info(f"filter_stability_periods: N={N}, threshold={threshold}, removal_percentage={removal_percentage}")
|
| 279 |
+
# save parameters of the function
|
| 280 |
+
self.params['filter_stability_periods'] = {'N': N, 'threshold': threshold, 'removal_percentage': removal_percentage}
|
| 281 |
+
|
| 282 |
+
return data
|
| 283 |
+
|
| 284 |
+
|
| 285 |
+
|
| 286 |
+
|
build/lib/src/data/normalization.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
class DatasetNormalization(nn.Module):
|
| 5 |
+
"""
|
| 6 |
+
Just add this layer as the first layer of your network
|
| 7 |
+
and it will normalize your raw features.
|
| 8 |
+
But do not forget to take log of counters-like features by yourself.
|
| 9 |
+
"""
|
| 10 |
+
def init(self, x, nonorm_suffix_size=0):
|
| 11 |
+
super().init()
|
| 12 |
+
mu = torch.mean(x, dim=(-2,))
|
| 13 |
+
std = torch.clamp(torch.std(x, dim=(-2,)), min=0.001)
|
| 14 |
+
if nonorm_suffix_size > 0:
|
| 15 |
+
mu = torch.cat((mu, torch.zeros(nonorm_suffix_size)))
|
| 16 |
+
std = torch.cat((std, torch.ones(nonorm_suffix_size)))
|
| 17 |
+
self.p_mu = nn.Parameter(mu, requires_grad=False)
|
| 18 |
+
self.p_std = nn.Parameter(std, requires_grad=False)
|
| 19 |
+
|
| 20 |
+
def forward(self, x):
|
| 21 |
+
return (x - self.p_mu) / self.p_std
|
build/lib/src/data/utils.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class Utils:
|
| 5 |
+
def convert_to_float(value):
|
| 6 |
+
if isinstance(value, float):
|
| 7 |
+
return value
|
| 8 |
+
try:
|
| 9 |
+
return float(value.replace(',', '.'))
|
| 10 |
+
except ValueError:
|
| 11 |
+
return np.nan
|
| 12 |
+
|
| 13 |
+
def convert_to_int(value):
|
| 14 |
+
if isinstance(value, int):
|
| 15 |
+
return value
|
| 16 |
+
try:
|
| 17 |
+
return int(value)
|
| 18 |
+
except ValueError:
|
| 19 |
+
return np.nan
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
# create a function that adds "_" in every space for all columns in a dataframe
|
| 23 |
+
def add_underscore(df):
|
| 24 |
+
df.columns = df.columns.str.replace(' ', '_')
|
| 25 |
+
return df
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
build/lib/src/evaluation.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
# Define the QueryRMSE metric
|
| 4 |
+
def query_rmse(y_true, y_pred, groups):
|
| 5 |
+
group_corrections = {}
|
| 6 |
+
for group in np.unique(groups):
|
| 7 |
+
idx = np.where(groups == group)
|
| 8 |
+
y_true_group = y_true[idx]
|
| 9 |
+
y_pred_group = y_pred[idx]
|
| 10 |
+
correction = np.mean(y_true_group - y_pred_group)
|
| 11 |
+
group_corrections[group] = correction
|
| 12 |
+
|
| 13 |
+
corrected_preds = y_pred + np.array([group_corrections[group] for group in groups])
|
| 14 |
+
return np.sqrt(np.mean((y_true - corrected_preds)**2))
|
build/lib/src/models/__init__.py
ADDED
|
File without changes
|
build/lib/src/models/loss.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch.nn as nn
|
| 2 |
+
import torch.nn.functional as F
|
| 3 |
+
|
| 4 |
+
class SmoothQLoss(nn.L1Loss):
|
| 5 |
+
constants = ['reduction', 'beta', 'qx']
|
| 6 |
+
def __str__(self):
|
| 7 |
+
return f"{self.__class__.__name__}(beta={self.beta}, qx={self.qx})"
|
| 8 |
+
|
| 9 |
+
def __init__(
|
| 10 |
+
self,
|
| 11 |
+
size_average=None,
|
| 12 |
+
reduce=None,
|
| 13 |
+
reduction: str = 'mean',
|
| 14 |
+
qx: float = 0.5,
|
| 15 |
+
beta: float = 0.1,
|
| 16 |
+
):
|
| 17 |
+
super().__init__(size_average, reduce, reduction)
|
| 18 |
+
self.beta = beta
|
| 19 |
+
self.qx = qx
|
| 20 |
+
|
| 21 |
+
def forward(
|
| 22 |
+
self,
|
| 23 |
+
predict: torch.Tensor, target: torch.Tensor
|
| 24 |
+
) -> torch.Tensor:
|
| 25 |
+
m = 2.0 * self.qx - 1.0
|
| 26 |
+
shift = self.beta * m
|
| 27 |
+
if self.reduction == 'mean':
|
| 28 |
+
return (
|
| 29 |
+
F.smooth_l1_loss(
|
| 30 |
+
target - shift, predict, reduction='mean',
|
| 31 |
+
beta=self.beta
|
| 32 |
+
) + m * torch.mean(target - predict - 0.5 * shift)
|
| 33 |
+
)
|
| 34 |
+
elif self.reduction == 'sum':
|
| 35 |
+
return (
|
| 36 |
+
F.smooth_l1_loss(
|
| 37 |
+
target - shift, predict, reduction='sum',
|
| 38 |
+
beta=self.beta
|
| 39 |
+
) + m * torch.sum(target - predict - 0.5 * shift)
|
| 40 |
+
)
|
build/lib/src/models/nn.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import torch.nn as nn
|
| 3 |
+
|
| 4 |
+
from src.data import DatasetNormalization
|
| 5 |
+
|
| 6 |
+
class DemandNet1(nn.Module):
|
| 7 |
+
"""
|
| 8 |
+
This network is the first to try.
|
| 9 |
+
+ DatasetNormalization
|
| 10 |
+
+ Some Linear + ReLU, one LayerNorm inside
|
| 11 |
+
+ one residual connection
|
| 12 |
+
"""
|
| 13 |
+
constants = ['output_size']
|
| 14 |
+
def __init__(
|
| 15 |
+
self,
|
| 16 |
+
x_norm_prefix, # train_dataset without embeddings,
|
| 17 |
+
# for DatasetNormlization layer initialization
|
| 18 |
+
mid_size: int = 20,
|
| 19 |
+
embed_size: int = 0,
|
| 20 |
+
output_size: int = 1,
|
| 21 |
+
activation: nn.Module = nn.ReLU()
|
| 22 |
+
):
|
| 23 |
+
super().__init__()
|
| 24 |
+
input_size = len(x_norm_prefix[0]) + embed_size
|
| 25 |
+
self.norm = DatasetNormalization(x_norm_prefix, embed_size)
|
| 26 |
+
self.output_size = output_size
|
| 27 |
+
self.leg = nn.Sequential(
|
| 28 |
+
nn.Linear(input_size, mid_size),
|
| 29 |
+
activation,
|
| 30 |
+
nn.Linear(mid_size, mid_size),
|
| 31 |
+
nn.LayerNorm(mid_size),
|
| 32 |
+
activation,
|
| 33 |
+
nn.Linear(mid_size, mid_size),
|
| 34 |
+
activation,
|
| 35 |
+
nn.LayerNorm(mid_size)
|
| 36 |
+
)
|
| 37 |
+
self.body = nn.Sequential(
|
| 38 |
+
nn.Linear(input_size + mid_size, mid_size),
|
| 39 |
+
activation,
|
| 40 |
+
nn.Linear(mid_size, mid_size),
|
| 41 |
+
activation,
|
| 42 |
+
nn.Linear(mid_size, output_size)
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
def forward(self, x):
|
| 46 |
+
x1 = self.norm(x)
|
| 47 |
+
x2 = self.leg(x1)
|
| 48 |
+
x = torch.cat((x1, 4 * x2), dim=1)
|
| 49 |
+
yp = self.body(x)
|
| 50 |
+
return torch.squeeze(yp) if self.output_size == 1 else yp
|
build/lib/src/pricing/__init__.py
ADDED
|
File without changes
|
build/lib/src/pricing/pricing.py
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
def demand_curve(price, prices, predicted_sales):
|
| 4 |
+
return np.interp(price, prices, predicted_sales)
|
| 5 |
+
|
| 6 |
+
# Pricing Algorithm
|
| 7 |
+
def profit(gmv0, r_lambda, E_r_lambda, c, P0):
|
| 8 |
+
return np.sum(gmv0 * E_r_lambda * (r_lambda - c)) - P0
|
| 9 |
+
|
| 10 |
+
def pricing_algorithm(P0, gmv0, r_lambda, E_r_lambda, c, initial_lambda=5, delta_lambda=4):
|
| 11 |
+
lambda_value = initial_lambda
|
| 12 |
+
while True:
|
| 13 |
+
current_profit = profit(gmv0, r_lambda, E_r_lambda, c, P0)
|
| 14 |
+
if current_profit < 0:
|
| 15 |
+
lambda_value += delta_lambda
|
| 16 |
+
elif current_profit > 0:
|
| 17 |
+
lambda_value -= delta_lambda
|
| 18 |
+
else:
|
| 19 |
+
break
|
| 20 |
+
|
| 21 |
+
# Update r_lambda, E_r_lambda based on the new lambda_value
|
| 22 |
+
# ...
|
| 23 |
+
|
| 24 |
+
return lambda_value
|
| 25 |
+
|
| 26 |
+
# Set the initial P0 value according to business needs and strategy
|
| 27 |
+
P0 = ...
|
| 28 |
+
|
| 29 |
+
# Define gmv0, r_lambda, E_r_lambda, c
|
| 30 |
+
# ...
|
| 31 |
+
|
| 32 |
+
# Define c
|
| 33 |
+
c = ...
|
| 34 |
+
|
| 35 |
+
# Run the pricing algorithm to find the optimal value of λ
|
| 36 |
+
#optimal_lambda = pricing_algorithm(P0, demand_curve, prices, predicted_sales, c)
|
| 37 |
+
|
| 38 |
+
def pricing_algorithm(P0, demand_curve, prices, predicted_sales, c, initial_lambda=5, delta_lambda=4):
|
| 39 |
+
lambda_value = initial_lambda
|
| 40 |
+
while True:
|
| 41 |
+
gmv0 = demand_curve(P0, prices, predicted_sales)
|
| 42 |
+
r_lambda = ... # Update this based on lambda_value
|
| 43 |
+
E_r_lambda = ... # Update this based on lambda_value
|
| 44 |
+
|
| 45 |
+
current_profit = profit(gmv0, r_lambda, E_r_lambda, c, P0)
|
| 46 |
+
if current_profit < 0:
|
| 47 |
+
lambda_value += delta_lambda
|
| 48 |
+
elif current_profit > 0:
|
| 49 |
+
lambda_value -= delta_lambda
|
| 50 |
+
else:
|
| 51 |
+
break
|
| 52 |
+
|
| 53 |
+
return lambda_value
|
csv_files.txt
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"data/raw/Amazon Sale Report.csv"
|
| 2 |
+
"data/raw/Cloud Warehouse Compersion Chart.csv"
|
| 3 |
+
"data/raw/Expense IIGF.csv"
|
| 4 |
+
"data/raw/International sale Report.csv"
|
| 5 |
+
"data/raw/May-2022.csv"
|
| 6 |
+
"data/raw/P LMarch2021.csv"
|
| 7 |
+
"data/raw/Sale Report.csv"
|
| 8 |
+
"data/raw/synthetic_data.csv"
|
data/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
data/Question_list.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Dataset has 254175 observations
|
| 3 |
+
|
| 4 |
+
WIthout duplicates, dataset has 223571 observations
|
| 5 |
+
|
| 6 |
+
Added to Catalog seems to have anomalus values like 1960
|
| 7 |
+
|
| 8 |
+
Is list price based on added to catalog date or image date?
|
| 9 |
+
|
| 10 |
+
What is % and % all. They seemed to have the same values.
|
| 11 |
+
|
| 12 |
+
Percetages have negative values.
|
| 13 |
+
|
| 14 |
+
Difference between stock item and unit of stock?
|
| 15 |
+
|
| 16 |
+
Units of measurment have zero values. This is corrupting the data.
|
| 17 |
+
|
| 18 |
+
country of origin have anomalies like "???"
|
| 19 |
+
|
| 20 |
+
Product category seems to be made manually. Anmalies like non, "and" and other values spread across the dataset (29760)
|
| 21 |
+
|
| 22 |
+
Min max of dates
|
| 23 |
+
|
| 24 |
+
Factors affecting the price elasticity:
|
| 25 |
+
|
| 26 |
+
Expectations of discounts: holidays, black friday. We can derive this features but we need the date of sales.
|
| 27 |
+
|
| 28 |
+
Visibility of discounts markers of price in the website, price tags
|
| 29 |
+
|
| 30 |
+
clarity oof discounts: promo codes or coupons
|
| 31 |
+
|
| 32 |
+
Other feartures. duration of promotion, promo type, basket size, range o product the the promo applies
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
Quewstions on missing data:
|
| 38 |
+
Example 1
|
| 39 |
+
Q: Did you notice any instances where some of the data was not recorded? If so, why was this the case?
|
| 40 |
+
A: Yes, sometimes data from our South region isn't recorded because the area has poor internet connection and doesn't always successfully upload data.
|
| 41 |
+
Nature of Missing Data: Missing Not at Random (MNAR) - the missingness is related to the values of the unobserved data itself, i.e., it depends on the region.
|
| 42 |
+
Next Steps: You may need to handle this missing data with care as it is not random. Some methods of dealing with MNAR data are advanced imputation methods or obtaining the missing data by other means if possible.
|
| 43 |
+
|
| 44 |
+
Example 2
|
| 45 |
+
Q: When you saw missing data, was there a common factor? For example, did you notice that it happens more often on certain days, or with certain types of data?
|
| 46 |
+
A: Well, we seem to have more missing data during weekends. Our staff is limited during that time, and they might not be able to collect all the necessary data.
|
| 47 |
+
Nature of Missing Data: Missing at Random (MAR) - the probability of missing data is related to some observed data. In this case, the day of the week.
|
| 48 |
+
Next Steps: You could apply imputation techniques where you fill in the missing data with substitute values. You could base the substitute values on the data collected during the weekdays.
|
| 49 |
+
|
| 50 |
+
Example 3
|
| 51 |
+
Q: Could you please provide any details or notes you might have about when and why some data points are not filled in?
|
| 52 |
+
A: Well, some customers don't provide their income level during the survey, so that field is often left blank.
|
| 53 |
+
Nature of Missing Data: Missing Completely at Random (MCAR) - The missingness has no relationship with any other data, observed or missing.
|
| 54 |
+
Next Steps: If the missing data is MCAR, then it can be safely omitted from the dataset, or simple imputation methods can be used.
|
data/processed/optimal_prices.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/processed/predictions.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/processed/test.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae87e520f1ad2c8d08363834a912e0508a14c07e42f268f7639f2c19b957ca96
|
| 3 |
+
size 2935932
|
data/processed/train.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c6d4e346bca48f2cbe4a8975c96f2fcb9b20fdd579e8f1efcfe52359bd04e1f
|
| 3 |
+
size 6190633
|
data/raw/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
data/raw/Amazon_Sale_Report.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ac9a366da5f3af418831fa53da9eebfc3b3838803e3774eec97dbcb291441beb
|
| 3 |
+
size 68923428
|
data/raw/Cloud Warehouse Compersion Chart.csv
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
index,Shiprocket,Unnamed: 1,INCREFF
|
| 2 |
+
0,Heads,Price (Per Unit),Price (Per Unit)
|
| 3 |
+
1,Inbound (Fresh Stock and RTO),₹4.00,4
|
| 4 |
+
2,Outbound,₹7.00,11
|
| 5 |
+
3,Storage Fee/Cft,₹25.00,Rs 0.15/- Per Day
|
| 6 |
+
4,Customer Return with Detailed QC,₹6.00,15.5
|
| 7 |
+
5,(A) SCOPE OF WORK and STANDARD OPERATING PROCEDURE,,
|
| 8 |
+
6,Inward,Unloading,• Boxes counted and weighed. Data captured in the Maven.
|
| 9 |
+
7,,Validation,• GRN will be initiated against a valid PO document and Invoice will be captured
|
| 10 |
+
8,,QC,• No QC to be done (Outer Visual Inspection and Color matching)
|
| 11 |
+
9,,GRN,"• Scanning (Goods will have scannable EAN code or unique barcodes) and counting of all inventory, verification of all data by supervisor and completion of GRN. Detailed report is made available"
|
| 12 |
+
10,,Putaway,• Mobile HHT based Putaway to accurately record warehouse location for every item/roll
|
| 13 |
+
11,,,
|
| 14 |
+
12,Outward,Order receipt,• Orders will be received through integration directly into Maven or directly to Maven by the client
|
| 15 |
+
13,,Picking,• System driven optimised picking with real-time inventory correction by marking Not Found and alternate locations suggested
|
| 16 |
+
14,,Packing,• System driven packing by putting products into Polybags to maintain accuracy and generate pack slips
|
| 17 |
+
15,,Invoicing,• Print the invoice as generated through integration or provided by the client
|
| 18 |
+
16,,Shipping,• Shipping labels and AWB via integration with vendors and generation of digital manifests to ensure accuracy
|
| 19 |
+
17,,POD,• Digital PODs from vendors if available via integration
|
| 20 |
+
18,,,
|
| 21 |
+
19,Returns,Inward,• RTO and Customer Returns are received and Inwarded in the warehouse Outer package visible inspection is done before inwarding
|
| 22 |
+
20,,,
|
| 23 |
+
21,Inventory management,Cycle count,• Daily cycle count to maintain accuracy and deliver SLAs without disrupting regular operations. Complete Inventory to be covered in 3 months.
|
| 24 |
+
22,,,• Any quantity not found during Cycle Count shall be parked in a non-serviceable location in Maven
|
| 25 |
+
23,,Audit,• Annual wall to wall Audit including global count driven by system to ensure speed while eliminating human error
|
| 26 |
+
24,(B) MISCELLANEOUS,,
|
| 27 |
+
25,,"i. Product, Vendor and Customer Master Data is created in Maven before the rollout according to the data provided by the client",
|
| 28 |
+
26,,ii. Above procedure considers common B2C or D2C businesses,
|
| 29 |
+
27,,iii. Storage for Packing material is charged separately if provided by the client. The scrap generated from the goods is for the warehouse.,
|
| 30 |
+
28,© EXCLUSIONS,,
|
| 31 |
+
29,,i. tax registrations for the Client and any structural changes to comply with tax requirements,
|
| 32 |
+
30,,ii. coordinate with vendors of the client,
|
| 33 |
+
31,,iii. provision of packaging material and consumables,
|
| 34 |
+
32,,iv. any licensing required specifically for the product,
|
| 35 |
+
33,,v. coordinate with transportation or delivery service providers of client,
|
| 36 |
+
34,,vi. refurbishment of goods,
|
| 37 |
+
35,(D) KEY PERFORMANCE INDICATORS AND COMMERCIALS,,
|
| 38 |
+
36,Performance Indicators,,
|
| 39 |
+
37,Performance Measure,Measurement,Target
|
| 40 |
+
38,Monthly Fill Rate,• Measurement is monthly,>99.8%
|
| 41 |
+
39,,• Calculated as: Total quantity available in Maven & dispatched/Total quantity ordered,
|
| 42 |
+
40,Daily Processing Capacity,• GRN throughput is subject to a cut-off of 11:00am,
|
| 43 |
+
41,,• Outbound throughput is subject to a cut-off of 2:00pm,
|
| 44 |
+
42,,• Returns throughput is subject to a cut-off of 10:00am,
|
| 45 |
+
43,Customer Complaints,• Measurement is monthly,<0.2%
|
| 46 |
+
44,,"• Total affected quantity (Short reported, excess reported and mismatch reported)/ Total quantity ordered during the month",
|
| 47 |
+
45,Allowed Shrinkage,• Measured at the time of full audit carried out against Maven inventory by Client or any third party appointed by the Client,<0.2%
|
| 48 |
+
46,,• Final Shrinkage value calculated at Client’s holding cost of the inventory (net of any excess inventory found) Net value of transacted goods (excess – shortage) during the audit period measured at holding cost,1 Annual Audit is included in the commercials
|
| 49 |
+
47,Penalty,• Penalty for fillrate,2x of the service fee per affected qty
|
| 50 |
+
48,,• Penalty cap for service lapse,10% of monthly billing; not applicable if there are outstanding payments; no cap on shrinkage
|
| 51 |
+
49,Others,• Days of Operations,7 days per week
|
data/raw/Expense IIGF.csv
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
index,Recived Amount,Unnamed: 1,Expance,Unnamed: 3
|
| 2 |
+
0,Particular,Amount,Particular,Amount
|
| 3 |
+
1,06-19-22,1000,Large Bag,380
|
| 4 |
+
2,06-20-22,1500,"Stationary(Soft Pin, Paper pin for Dupatta, Fevikwick)",170
|
| 5 |
+
3,06-22-22,500,OLA,839
|
| 6 |
+
4,06-23-22,2000,Auto Rent,520
|
| 7 |
+
5,,,TT Fine,500
|
| 8 |
+
6,,,Bhushan Hotel,2506
|
| 9 |
+
7,,,Food,1290
|
| 10 |
+
8,,,Expomart Labour Charge,200
|
| 11 |
+
9,,,Choclate,400
|
| 12 |
+
10,,,Bhushan Cash,800
|
| 13 |
+
11,,,Delhi Hotel Rest Room,120
|
| 14 |
+
12,,,Water Bottel,70
|
| 15 |
+
13,,,Cooli,300
|
| 16 |
+
14,,,,8095
|
| 17 |
+
15,,,Pending Amount,-3095
|
| 18 |
+
16,Total,5000,,5000
|
data/raw/International sale Report.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/raw/May-2022.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/raw/PLMarch2021.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/raw/Sale Report.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
dist/Relu_project-0.0.0-py3.9.egg
ADDED
|
Binary file (22.3 kB). View file
|
|
|
environment.yml
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: relu
|
| 2 |
+
channels:
|
| 3 |
+
- pytorch
|
| 4 |
+
- anaconda
|
| 5 |
+
- conda-forge
|
| 6 |
+
- defaults
|
| 7 |
+
dependencies:
|
| 8 |
+
- appnope=0.1.3=pyhd8ed1ab_0
|
| 9 |
+
- asttokens=2.2.1=pyhd8ed1ab_0
|
| 10 |
+
- backcall=0.2.0=pyh9f0ad1d_0
|
| 11 |
+
- backports=1.0=pyhd8ed1ab_3
|
| 12 |
+
- backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0
|
| 13 |
+
- blas=1.0=mkl
|
| 14 |
+
- bottleneck=1.3.4=py38h67323c0_0
|
| 15 |
+
- brotlipy=0.7.0=py38h9ed2024_1003
|
| 16 |
+
- bzip2=1.0.8=h1de35cc_0
|
| 17 |
+
- ca-certificates=2023.5.7=h8857fd0_0
|
| 18 |
+
- certifi=2023.5.7=pyhd8ed1ab_0
|
| 19 |
+
- cffi=1.15.1=py38h6c40b1e_3
|
| 20 |
+
- charset-normalizer=2.0.4=pyhd3eb1b0_0
|
| 21 |
+
- comm=0.1.3=pyhd8ed1ab_0
|
| 22 |
+
- convertdate=2.4.0=pyhd8ed1ab_0
|
| 23 |
+
- cryptography=39.0.1=py38hf6deb26_0
|
| 24 |
+
- debugpy=1.6.7=py38h4cd09af_0
|
| 25 |
+
- decorator=5.1.1=pyhd8ed1ab_0
|
| 26 |
+
- executing=1.2.0=pyhd8ed1ab_0
|
| 27 |
+
- ffmpeg=4.3=h0a44026_0
|
| 28 |
+
- filelock=3.9.0=py38hecd8cb5_0
|
| 29 |
+
- freetype=2.12.1=hd8bbffd_0
|
| 30 |
+
- gettext=0.21.0=he85b6c0_1
|
| 31 |
+
- giflib=5.2.1=h6c40b1e_3
|
| 32 |
+
- gmp=6.2.1=he9d5cce_3
|
| 33 |
+
- gmpy2=2.1.2=py38hd5de756_0
|
| 34 |
+
- gnutls=3.6.15=hed9c0bf_0
|
| 35 |
+
- hijri-converter=2.3.1=pyhd8ed1ab_0
|
| 36 |
+
- holidays=0.25=pyhd8ed1ab_0
|
| 37 |
+
- icu=58.2=h0a44026_3
|
| 38 |
+
- idna=3.4=py38hecd8cb5_0
|
| 39 |
+
- importlib-metadata=6.6.0=pyha770c72_0
|
| 40 |
+
- importlib_metadata=6.6.0=hd8ed1ab_0
|
| 41 |
+
- intel-openmp=2023.1.0=ha357a0b_43547
|
| 42 |
+
- ipykernel=6.23.1=pyh736e0ef_0
|
| 43 |
+
- ipython=8.4.0=py38h50d1736_0
|
| 44 |
+
- jedi=0.18.2=pyhd8ed1ab_0
|
| 45 |
+
- jinja2=3.1.2=py38hecd8cb5_0
|
| 46 |
+
- jpeg=9e=h6c40b1e_1
|
| 47 |
+
- jupyter_client=8.2.0=pyhd8ed1ab_0
|
| 48 |
+
- jupyter_core=4.12.0=py38h50d1736_0
|
| 49 |
+
- korean_lunar_calendar=0.3.1=pyhd8ed1ab_0
|
| 50 |
+
- lame=3.100=h1de35cc_0
|
| 51 |
+
- lcms2=2.12=hf1fd2bf_0
|
| 52 |
+
- lerc=3.0=he9d5cce_0
|
| 53 |
+
- libcxx=14.0.6=h9765a3e_0
|
| 54 |
+
- libdeflate=1.17=hb664fd8_0
|
| 55 |
+
- libffi=3.4.4=hecd8cb5_0
|
| 56 |
+
- libiconv=1.16=hca72f7f_2
|
| 57 |
+
- libidn2=2.3.2=h9ed2024_0
|
| 58 |
+
- libpng=1.6.39=h6c40b1e_0
|
| 59 |
+
- libsodium=1.0.18=hbcb3906_1
|
| 60 |
+
- libtasn1=4.19.0=h6c40b1e_0
|
| 61 |
+
- libtiff=4.5.0=hcec6c5f_2
|
| 62 |
+
- libunistring=0.9.10=h9ed2024_0
|
| 63 |
+
- libwebp=1.2.4=hf6ce154_1
|
| 64 |
+
- libwebp-base=1.2.4=h6c40b1e_1
|
| 65 |
+
- libxml2=2.10.3=h930c0e2_0
|
| 66 |
+
- llvm-openmp=14.0.6=h0dcd299_0
|
| 67 |
+
- lz4-c=1.9.4=hcec6c5f_0
|
| 68 |
+
- markupsafe=2.1.1=py38hca72f7f_0
|
| 69 |
+
- matplotlib-inline=0.1.6=pyhd8ed1ab_0
|
| 70 |
+
- mkl=2023.1.0=h59209a4_43558
|
| 71 |
+
- mkl-service=2.4.0=py38h6c40b1e_1
|
| 72 |
+
- mkl_fft=1.3.6=py38h07fba90_1
|
| 73 |
+
- mkl_random=1.2.2=py38h07fba90_1
|
| 74 |
+
- mpc=1.1.0=h6ef4df4_1
|
| 75 |
+
- mpfr=4.0.2=h9066e36_1
|
| 76 |
+
- mpmath=1.2.1=py38hecd8cb5_0
|
| 77 |
+
- ncurses=6.4=hcec6c5f_0
|
| 78 |
+
- nest-asyncio=1.5.6=pyhd8ed1ab_0
|
| 79 |
+
- nettle=3.7.3=h230ac6f_1
|
| 80 |
+
- networkx=2.8.4=py38hecd8cb5_1
|
| 81 |
+
- numexpr=2.8.4=py38h47b59a4_1
|
| 82 |
+
- numpy=1.23.5=py38h47b59a4_1
|
| 83 |
+
- numpy-base=1.23.5=py38hcfaf2c3_1
|
| 84 |
+
- openh264=2.1.1=h8346a28_0
|
| 85 |
+
- openssl=1.1.1t=hfd90126_0
|
| 86 |
+
- packaging=23.1=pyhd8ed1ab_0
|
| 87 |
+
- pandas=1.4.2=py38he9d5cce_0
|
| 88 |
+
- parso=0.8.3=pyhd8ed1ab_0
|
| 89 |
+
- pexpect=4.8.0=pyh1a96a4e_2
|
| 90 |
+
- pickleshare=0.7.5=py_1003
|
| 91 |
+
- pillow=9.4.0=py38hcec6c5f_0
|
| 92 |
+
- pip=23.0.1=py38hecd8cb5_0
|
| 93 |
+
- prompt-toolkit=3.0.38=pyha770c72_0
|
| 94 |
+
- psutil=5.9.5=py38hef030d1_0
|
| 95 |
+
- ptyprocess=0.7.0=pyhd3deb0d_0
|
| 96 |
+
- pure_eval=0.2.2=pyhd8ed1ab_0
|
| 97 |
+
- pycparser=2.21=pyhd3eb1b0_0
|
| 98 |
+
- pygments=2.15.1=pyhd8ed1ab_0
|
| 99 |
+
- pymeeus=0.5.12=pyhd8ed1ab_0
|
| 100 |
+
- pyopenssl=23.0.0=py38hecd8cb5_0
|
| 101 |
+
- pysocks=1.7.1=py38_1
|
| 102 |
+
- python=3.8.16=h218abb5_3
|
| 103 |
+
- python-dateutil=2.8.2=pyhd8ed1ab_0
|
| 104 |
+
- python_abi=3.8=2_cp38
|
| 105 |
+
- pytorch=2.0.1=py3.8_0
|
| 106 |
+
- pytz=2022.1=py38hecd8cb5_0
|
| 107 |
+
- pyzmq=25.0.2=py38h0b711fd_0
|
| 108 |
+
- readline=8.2=hca72f7f_0
|
| 109 |
+
- requests=2.29.0=py38hecd8cb5_0
|
| 110 |
+
- setuptools=66.0.0=py38hecd8cb5_0
|
| 111 |
+
- six=1.16.0=pyh6c4a22f_0
|
| 112 |
+
- sqlite=3.41.2=h6c40b1e_0
|
| 113 |
+
- stack_data=0.6.2=pyhd8ed1ab_0
|
| 114 |
+
- sympy=1.11.1=py38hecd8cb5_0
|
| 115 |
+
- tbb=2021.8.0=ha357a0b_0
|
| 116 |
+
- tk=8.6.12=h5d9f67b_0
|
| 117 |
+
- torchaudio=2.0.2=py38_cpu
|
| 118 |
+
- torchvision=0.15.2=py38_cpu
|
| 119 |
+
- tornado=6.3.2=py38hcafd530_0
|
| 120 |
+
- traitlets=5.9.0=pyhd8ed1ab_0
|
| 121 |
+
- typing_extensions=4.5.0=py38hecd8cb5_0
|
| 122 |
+
- urllib3=1.26.15=py38hecd8cb5_0
|
| 123 |
+
- wcwidth=0.2.6=pyhd8ed1ab_0
|
| 124 |
+
- wheel=0.38.4=py38hecd8cb5_0
|
| 125 |
+
- xz=5.4.2=h6c40b1e_0
|
| 126 |
+
- zeromq=4.3.4=he49afe7_1
|
| 127 |
+
- zipp=3.15.0=pyhd8ed1ab_0
|
| 128 |
+
- zlib=1.2.13=h4dc903c_0
|
| 129 |
+
- zstd=1.5.5=hc035e20_0
|
| 130 |
+
prefix: /Users/servandodavidtorresgarcia/miniconda3/envs/relu
|
modal_intro.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import modal
|
| 2 |
+
|
| 3 |
+
stub = modal.Stub("example-get-started")
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
@stub.function()
|
| 7 |
+
def square(x):
|
| 8 |
+
print("This code is running on a remote worker!")
|
| 9 |
+
return x**2
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
@stub.local_entrypoint()
|
| 13 |
+
def main():
|
| 14 |
+
print("the square is", square.call(42))
|
notebooks/allbooks.ipynb
ADDED
|
@@ -0,0 +1,1849 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 7,
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"outputs": [],
|
| 8 |
+
"source": [
|
| 9 |
+
"from pathlib import Path\n",
|
| 10 |
+
"from src.data.dataset_reader import DatasetReader\n",
|
| 11 |
+
"data_folder = Path(\"../data/raw\").resolve()\n",
|
| 12 |
+
"%load_ext autoreload\n",
|
| 13 |
+
"%autoreload 2\n"
|
| 14 |
+
]
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"cell_type": "code",
|
| 18 |
+
"execution_count": 3,
|
| 19 |
+
"metadata": {},
|
| 20 |
+
"outputs": [],
|
| 21 |
+
"source": [
|
| 22 |
+
"df = DatasetReader(data_folder).get_data_excel('allpoint_book3.2.xlsx')"
|
| 23 |
+
]
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"cell_type": "code",
|
| 27 |
+
"execution_count": 5,
|
| 28 |
+
"metadata": {},
|
| 29 |
+
"outputs": [
|
| 30 |
+
{
|
| 31 |
+
"data": {
|
| 32 |
+
"text/html": [
|
| 33 |
+
"<div>\n",
|
| 34 |
+
"<style scoped>\n",
|
| 35 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 36 |
+
" vertical-align: middle;\n",
|
| 37 |
+
" }\n",
|
| 38 |
+
"\n",
|
| 39 |
+
" .dataframe tbody tr th {\n",
|
| 40 |
+
" vertical-align: top;\n",
|
| 41 |
+
" }\n",
|
| 42 |
+
"\n",
|
| 43 |
+
" .dataframe thead th {\n",
|
| 44 |
+
" text-align: right;\n",
|
| 45 |
+
" }\n",
|
| 46 |
+
"</style>\n",
|
| 47 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 48 |
+
" <thead>\n",
|
| 49 |
+
" <tr style=\"text-align: right;\">\n",
|
| 50 |
+
" <th></th>\n",
|
| 51 |
+
" <th>Product</th>\n",
|
| 52 |
+
" <th>Product (dash)</th>\n",
|
| 53 |
+
" <th>AllPoints OEM Part Number</th>\n",
|
| 54 |
+
" <th>OEM Part Number</th>\n",
|
| 55 |
+
" <th>OEM</th>\n",
|
| 56 |
+
" <th>Description</th>\n",
|
| 57 |
+
" <th>Stock Item</th>\n",
|
| 58 |
+
" <th>Unit of Stock</th>\n",
|
| 59 |
+
" <th>Dim Weight</th>\n",
|
| 60 |
+
" <th>Weight</th>\n",
|
| 61 |
+
" <th>Length</th>\n",
|
| 62 |
+
" <th>Width</th>\n",
|
| 63 |
+
" <th>Height</th>\n",
|
| 64 |
+
" <th>Product Notes</th>\n",
|
| 65 |
+
" <th>List Price</th>\n",
|
| 66 |
+
" <th>Prior Month List Price</th>\n",
|
| 67 |
+
" <th>Price</th>\n",
|
| 68 |
+
" <th>Last Month Price</th>\n",
|
| 69 |
+
" <th>The cheapest price online store</th>\n",
|
| 70 |
+
" <th>% (Only online stores)</th>\n",
|
| 71 |
+
" <th>The cheapest price all</th>\n",
|
| 72 |
+
" <th>% all +Marketplace)</th>\n",
|
| 73 |
+
" <th>The cheapest price (Partstown)</th>\n",
|
| 74 |
+
" <th>% OEM (Partstown)</th>\n",
|
| 75 |
+
" <th>Hazardous</th>\n",
|
| 76 |
+
" <th>Country of Origin</th>\n",
|
| 77 |
+
" <th>Image Location</th>\n",
|
| 78 |
+
" <th>Product Category</th>\n",
|
| 79 |
+
" <th>Added to Catalog Date</th>\n",
|
| 80 |
+
" <th>Image Date</th>\n",
|
| 81 |
+
" <th>Product Type</th>\n",
|
| 82 |
+
" <th>Url a2z</th>\n",
|
| 83 |
+
" <th>Link crossref</th>\n",
|
| 84 |
+
" <th>Link all</th>\n",
|
| 85 |
+
" <th>Link Partstown</th>\n",
|
| 86 |
+
" <th>Category</th>\n",
|
| 87 |
+
" </tr>\n",
|
| 88 |
+
" </thead>\n",
|
| 89 |
+
" <tbody>\n",
|
| 90 |
+
" <tr>\n",
|
| 91 |
+
" <th>0</th>\n",
|
| 92 |
+
" <td>1001006</td>\n",
|
| 93 |
+
" <td>100-1006</td>\n",
|
| 94 |
+
" <td>SKL6314-1012-6000</td>\n",
|
| 95 |
+
" <td>6314-1012-6000</td>\n",
|
| 96 |
+
" <td>Standard Keil</td>\n",
|
| 97 |
+
" <td>WASHER, FLANGE (F/ 3\"OD WASTE)</td>\n",
|
| 98 |
+
" <td>Yes</td>\n",
|
| 99 |
+
" <td>EA</td>\n",
|
| 100 |
+
" <td>0.05000</td>\n",
|
| 101 |
+
" <td>0.050</td>\n",
|
| 102 |
+
" <td>3.0</td>\n",
|
| 103 |
+
" <td>3.00</td>\n",
|
| 104 |
+
" <td>0.1</td>\n",
|
| 105 |
+
" <td>3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN...</td>\n",
|
| 106 |
+
" <td>1.4</td>\n",
|
| 107 |
+
" <td>1.4</td>\n",
|
| 108 |
+
" <td>0.58</td>\n",
|
| 109 |
+
" <td>0.58</td>\n",
|
| 110 |
+
" <td>0,71</td>\n",
|
| 111 |
+
" <td>22,41</td>\n",
|
| 112 |
+
" <td>0,71</td>\n",
|
| 113 |
+
" <td>22,41</td>\n",
|
| 114 |
+
" <td>NaN</td>\n",
|
| 115 |
+
" <td>NaN</td>\n",
|
| 116 |
+
" <td>False</td>\n",
|
| 117 |
+
" <td>United States</td>\n",
|
| 118 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 119 |
+
" <td>Parts</td>\n",
|
| 120 |
+
" <td>2020-11-12</td>\n",
|
| 121 |
+
" <td>2022-11-29</td>\n",
|
| 122 |
+
" <td>Mavrik</td>\n",
|
| 123 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/6...</td>\n",
|
| 124 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 125 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 126 |
+
" <td>NaN</td>\n",
|
| 127 |
+
" <td>NaN</td>\n",
|
| 128 |
+
" </tr>\n",
|
| 129 |
+
" <tr>\n",
|
| 130 |
+
" <th>1</th>\n",
|
| 131 |
+
" <td>1001012</td>\n",
|
| 132 |
+
" <td>100-1012</td>\n",
|
| 133 |
+
" <td>SKL1755-1015-1000</td>\n",
|
| 134 |
+
" <td>1755-1015-1000</td>\n",
|
| 135 |
+
" <td>Standard Keil</td>\n",
|
| 136 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 137 |
+
" <td>Yes</td>\n",
|
| 138 |
+
" <td>EA</td>\n",
|
| 139 |
+
" <td>4.32125</td>\n",
|
| 140 |
+
" <td>3.457</td>\n",
|
| 141 |
+
" <td>11.0</td>\n",
|
| 142 |
+
" <td>4.25</td>\n",
|
| 143 |
+
" <td>4.5</td>\n",
|
| 144 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 145 |
+
" <td>94.8</td>\n",
|
| 146 |
+
" <td>94.8</td>\n",
|
| 147 |
+
" <td>41.58</td>\n",
|
| 148 |
+
" <td>41.58</td>\n",
|
| 149 |
+
" <td>50,73</td>\n",
|
| 150 |
+
" <td>22,01</td>\n",
|
| 151 |
+
" <td>50,73</td>\n",
|
| 152 |
+
" <td>22,01</td>\n",
|
| 153 |
+
" <td>NaN</td>\n",
|
| 154 |
+
" <td>NaN</td>\n",
|
| 155 |
+
" <td>False</td>\n",
|
| 156 |
+
" <td>China</td>\n",
|
| 157 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 158 |
+
" <td>Parts</td>\n",
|
| 159 |
+
" <td>2015-12-08</td>\n",
|
| 160 |
+
" <td>2021-06-09</td>\n",
|
| 161 |
+
" <td>Mavrik</td>\n",
|
| 162 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 163 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 164 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 165 |
+
" <td>NaN</td>\n",
|
| 166 |
+
" <td>NaN</td>\n",
|
| 167 |
+
" </tr>\n",
|
| 168 |
+
" </tbody>\n",
|
| 169 |
+
"</table>\n",
|
| 170 |
+
"</div>"
|
| 171 |
+
],
|
| 172 |
+
"text/plain": [
|
| 173 |
+
" Product Product (dash) AllPoints OEM Part Number OEM Part Number \\\n",
|
| 174 |
+
"0 1001006 100-1006 SKL6314-1012-6000 6314-1012-6000 \n",
|
| 175 |
+
"1 1001012 100-1012 SKL1755-1015-1000 1755-1015-1000 \n",
|
| 176 |
+
"\n",
|
| 177 |
+
" OEM Description Stock Item \\\n",
|
| 178 |
+
"0 Standard Keil WASHER, FLANGE (F/ 3\"OD WASTE) Yes \n",
|
| 179 |
+
"1 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 180 |
+
"\n",
|
| 181 |
+
" Unit of Stock Dim Weight Weight Length Width Height \\\n",
|
| 182 |
+
"0 EA 0.05000 0.050 3.0 3.00 0.1 \n",
|
| 183 |
+
"1 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 184 |
+
"\n",
|
| 185 |
+
" Product Notes List Price \\\n",
|
| 186 |
+
"0 3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN... 1.4 \n",
|
| 187 |
+
"1 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 188 |
+
"\n",
|
| 189 |
+
" Prior Month List Price Price Last Month Price \\\n",
|
| 190 |
+
"0 1.4 0.58 0.58 \n",
|
| 191 |
+
"1 94.8 41.58 41.58 \n",
|
| 192 |
+
"\n",
|
| 193 |
+
" The cheapest price online store % (Only online stores) \\\n",
|
| 194 |
+
"0 0,71 22,41 \n",
|
| 195 |
+
"1 50,73 22,01 \n",
|
| 196 |
+
"\n",
|
| 197 |
+
" The cheapest price all % all +Marketplace) The cheapest price (Partstown) \\\n",
|
| 198 |
+
"0 0,71 22,41 NaN \n",
|
| 199 |
+
"1 50,73 22,01 NaN \n",
|
| 200 |
+
"\n",
|
| 201 |
+
" % OEM (Partstown) Hazardous Country of Origin \\\n",
|
| 202 |
+
"0 NaN False United States \n",
|
| 203 |
+
"1 NaN False China \n",
|
| 204 |
+
"\n",
|
| 205 |
+
" Image Location Product Category \\\n",
|
| 206 |
+
"0 https://s3.amazonaws.com/dfs-allpoints-images/... Parts \n",
|
| 207 |
+
"1 https://s3.amazonaws.com/dfs-allpoints-images/... Parts \n",
|
| 208 |
+
"\n",
|
| 209 |
+
" Added to Catalog Date Image Date Product Type \\\n",
|
| 210 |
+
"0 2020-11-12 2022-11-29 Mavrik \n",
|
| 211 |
+
"1 2015-12-08 2021-06-09 Mavrik \n",
|
| 212 |
+
"\n",
|
| 213 |
+
" Url a2z \\\n",
|
| 214 |
+
"0 https://dev.a2zparts.com/parts/standard-keil/6... \n",
|
| 215 |
+
"1 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 216 |
+
"\n",
|
| 217 |
+
" Link crossref \\\n",
|
| 218 |
+
"0 https://www.sharpteksupply.com/commercial-part... \n",
|
| 219 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 220 |
+
"\n",
|
| 221 |
+
" Link all Link Partstown Category \n",
|
| 222 |
+
"0 https://www.sharpteksupply.com/commercial-part... NaN NaN \n",
|
| 223 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... NaN NaN "
|
| 224 |
+
]
|
| 225 |
+
},
|
| 226 |
+
"execution_count": 5,
|
| 227 |
+
"metadata": {},
|
| 228 |
+
"output_type": "execute_result"
|
| 229 |
+
}
|
| 230 |
+
],
|
| 231 |
+
"source": [
|
| 232 |
+
"#show all pandas columns\n",
|
| 233 |
+
"import pandas as pd\n",
|
| 234 |
+
"pd.set_option('display.max_columns', None)\n",
|
| 235 |
+
"df.head(2)"
|
| 236 |
+
]
|
| 237 |
+
},
|
| 238 |
+
{
|
| 239 |
+
"cell_type": "code",
|
| 240 |
+
"execution_count": 6,
|
| 241 |
+
"metadata": {},
|
| 242 |
+
"outputs": [
|
| 243 |
+
{
|
| 244 |
+
"data": {
|
| 245 |
+
"text/html": [
|
| 246 |
+
"<div>\n",
|
| 247 |
+
"<style scoped>\n",
|
| 248 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 249 |
+
" vertical-align: middle;\n",
|
| 250 |
+
" }\n",
|
| 251 |
+
"\n",
|
| 252 |
+
" .dataframe tbody tr th {\n",
|
| 253 |
+
" vertical-align: top;\n",
|
| 254 |
+
" }\n",
|
| 255 |
+
"\n",
|
| 256 |
+
" .dataframe thead th {\n",
|
| 257 |
+
" text-align: right;\n",
|
| 258 |
+
" }\n",
|
| 259 |
+
"</style>\n",
|
| 260 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 261 |
+
" <thead>\n",
|
| 262 |
+
" <tr style=\"text-align: right;\">\n",
|
| 263 |
+
" <th></th>\n",
|
| 264 |
+
" <th>Product</th>\n",
|
| 265 |
+
" <th>Product (dash)</th>\n",
|
| 266 |
+
" <th>AllPoints OEM Part Number</th>\n",
|
| 267 |
+
" <th>OEM Part Number</th>\n",
|
| 268 |
+
" <th>OEM</th>\n",
|
| 269 |
+
" <th>Description</th>\n",
|
| 270 |
+
" <th>Stock Item</th>\n",
|
| 271 |
+
" <th>Unit of Stock</th>\n",
|
| 272 |
+
" <th>Dim Weight</th>\n",
|
| 273 |
+
" <th>Weight</th>\n",
|
| 274 |
+
" <th>Length</th>\n",
|
| 275 |
+
" <th>Width</th>\n",
|
| 276 |
+
" <th>Height</th>\n",
|
| 277 |
+
" <th>Product Notes</th>\n",
|
| 278 |
+
" <th>List Price</th>\n",
|
| 279 |
+
" <th>Prior Month List Price</th>\n",
|
| 280 |
+
" <th>Price</th>\n",
|
| 281 |
+
" <th>Last Month Price</th>\n",
|
| 282 |
+
" <th>The cheapest price online store</th>\n",
|
| 283 |
+
" <th>% (Only online stores)</th>\n",
|
| 284 |
+
" <th>The cheapest price all</th>\n",
|
| 285 |
+
" <th>% all +Marketplace)</th>\n",
|
| 286 |
+
" <th>The cheapest price (Partstown)</th>\n",
|
| 287 |
+
" <th>% OEM (Partstown)</th>\n",
|
| 288 |
+
" <th>Hazardous</th>\n",
|
| 289 |
+
" <th>Country of Origin</th>\n",
|
| 290 |
+
" <th>Image Location</th>\n",
|
| 291 |
+
" <th>Product Category</th>\n",
|
| 292 |
+
" <th>Added to Catalog Date</th>\n",
|
| 293 |
+
" <th>Image Date</th>\n",
|
| 294 |
+
" <th>Product Type</th>\n",
|
| 295 |
+
" <th>Url a2z</th>\n",
|
| 296 |
+
" <th>Link crossref</th>\n",
|
| 297 |
+
" <th>Link all</th>\n",
|
| 298 |
+
" <th>Link Partstown</th>\n",
|
| 299 |
+
" <th>Category</th>\n",
|
| 300 |
+
" </tr>\n",
|
| 301 |
+
" </thead>\n",
|
| 302 |
+
" <tbody>\n",
|
| 303 |
+
" <tr>\n",
|
| 304 |
+
" <th>0</th>\n",
|
| 305 |
+
" <td>1001006</td>\n",
|
| 306 |
+
" <td>100-1006</td>\n",
|
| 307 |
+
" <td>SKL6314-1012-6000</td>\n",
|
| 308 |
+
" <td>6314-1012-6000</td>\n",
|
| 309 |
+
" <td>Standard Keil</td>\n",
|
| 310 |
+
" <td>WASHER, FLANGE (F/ 3\"OD WASTE)</td>\n",
|
| 311 |
+
" <td>Yes</td>\n",
|
| 312 |
+
" <td>EA</td>\n",
|
| 313 |
+
" <td>0.05000</td>\n",
|
| 314 |
+
" <td>0.050</td>\n",
|
| 315 |
+
" <td>3.0</td>\n",
|
| 316 |
+
" <td>3.00</td>\n",
|
| 317 |
+
" <td>0.1</td>\n",
|
| 318 |
+
" <td>3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN...</td>\n",
|
| 319 |
+
" <td>1.4</td>\n",
|
| 320 |
+
" <td>1.4</td>\n",
|
| 321 |
+
" <td>0.58</td>\n",
|
| 322 |
+
" <td>0.58</td>\n",
|
| 323 |
+
" <td>0,71</td>\n",
|
| 324 |
+
" <td>22,41</td>\n",
|
| 325 |
+
" <td>0,71</td>\n",
|
| 326 |
+
" <td>22,41</td>\n",
|
| 327 |
+
" <td>NaN</td>\n",
|
| 328 |
+
" <td>NaN</td>\n",
|
| 329 |
+
" <td>False</td>\n",
|
| 330 |
+
" <td>United States</td>\n",
|
| 331 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 332 |
+
" <td>Parts</td>\n",
|
| 333 |
+
" <td>2020-11-12</td>\n",
|
| 334 |
+
" <td>2022-11-29</td>\n",
|
| 335 |
+
" <td>Mavrik</td>\n",
|
| 336 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/6...</td>\n",
|
| 337 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 338 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 339 |
+
" <td>NaN</td>\n",
|
| 340 |
+
" <td>NaN</td>\n",
|
| 341 |
+
" </tr>\n",
|
| 342 |
+
" <tr>\n",
|
| 343 |
+
" <th>1</th>\n",
|
| 344 |
+
" <td>1001012</td>\n",
|
| 345 |
+
" <td>100-1012</td>\n",
|
| 346 |
+
" <td>SKL1755-1015-1000</td>\n",
|
| 347 |
+
" <td>1755-1015-1000</td>\n",
|
| 348 |
+
" <td>Standard Keil</td>\n",
|
| 349 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 350 |
+
" <td>Yes</td>\n",
|
| 351 |
+
" <td>EA</td>\n",
|
| 352 |
+
" <td>4.32125</td>\n",
|
| 353 |
+
" <td>3.457</td>\n",
|
| 354 |
+
" <td>11.0</td>\n",
|
| 355 |
+
" <td>4.25</td>\n",
|
| 356 |
+
" <td>4.5</td>\n",
|
| 357 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 358 |
+
" <td>94.8</td>\n",
|
| 359 |
+
" <td>94.8</td>\n",
|
| 360 |
+
" <td>41.58</td>\n",
|
| 361 |
+
" <td>41.58</td>\n",
|
| 362 |
+
" <td>50,73</td>\n",
|
| 363 |
+
" <td>22,01</td>\n",
|
| 364 |
+
" <td>50,73</td>\n",
|
| 365 |
+
" <td>22,01</td>\n",
|
| 366 |
+
" <td>NaN</td>\n",
|
| 367 |
+
" <td>NaN</td>\n",
|
| 368 |
+
" <td>False</td>\n",
|
| 369 |
+
" <td>China</td>\n",
|
| 370 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 371 |
+
" <td>Parts</td>\n",
|
| 372 |
+
" <td>2015-12-08</td>\n",
|
| 373 |
+
" <td>2021-06-09</td>\n",
|
| 374 |
+
" <td>Mavrik</td>\n",
|
| 375 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 376 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 377 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 378 |
+
" <td>NaN</td>\n",
|
| 379 |
+
" <td>NaN</td>\n",
|
| 380 |
+
" </tr>\n",
|
| 381 |
+
" </tbody>\n",
|
| 382 |
+
"</table>\n",
|
| 383 |
+
"</div>"
|
| 384 |
+
],
|
| 385 |
+
"text/plain": [
|
| 386 |
+
" Product Product (dash) AllPoints OEM Part Number OEM Part Number \\\n",
|
| 387 |
+
"0 1001006 100-1006 SKL6314-1012-6000 6314-1012-6000 \n",
|
| 388 |
+
"1 1001012 100-1012 SKL1755-1015-1000 1755-1015-1000 \n",
|
| 389 |
+
"\n",
|
| 390 |
+
" OEM Description Stock Item \\\n",
|
| 391 |
+
"0 Standard Keil WASHER, FLANGE (F/ 3\"OD WASTE) Yes \n",
|
| 392 |
+
"1 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 393 |
+
"\n",
|
| 394 |
+
" Unit of Stock Dim Weight Weight Length Width Height \\\n",
|
| 395 |
+
"0 EA 0.05000 0.050 3.0 3.00 0.1 \n",
|
| 396 |
+
"1 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 397 |
+
"\n",
|
| 398 |
+
" Product Notes List Price \\\n",
|
| 399 |
+
"0 3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN... 1.4 \n",
|
| 400 |
+
"1 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 401 |
+
"\n",
|
| 402 |
+
" Prior Month List Price Price Last Month Price \\\n",
|
| 403 |
+
"0 1.4 0.58 0.58 \n",
|
| 404 |
+
"1 94.8 41.58 41.58 \n",
|
| 405 |
+
"\n",
|
| 406 |
+
" The cheapest price online store % (Only online stores) \\\n",
|
| 407 |
+
"0 0,71 22,41 \n",
|
| 408 |
+
"1 50,73 22,01 \n",
|
| 409 |
+
"\n",
|
| 410 |
+
" The cheapest price all % all +Marketplace) The cheapest price (Partstown) \\\n",
|
| 411 |
+
"0 0,71 22,41 NaN \n",
|
| 412 |
+
"1 50,73 22,01 NaN \n",
|
| 413 |
+
"\n",
|
| 414 |
+
" % OEM (Partstown) Hazardous Country of Origin \\\n",
|
| 415 |
+
"0 NaN False United States \n",
|
| 416 |
+
"1 NaN False China \n",
|
| 417 |
+
"\n",
|
| 418 |
+
" Image Location Product Category \\\n",
|
| 419 |
+
"0 https://s3.amazonaws.com/dfs-allpoints-images/... Parts \n",
|
| 420 |
+
"1 https://s3.amazonaws.com/dfs-allpoints-images/... Parts \n",
|
| 421 |
+
"\n",
|
| 422 |
+
" Added to Catalog Date Image Date Product Type \\\n",
|
| 423 |
+
"0 2020-11-12 2022-11-29 Mavrik \n",
|
| 424 |
+
"1 2015-12-08 2021-06-09 Mavrik \n",
|
| 425 |
+
"\n",
|
| 426 |
+
" Url a2z \\\n",
|
| 427 |
+
"0 https://dev.a2zparts.com/parts/standard-keil/6... \n",
|
| 428 |
+
"1 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 429 |
+
"\n",
|
| 430 |
+
" Link crossref \\\n",
|
| 431 |
+
"0 https://www.sharpteksupply.com/commercial-part... \n",
|
| 432 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 433 |
+
"\n",
|
| 434 |
+
" Link all Link Partstown Category \n",
|
| 435 |
+
"0 https://www.sharpteksupply.com/commercial-part... NaN NaN \n",
|
| 436 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... NaN NaN "
|
| 437 |
+
]
|
| 438 |
+
},
|
| 439 |
+
"execution_count": 6,
|
| 440 |
+
"metadata": {},
|
| 441 |
+
"output_type": "execute_result"
|
| 442 |
+
}
|
| 443 |
+
],
|
| 444 |
+
"source": [
|
| 445 |
+
"# Convert Added to Catalog Date to datetime yyyy-mm-dd\n",
|
| 446 |
+
"df['Added to Catalog Date'] =pd.to_datetime(df['Added to Catalog Date'], errors='coerce')\n",
|
| 447 |
+
"df['Image Date'] = pd.to_datetime(df['Image Date'], errors='coerce')\n",
|
| 448 |
+
"df.head(2)"
|
| 449 |
+
]
|
| 450 |
+
},
|
| 451 |
+
{
|
| 452 |
+
"cell_type": "code",
|
| 453 |
+
"execution_count": 8,
|
| 454 |
+
"metadata": {},
|
| 455 |
+
"outputs": [],
|
| 456 |
+
"source": [
|
| 457 |
+
"from src.data.utils import Utils\n",
|
| 458 |
+
"df['The cheapest price online store'] = df['The cheapest price online store'].apply(Utils.convert_to_float)\n",
|
| 459 |
+
"df['% (Only online stores)'] = df['% (Only online stores)'].apply(Utils.convert_to_float)\n",
|
| 460 |
+
"df['The cheapest price all'] = df['The cheapest price all'].apply(Utils.convert_to_float)\n",
|
| 461 |
+
"df['% all +Marketplace)'] = df['% all +Marketplace)'].apply(Utils.convert_to_float)\n",
|
| 462 |
+
"df['The cheapest price (Partstown)'] = df['The cheapest price (Partstown)'].apply(Utils.convert_to_float)\n",
|
| 463 |
+
"df['% OEM (Partstown)'] = df['% OEM (Partstown)'].apply(Utils.convert_to_float)"
|
| 464 |
+
]
|
| 465 |
+
},
|
| 466 |
+
{
|
| 467 |
+
"cell_type": "code",
|
| 468 |
+
"execution_count": 9,
|
| 469 |
+
"metadata": {},
|
| 470 |
+
"outputs": [
|
| 471 |
+
{
|
| 472 |
+
"data": {
|
| 473 |
+
"text/html": [
|
| 474 |
+
"<div>\n",
|
| 475 |
+
"<style scoped>\n",
|
| 476 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 477 |
+
" vertical-align: middle;\n",
|
| 478 |
+
" }\n",
|
| 479 |
+
"\n",
|
| 480 |
+
" .dataframe tbody tr th {\n",
|
| 481 |
+
" vertical-align: top;\n",
|
| 482 |
+
" }\n",
|
| 483 |
+
"\n",
|
| 484 |
+
" .dataframe thead th {\n",
|
| 485 |
+
" text-align: right;\n",
|
| 486 |
+
" }\n",
|
| 487 |
+
"</style>\n",
|
| 488 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 489 |
+
" <thead>\n",
|
| 490 |
+
" <tr style=\"text-align: right;\">\n",
|
| 491 |
+
" <th></th>\n",
|
| 492 |
+
" <th>Product</th>\n",
|
| 493 |
+
" <th>Product (dash)</th>\n",
|
| 494 |
+
" <th>AllPoints OEM Part Number</th>\n",
|
| 495 |
+
" <th>OEM Part Number</th>\n",
|
| 496 |
+
" <th>OEM</th>\n",
|
| 497 |
+
" <th>Description</th>\n",
|
| 498 |
+
" <th>Stock Item</th>\n",
|
| 499 |
+
" <th>Unit of Stock</th>\n",
|
| 500 |
+
" <th>Dim Weight</th>\n",
|
| 501 |
+
" <th>Weight</th>\n",
|
| 502 |
+
" <th>Length</th>\n",
|
| 503 |
+
" <th>Width</th>\n",
|
| 504 |
+
" <th>Height</th>\n",
|
| 505 |
+
" <th>Product Notes</th>\n",
|
| 506 |
+
" <th>List Price</th>\n",
|
| 507 |
+
" <th>Prior Month List Price</th>\n",
|
| 508 |
+
" <th>Price</th>\n",
|
| 509 |
+
" <th>Last Month Price</th>\n",
|
| 510 |
+
" <th>The cheapest price online store</th>\n",
|
| 511 |
+
" <th>% (Only online stores)</th>\n",
|
| 512 |
+
" <th>The cheapest price all</th>\n",
|
| 513 |
+
" <th>% all +Marketplace)</th>\n",
|
| 514 |
+
" <th>The cheapest price (Partstown)</th>\n",
|
| 515 |
+
" <th>% OEM (Partstown)</th>\n",
|
| 516 |
+
" <th>Hazardous</th>\n",
|
| 517 |
+
" <th>Country of Origin</th>\n",
|
| 518 |
+
" <th>Image Location</th>\n",
|
| 519 |
+
" <th>Product Category</th>\n",
|
| 520 |
+
" <th>Added to Catalog Date</th>\n",
|
| 521 |
+
" <th>Image Date</th>\n",
|
| 522 |
+
" <th>Product Type</th>\n",
|
| 523 |
+
" <th>Url a2z</th>\n",
|
| 524 |
+
" <th>Link crossref</th>\n",
|
| 525 |
+
" <th>Link all</th>\n",
|
| 526 |
+
" <th>Link Partstown</th>\n",
|
| 527 |
+
" <th>Category</th>\n",
|
| 528 |
+
" </tr>\n",
|
| 529 |
+
" </thead>\n",
|
| 530 |
+
" <tbody>\n",
|
| 531 |
+
" <tr>\n",
|
| 532 |
+
" <th>0</th>\n",
|
| 533 |
+
" <td>1001006</td>\n",
|
| 534 |
+
" <td>100-1006</td>\n",
|
| 535 |
+
" <td>SKL6314-1012-6000</td>\n",
|
| 536 |
+
" <td>6314-1012-6000</td>\n",
|
| 537 |
+
" <td>Standard Keil</td>\n",
|
| 538 |
+
" <td>WASHER, FLANGE (F/ 3\"OD WASTE)</td>\n",
|
| 539 |
+
" <td>Yes</td>\n",
|
| 540 |
+
" <td>EA</td>\n",
|
| 541 |
+
" <td>0.05000</td>\n",
|
| 542 |
+
" <td>0.050</td>\n",
|
| 543 |
+
" <td>3.0</td>\n",
|
| 544 |
+
" <td>3.00</td>\n",
|
| 545 |
+
" <td>0.1</td>\n",
|
| 546 |
+
" <td>3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN...</td>\n",
|
| 547 |
+
" <td>1.4</td>\n",
|
| 548 |
+
" <td>1.4</td>\n",
|
| 549 |
+
" <td>0.58</td>\n",
|
| 550 |
+
" <td>0.58</td>\n",
|
| 551 |
+
" <td>0.71</td>\n",
|
| 552 |
+
" <td>22.41</td>\n",
|
| 553 |
+
" <td>0.71</td>\n",
|
| 554 |
+
" <td>22.41</td>\n",
|
| 555 |
+
" <td>NaN</td>\n",
|
| 556 |
+
" <td>NaN</td>\n",
|
| 557 |
+
" <td>False</td>\n",
|
| 558 |
+
" <td>United States</td>\n",
|
| 559 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 560 |
+
" <td>Parts</td>\n",
|
| 561 |
+
" <td>2020-11-12</td>\n",
|
| 562 |
+
" <td>2022-11-29</td>\n",
|
| 563 |
+
" <td>Mavrik</td>\n",
|
| 564 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/6...</td>\n",
|
| 565 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 566 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 567 |
+
" <td>NaN</td>\n",
|
| 568 |
+
" <td>NaN</td>\n",
|
| 569 |
+
" </tr>\n",
|
| 570 |
+
" <tr>\n",
|
| 571 |
+
" <th>1</th>\n",
|
| 572 |
+
" <td>1001012</td>\n",
|
| 573 |
+
" <td>100-1012</td>\n",
|
| 574 |
+
" <td>SKL1755-1015-1000</td>\n",
|
| 575 |
+
" <td>1755-1015-1000</td>\n",
|
| 576 |
+
" <td>Standard Keil</td>\n",
|
| 577 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 578 |
+
" <td>Yes</td>\n",
|
| 579 |
+
" <td>EA</td>\n",
|
| 580 |
+
" <td>4.32125</td>\n",
|
| 581 |
+
" <td>3.457</td>\n",
|
| 582 |
+
" <td>11.0</td>\n",
|
| 583 |
+
" <td>4.25</td>\n",
|
| 584 |
+
" <td>4.5</td>\n",
|
| 585 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 586 |
+
" <td>94.8</td>\n",
|
| 587 |
+
" <td>94.8</td>\n",
|
| 588 |
+
" <td>41.58</td>\n",
|
| 589 |
+
" <td>41.58</td>\n",
|
| 590 |
+
" <td>50.73</td>\n",
|
| 591 |
+
" <td>22.01</td>\n",
|
| 592 |
+
" <td>50.73</td>\n",
|
| 593 |
+
" <td>22.01</td>\n",
|
| 594 |
+
" <td>NaN</td>\n",
|
| 595 |
+
" <td>NaN</td>\n",
|
| 596 |
+
" <td>False</td>\n",
|
| 597 |
+
" <td>China</td>\n",
|
| 598 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 599 |
+
" <td>Parts</td>\n",
|
| 600 |
+
" <td>2015-12-08</td>\n",
|
| 601 |
+
" <td>2021-06-09</td>\n",
|
| 602 |
+
" <td>Mavrik</td>\n",
|
| 603 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 604 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 605 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 606 |
+
" <td>NaN</td>\n",
|
| 607 |
+
" <td>NaN</td>\n",
|
| 608 |
+
" </tr>\n",
|
| 609 |
+
" </tbody>\n",
|
| 610 |
+
"</table>\n",
|
| 611 |
+
"</div>"
|
| 612 |
+
],
|
| 613 |
+
"text/plain": [
|
| 614 |
+
" Product Product (dash) AllPoints OEM Part Number OEM Part Number \\\n",
|
| 615 |
+
"0 1001006 100-1006 SKL6314-1012-6000 6314-1012-6000 \n",
|
| 616 |
+
"1 1001012 100-1012 SKL1755-1015-1000 1755-1015-1000 \n",
|
| 617 |
+
"\n",
|
| 618 |
+
" OEM Description Stock Item \\\n",
|
| 619 |
+
"0 Standard Keil WASHER, FLANGE (F/ 3\"OD WASTE) Yes \n",
|
| 620 |
+
"1 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 621 |
+
"\n",
|
| 622 |
+
" Unit of Stock Dim Weight Weight Length Width Height \\\n",
|
| 623 |
+
"0 EA 0.05000 0.050 3.0 3.00 0.1 \n",
|
| 624 |
+
"1 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 625 |
+
"\n",
|
| 626 |
+
" Product Notes List Price \\\n",
|
| 627 |
+
"0 3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN... 1.4 \n",
|
| 628 |
+
"1 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 629 |
+
"\n",
|
| 630 |
+
" Prior Month List Price Price Last Month Price \\\n",
|
| 631 |
+
"0 1.4 0.58 0.58 \n",
|
| 632 |
+
"1 94.8 41.58 41.58 \n",
|
| 633 |
+
"\n",
|
| 634 |
+
" The cheapest price online store % (Only online stores) \\\n",
|
| 635 |
+
"0 0.71 22.41 \n",
|
| 636 |
+
"1 50.73 22.01 \n",
|
| 637 |
+
"\n",
|
| 638 |
+
" The cheapest price all % all +Marketplace) \\\n",
|
| 639 |
+
"0 0.71 22.41 \n",
|
| 640 |
+
"1 50.73 22.01 \n",
|
| 641 |
+
"\n",
|
| 642 |
+
" The cheapest price (Partstown) % OEM (Partstown) Hazardous \\\n",
|
| 643 |
+
"0 NaN NaN False \n",
|
| 644 |
+
"1 NaN NaN False \n",
|
| 645 |
+
"\n",
|
| 646 |
+
" Country of Origin Image Location \\\n",
|
| 647 |
+
"0 United States https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 648 |
+
"1 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 649 |
+
"\n",
|
| 650 |
+
" Product Category Added to Catalog Date Image Date Product Type \\\n",
|
| 651 |
+
"0 Parts 2020-11-12 2022-11-29 Mavrik \n",
|
| 652 |
+
"1 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 653 |
+
"\n",
|
| 654 |
+
" Url a2z \\\n",
|
| 655 |
+
"0 https://dev.a2zparts.com/parts/standard-keil/6... \n",
|
| 656 |
+
"1 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 657 |
+
"\n",
|
| 658 |
+
" Link crossref \\\n",
|
| 659 |
+
"0 https://www.sharpteksupply.com/commercial-part... \n",
|
| 660 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 661 |
+
"\n",
|
| 662 |
+
" Link all Link Partstown Category \n",
|
| 663 |
+
"0 https://www.sharpteksupply.com/commercial-part... NaN NaN \n",
|
| 664 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... NaN NaN "
|
| 665 |
+
]
|
| 666 |
+
},
|
| 667 |
+
"execution_count": 9,
|
| 668 |
+
"metadata": {},
|
| 669 |
+
"output_type": "execute_result"
|
| 670 |
+
}
|
| 671 |
+
],
|
| 672 |
+
"source": [
|
| 673 |
+
"df.head(2)"
|
| 674 |
+
]
|
| 675 |
+
},
|
| 676 |
+
{
|
| 677 |
+
"cell_type": "code",
|
| 678 |
+
"execution_count": 10,
|
| 679 |
+
"metadata": {},
|
| 680 |
+
"outputs": [],
|
| 681 |
+
"source": [
|
| 682 |
+
"df = Utils.add_underscore(df)"
|
| 683 |
+
]
|
| 684 |
+
},
|
| 685 |
+
{
|
| 686 |
+
"cell_type": "code",
|
| 687 |
+
"execution_count": 11,
|
| 688 |
+
"metadata": {},
|
| 689 |
+
"outputs": [
|
| 690 |
+
{
|
| 691 |
+
"data": {
|
| 692 |
+
"text/html": [
|
| 693 |
+
"<div>\n",
|
| 694 |
+
"<style scoped>\n",
|
| 695 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 696 |
+
" vertical-align: middle;\n",
|
| 697 |
+
" }\n",
|
| 698 |
+
"\n",
|
| 699 |
+
" .dataframe tbody tr th {\n",
|
| 700 |
+
" vertical-align: top;\n",
|
| 701 |
+
" }\n",
|
| 702 |
+
"\n",
|
| 703 |
+
" .dataframe thead th {\n",
|
| 704 |
+
" text-align: right;\n",
|
| 705 |
+
" }\n",
|
| 706 |
+
"</style>\n",
|
| 707 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 708 |
+
" <thead>\n",
|
| 709 |
+
" <tr style=\"text-align: right;\">\n",
|
| 710 |
+
" <th></th>\n",
|
| 711 |
+
" <th>Product</th>\n",
|
| 712 |
+
" <th>Product_(dash)</th>\n",
|
| 713 |
+
" <th>AllPoints_OEM_Part_Number</th>\n",
|
| 714 |
+
" <th>OEM_Part_Number</th>\n",
|
| 715 |
+
" <th>OEM</th>\n",
|
| 716 |
+
" <th>Description</th>\n",
|
| 717 |
+
" <th>Stock_Item</th>\n",
|
| 718 |
+
" <th>Unit_of_Stock</th>\n",
|
| 719 |
+
" <th>Dim_Weight</th>\n",
|
| 720 |
+
" <th>Weight</th>\n",
|
| 721 |
+
" <th>Length</th>\n",
|
| 722 |
+
" <th>Width</th>\n",
|
| 723 |
+
" <th>Height</th>\n",
|
| 724 |
+
" <th>Product_Notes</th>\n",
|
| 725 |
+
" <th>List_Price</th>\n",
|
| 726 |
+
" <th>Prior_Month_List_Price</th>\n",
|
| 727 |
+
" <th>Price</th>\n",
|
| 728 |
+
" <th>Last_Month_Price</th>\n",
|
| 729 |
+
" <th>The_cheapest_price_online_store</th>\n",
|
| 730 |
+
" <th>%_(Only_online_stores)</th>\n",
|
| 731 |
+
" <th>The_cheapest_price_all</th>\n",
|
| 732 |
+
" <th>%_all_+Marketplace)</th>\n",
|
| 733 |
+
" <th>The_cheapest_price_(Partstown)</th>\n",
|
| 734 |
+
" <th>%_OEM_(Partstown)</th>\n",
|
| 735 |
+
" <th>Hazardous</th>\n",
|
| 736 |
+
" <th>Country_of_Origin</th>\n",
|
| 737 |
+
" <th>Image_Location</th>\n",
|
| 738 |
+
" <th>Product_Category</th>\n",
|
| 739 |
+
" <th>Added_to_Catalog_Date</th>\n",
|
| 740 |
+
" <th>Image_Date</th>\n",
|
| 741 |
+
" <th>Product_Type</th>\n",
|
| 742 |
+
" <th>Url_a2z</th>\n",
|
| 743 |
+
" <th>Link_crossref</th>\n",
|
| 744 |
+
" <th>Link_all</th>\n",
|
| 745 |
+
" <th>Link_Partstown</th>\n",
|
| 746 |
+
" <th>Category</th>\n",
|
| 747 |
+
" </tr>\n",
|
| 748 |
+
" </thead>\n",
|
| 749 |
+
" <tbody>\n",
|
| 750 |
+
" <tr>\n",
|
| 751 |
+
" <th>0</th>\n",
|
| 752 |
+
" <td>1001006</td>\n",
|
| 753 |
+
" <td>100-1006</td>\n",
|
| 754 |
+
" <td>SKL6314-1012-6000</td>\n",
|
| 755 |
+
" <td>6314-1012-6000</td>\n",
|
| 756 |
+
" <td>Standard Keil</td>\n",
|
| 757 |
+
" <td>WASHER, FLANGE (F/ 3\"OD WASTE)</td>\n",
|
| 758 |
+
" <td>Yes</td>\n",
|
| 759 |
+
" <td>EA</td>\n",
|
| 760 |
+
" <td>0.05000</td>\n",
|
| 761 |
+
" <td>0.050</td>\n",
|
| 762 |
+
" <td>3.0</td>\n",
|
| 763 |
+
" <td>3.00</td>\n",
|
| 764 |
+
" <td>0.1</td>\n",
|
| 765 |
+
" <td>3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN...</td>\n",
|
| 766 |
+
" <td>1.4</td>\n",
|
| 767 |
+
" <td>1.4</td>\n",
|
| 768 |
+
" <td>0.58</td>\n",
|
| 769 |
+
" <td>0.58</td>\n",
|
| 770 |
+
" <td>0.71</td>\n",
|
| 771 |
+
" <td>22.41</td>\n",
|
| 772 |
+
" <td>0.71</td>\n",
|
| 773 |
+
" <td>22.41</td>\n",
|
| 774 |
+
" <td>NaN</td>\n",
|
| 775 |
+
" <td>NaN</td>\n",
|
| 776 |
+
" <td>False</td>\n",
|
| 777 |
+
" <td>United States</td>\n",
|
| 778 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 779 |
+
" <td>Parts</td>\n",
|
| 780 |
+
" <td>2020-11-12</td>\n",
|
| 781 |
+
" <td>2022-11-29</td>\n",
|
| 782 |
+
" <td>Mavrik</td>\n",
|
| 783 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/6...</td>\n",
|
| 784 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 785 |
+
" <td>https://www.sharpteksupply.com/commercial-part...</td>\n",
|
| 786 |
+
" <td>NaN</td>\n",
|
| 787 |
+
" <td>NaN</td>\n",
|
| 788 |
+
" </tr>\n",
|
| 789 |
+
" <tr>\n",
|
| 790 |
+
" <th>1</th>\n",
|
| 791 |
+
" <td>1001012</td>\n",
|
| 792 |
+
" <td>100-1012</td>\n",
|
| 793 |
+
" <td>SKL1755-1015-1000</td>\n",
|
| 794 |
+
" <td>1755-1015-1000</td>\n",
|
| 795 |
+
" <td>Standard Keil</td>\n",
|
| 796 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 797 |
+
" <td>Yes</td>\n",
|
| 798 |
+
" <td>EA</td>\n",
|
| 799 |
+
" <td>4.32125</td>\n",
|
| 800 |
+
" <td>3.457</td>\n",
|
| 801 |
+
" <td>11.0</td>\n",
|
| 802 |
+
" <td>4.25</td>\n",
|
| 803 |
+
" <td>4.5</td>\n",
|
| 804 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 805 |
+
" <td>94.8</td>\n",
|
| 806 |
+
" <td>94.8</td>\n",
|
| 807 |
+
" <td>41.58</td>\n",
|
| 808 |
+
" <td>41.58</td>\n",
|
| 809 |
+
" <td>50.73</td>\n",
|
| 810 |
+
" <td>22.01</td>\n",
|
| 811 |
+
" <td>50.73</td>\n",
|
| 812 |
+
" <td>22.01</td>\n",
|
| 813 |
+
" <td>NaN</td>\n",
|
| 814 |
+
" <td>NaN</td>\n",
|
| 815 |
+
" <td>False</td>\n",
|
| 816 |
+
" <td>China</td>\n",
|
| 817 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 818 |
+
" <td>Parts</td>\n",
|
| 819 |
+
" <td>2015-12-08</td>\n",
|
| 820 |
+
" <td>2021-06-09</td>\n",
|
| 821 |
+
" <td>Mavrik</td>\n",
|
| 822 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 823 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 824 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 825 |
+
" <td>NaN</td>\n",
|
| 826 |
+
" <td>NaN</td>\n",
|
| 827 |
+
" </tr>\n",
|
| 828 |
+
" <tr>\n",
|
| 829 |
+
" <th>2</th>\n",
|
| 830 |
+
" <td>1001012</td>\n",
|
| 831 |
+
" <td>100-1012</td>\n",
|
| 832 |
+
" <td>SKL1755-1020-1000</td>\n",
|
| 833 |
+
" <td>1755-1020-1000</td>\n",
|
| 834 |
+
" <td>Standard Keil</td>\n",
|
| 835 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 836 |
+
" <td>Yes</td>\n",
|
| 837 |
+
" <td>EA</td>\n",
|
| 838 |
+
" <td>4.32125</td>\n",
|
| 839 |
+
" <td>3.457</td>\n",
|
| 840 |
+
" <td>11.0</td>\n",
|
| 841 |
+
" <td>4.25</td>\n",
|
| 842 |
+
" <td>4.5</td>\n",
|
| 843 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 844 |
+
" <td>94.8</td>\n",
|
| 845 |
+
" <td>94.8</td>\n",
|
| 846 |
+
" <td>41.58</td>\n",
|
| 847 |
+
" <td>41.58</td>\n",
|
| 848 |
+
" <td>50.73</td>\n",
|
| 849 |
+
" <td>22.01</td>\n",
|
| 850 |
+
" <td>50.73</td>\n",
|
| 851 |
+
" <td>22.01</td>\n",
|
| 852 |
+
" <td>NaN</td>\n",
|
| 853 |
+
" <td>NaN</td>\n",
|
| 854 |
+
" <td>False</td>\n",
|
| 855 |
+
" <td>China</td>\n",
|
| 856 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 857 |
+
" <td>Parts</td>\n",
|
| 858 |
+
" <td>2015-12-08</td>\n",
|
| 859 |
+
" <td>2021-06-09</td>\n",
|
| 860 |
+
" <td>Mavrik</td>\n",
|
| 861 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 862 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 863 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 864 |
+
" <td>NaN</td>\n",
|
| 865 |
+
" <td>NaN</td>\n",
|
| 866 |
+
" </tr>\n",
|
| 867 |
+
" <tr>\n",
|
| 868 |
+
" <th>3</th>\n",
|
| 869 |
+
" <td>1001012</td>\n",
|
| 870 |
+
" <td>100-1012</td>\n",
|
| 871 |
+
" <td>SKL1765-1015-1000</td>\n",
|
| 872 |
+
" <td>1765-1015-1000</td>\n",
|
| 873 |
+
" <td>Standard Keil</td>\n",
|
| 874 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 875 |
+
" <td>Yes</td>\n",
|
| 876 |
+
" <td>EA</td>\n",
|
| 877 |
+
" <td>4.32125</td>\n",
|
| 878 |
+
" <td>3.457</td>\n",
|
| 879 |
+
" <td>11.0</td>\n",
|
| 880 |
+
" <td>4.25</td>\n",
|
| 881 |
+
" <td>4.5</td>\n",
|
| 882 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 883 |
+
" <td>94.8</td>\n",
|
| 884 |
+
" <td>94.8</td>\n",
|
| 885 |
+
" <td>41.58</td>\n",
|
| 886 |
+
" <td>41.58</td>\n",
|
| 887 |
+
" <td>50.73</td>\n",
|
| 888 |
+
" <td>22.01</td>\n",
|
| 889 |
+
" <td>50.73</td>\n",
|
| 890 |
+
" <td>22.01</td>\n",
|
| 891 |
+
" <td>NaN</td>\n",
|
| 892 |
+
" <td>NaN</td>\n",
|
| 893 |
+
" <td>False</td>\n",
|
| 894 |
+
" <td>China</td>\n",
|
| 895 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 896 |
+
" <td>Parts</td>\n",
|
| 897 |
+
" <td>2015-12-08</td>\n",
|
| 898 |
+
" <td>2021-06-09</td>\n",
|
| 899 |
+
" <td>Mavrik</td>\n",
|
| 900 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 901 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 902 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 903 |
+
" <td>NaN</td>\n",
|
| 904 |
+
" <td>NaN</td>\n",
|
| 905 |
+
" </tr>\n",
|
| 906 |
+
" <tr>\n",
|
| 907 |
+
" <th>4</th>\n",
|
| 908 |
+
" <td>1001012</td>\n",
|
| 909 |
+
" <td>100-1012</td>\n",
|
| 910 |
+
" <td>SKL1765-1020-1000</td>\n",
|
| 911 |
+
" <td>1765-1020-1000</td>\n",
|
| 912 |
+
" <td>Standard Keil</td>\n",
|
| 913 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 914 |
+
" <td>Yes</td>\n",
|
| 915 |
+
" <td>EA</td>\n",
|
| 916 |
+
" <td>4.32125</td>\n",
|
| 917 |
+
" <td>3.457</td>\n",
|
| 918 |
+
" <td>11.0</td>\n",
|
| 919 |
+
" <td>4.25</td>\n",
|
| 920 |
+
" <td>4.5</td>\n",
|
| 921 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 922 |
+
" <td>94.8</td>\n",
|
| 923 |
+
" <td>94.8</td>\n",
|
| 924 |
+
" <td>41.58</td>\n",
|
| 925 |
+
" <td>41.58</td>\n",
|
| 926 |
+
" <td>50.73</td>\n",
|
| 927 |
+
" <td>22.01</td>\n",
|
| 928 |
+
" <td>50.73</td>\n",
|
| 929 |
+
" <td>22.01</td>\n",
|
| 930 |
+
" <td>NaN</td>\n",
|
| 931 |
+
" <td>NaN</td>\n",
|
| 932 |
+
" <td>False</td>\n",
|
| 933 |
+
" <td>China</td>\n",
|
| 934 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 935 |
+
" <td>Parts</td>\n",
|
| 936 |
+
" <td>2015-12-08</td>\n",
|
| 937 |
+
" <td>2021-06-09</td>\n",
|
| 938 |
+
" <td>Mavrik</td>\n",
|
| 939 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 940 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 941 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 942 |
+
" <td>NaN</td>\n",
|
| 943 |
+
" <td>NaN</td>\n",
|
| 944 |
+
" </tr>\n",
|
| 945 |
+
" </tbody>\n",
|
| 946 |
+
"</table>\n",
|
| 947 |
+
"</div>"
|
| 948 |
+
],
|
| 949 |
+
"text/plain": [
|
| 950 |
+
" Product Product_(dash) AllPoints_OEM_Part_Number OEM_Part_Number \\\n",
|
| 951 |
+
"0 1001006 100-1006 SKL6314-1012-6000 6314-1012-6000 \n",
|
| 952 |
+
"1 1001012 100-1012 SKL1755-1015-1000 1755-1015-1000 \n",
|
| 953 |
+
"2 1001012 100-1012 SKL1755-1020-1000 1755-1020-1000 \n",
|
| 954 |
+
"3 1001012 100-1012 SKL1765-1015-1000 1765-1015-1000 \n",
|
| 955 |
+
"4 1001012 100-1012 SKL1765-1020-1000 1765-1020-1000 \n",
|
| 956 |
+
"\n",
|
| 957 |
+
" OEM Description Stock_Item \\\n",
|
| 958 |
+
"0 Standard Keil WASHER, FLANGE (F/ 3\"OD WASTE) Yes \n",
|
| 959 |
+
"1 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 960 |
+
"2 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 961 |
+
"3 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 962 |
+
"4 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 963 |
+
"\n",
|
| 964 |
+
" Unit_of_Stock Dim_Weight Weight Length Width Height \\\n",
|
| 965 |
+
"0 EA 0.05000 0.050 3.0 3.00 0.1 \n",
|
| 966 |
+
"1 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 967 |
+
"2 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 968 |
+
"3 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 969 |
+
"4 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 970 |
+
"\n",
|
| 971 |
+
" Product_Notes List_Price \\\n",
|
| 972 |
+
"0 3\" SINK OPENING WASHER FOR LEVER AND TWIST HAN... 1.4 \n",
|
| 973 |
+
"1 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 974 |
+
"2 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 975 |
+
"3 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 976 |
+
"4 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 977 |
+
"\n",
|
| 978 |
+
" Prior_Month_List_Price Price Last_Month_Price \\\n",
|
| 979 |
+
"0 1.4 0.58 0.58 \n",
|
| 980 |
+
"1 94.8 41.58 41.58 \n",
|
| 981 |
+
"2 94.8 41.58 41.58 \n",
|
| 982 |
+
"3 94.8 41.58 41.58 \n",
|
| 983 |
+
"4 94.8 41.58 41.58 \n",
|
| 984 |
+
"\n",
|
| 985 |
+
" The_cheapest_price_online_store %_(Only_online_stores) \\\n",
|
| 986 |
+
"0 0.71 22.41 \n",
|
| 987 |
+
"1 50.73 22.01 \n",
|
| 988 |
+
"2 50.73 22.01 \n",
|
| 989 |
+
"3 50.73 22.01 \n",
|
| 990 |
+
"4 50.73 22.01 \n",
|
| 991 |
+
"\n",
|
| 992 |
+
" The_cheapest_price_all %_all_+Marketplace) \\\n",
|
| 993 |
+
"0 0.71 22.41 \n",
|
| 994 |
+
"1 50.73 22.01 \n",
|
| 995 |
+
"2 50.73 22.01 \n",
|
| 996 |
+
"3 50.73 22.01 \n",
|
| 997 |
+
"4 50.73 22.01 \n",
|
| 998 |
+
"\n",
|
| 999 |
+
" The_cheapest_price_(Partstown) %_OEM_(Partstown) Hazardous \\\n",
|
| 1000 |
+
"0 NaN NaN False \n",
|
| 1001 |
+
"1 NaN NaN False \n",
|
| 1002 |
+
"2 NaN NaN False \n",
|
| 1003 |
+
"3 NaN NaN False \n",
|
| 1004 |
+
"4 NaN NaN False \n",
|
| 1005 |
+
"\n",
|
| 1006 |
+
" Country_of_Origin Image_Location \\\n",
|
| 1007 |
+
"0 United States https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1008 |
+
"1 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1009 |
+
"2 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1010 |
+
"3 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1011 |
+
"4 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1012 |
+
"\n",
|
| 1013 |
+
" Product_Category Added_to_Catalog_Date Image_Date Product_Type \\\n",
|
| 1014 |
+
"0 Parts 2020-11-12 2022-11-29 Mavrik \n",
|
| 1015 |
+
"1 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1016 |
+
"2 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1017 |
+
"3 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1018 |
+
"4 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1019 |
+
"\n",
|
| 1020 |
+
" Url_a2z \\\n",
|
| 1021 |
+
"0 https://dev.a2zparts.com/parts/standard-keil/6... \n",
|
| 1022 |
+
"1 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1023 |
+
"2 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1024 |
+
"3 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1025 |
+
"4 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1026 |
+
"\n",
|
| 1027 |
+
" Link_crossref \\\n",
|
| 1028 |
+
"0 https://www.sharpteksupply.com/commercial-part... \n",
|
| 1029 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1030 |
+
"2 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1031 |
+
"3 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1032 |
+
"4 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1033 |
+
"\n",
|
| 1034 |
+
" Link_all Link_Partstown Category \n",
|
| 1035 |
+
"0 https://www.sharpteksupply.com/commercial-part... NaN NaN \n",
|
| 1036 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... NaN NaN \n",
|
| 1037 |
+
"2 https://www.sharpteksupply.com/sharptek-featur... NaN NaN \n",
|
| 1038 |
+
"3 https://www.sharpteksupply.com/sharptek-featur... NaN NaN \n",
|
| 1039 |
+
"4 https://www.sharpteksupply.com/sharptek-featur... NaN NaN "
|
| 1040 |
+
]
|
| 1041 |
+
},
|
| 1042 |
+
"execution_count": 11,
|
| 1043 |
+
"metadata": {},
|
| 1044 |
+
"output_type": "execute_result"
|
| 1045 |
+
}
|
| 1046 |
+
],
|
| 1047 |
+
"source": [
|
| 1048 |
+
"df.head()"
|
| 1049 |
+
]
|
| 1050 |
+
},
|
| 1051 |
+
{
|
| 1052 |
+
"cell_type": "code",
|
| 1053 |
+
"execution_count": 12,
|
| 1054 |
+
"metadata": {},
|
| 1055 |
+
"outputs": [
|
| 1056 |
+
{
|
| 1057 |
+
"data": {
|
| 1058 |
+
"text/plain": [
|
| 1059 |
+
"(223788, 36)"
|
| 1060 |
+
]
|
| 1061 |
+
},
|
| 1062 |
+
"execution_count": 12,
|
| 1063 |
+
"metadata": {},
|
| 1064 |
+
"output_type": "execute_result"
|
| 1065 |
+
}
|
| 1066 |
+
],
|
| 1067 |
+
"source": [
|
| 1068 |
+
"df.shape"
|
| 1069 |
+
]
|
| 1070 |
+
},
|
| 1071 |
+
{
|
| 1072 |
+
"cell_type": "code",
|
| 1073 |
+
"execution_count": 16,
|
| 1074 |
+
"metadata": {},
|
| 1075 |
+
"outputs": [],
|
| 1076 |
+
"source": [
|
| 1077 |
+
"# show only duplicates \n",
|
| 1078 |
+
"#df[df.duplicated(keep=False)].head()\n",
|
| 1079 |
+
"df.drop_duplicates(inplace=True)"
|
| 1080 |
+
]
|
| 1081 |
+
},
|
| 1082 |
+
{
|
| 1083 |
+
"cell_type": "code",
|
| 1084 |
+
"execution_count": 22,
|
| 1085 |
+
"metadata": {},
|
| 1086 |
+
"outputs": [
|
| 1087 |
+
{
|
| 1088 |
+
"data": {
|
| 1089 |
+
"text/html": [
|
| 1090 |
+
"<div>\n",
|
| 1091 |
+
"<style scoped>\n",
|
| 1092 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1093 |
+
" vertical-align: middle;\n",
|
| 1094 |
+
" }\n",
|
| 1095 |
+
"\n",
|
| 1096 |
+
" .dataframe tbody tr th {\n",
|
| 1097 |
+
" vertical-align: top;\n",
|
| 1098 |
+
" }\n",
|
| 1099 |
+
"\n",
|
| 1100 |
+
" .dataframe thead th {\n",
|
| 1101 |
+
" text-align: right;\n",
|
| 1102 |
+
" }\n",
|
| 1103 |
+
"</style>\n",
|
| 1104 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1105 |
+
" <thead>\n",
|
| 1106 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1107 |
+
" <th></th>\n",
|
| 1108 |
+
" <th>Product_(dash)</th>\n",
|
| 1109 |
+
" <th>AllPoints_OEM_Part_Number</th>\n",
|
| 1110 |
+
" <th>OEM_Part_Number</th>\n",
|
| 1111 |
+
" <th>OEM</th>\n",
|
| 1112 |
+
" <th>Description</th>\n",
|
| 1113 |
+
" <th>Stock_Item</th>\n",
|
| 1114 |
+
" <th>Unit_of_Stock</th>\n",
|
| 1115 |
+
" <th>Dim_Weight</th>\n",
|
| 1116 |
+
" <th>Weight</th>\n",
|
| 1117 |
+
" <th>Length</th>\n",
|
| 1118 |
+
" <th>Width</th>\n",
|
| 1119 |
+
" <th>Height</th>\n",
|
| 1120 |
+
" <th>Product_Notes</th>\n",
|
| 1121 |
+
" <th>List_Price</th>\n",
|
| 1122 |
+
" <th>Prior_Month_List_Price</th>\n",
|
| 1123 |
+
" <th>Price</th>\n",
|
| 1124 |
+
" <th>Last_Month_Price</th>\n",
|
| 1125 |
+
" <th>The_cheapest_price_online_store</th>\n",
|
| 1126 |
+
" <th>%_(Only_online_stores)</th>\n",
|
| 1127 |
+
" <th>The_cheapest_price_all</th>\n",
|
| 1128 |
+
" <th>%_all_+Marketplace)</th>\n",
|
| 1129 |
+
" <th>The_cheapest_price_(Partstown)</th>\n",
|
| 1130 |
+
" <th>%_OEM_(Partstown)</th>\n",
|
| 1131 |
+
" <th>Hazardous</th>\n",
|
| 1132 |
+
" <th>Country_of_Origin</th>\n",
|
| 1133 |
+
" <th>Image_Location</th>\n",
|
| 1134 |
+
" <th>Product_Category</th>\n",
|
| 1135 |
+
" <th>Added_to_Catalog_Date</th>\n",
|
| 1136 |
+
" <th>Image_Date</th>\n",
|
| 1137 |
+
" <th>Product_Type</th>\n",
|
| 1138 |
+
" <th>Url_a2z</th>\n",
|
| 1139 |
+
" <th>Link_crossref</th>\n",
|
| 1140 |
+
" <th>Link_all</th>\n",
|
| 1141 |
+
" <th>Link_Partstown</th>\n",
|
| 1142 |
+
" <th>Category</th>\n",
|
| 1143 |
+
" </tr>\n",
|
| 1144 |
+
" <tr>\n",
|
| 1145 |
+
" <th>Product</th>\n",
|
| 1146 |
+
" <th></th>\n",
|
| 1147 |
+
" <th></th>\n",
|
| 1148 |
+
" <th></th>\n",
|
| 1149 |
+
" <th></th>\n",
|
| 1150 |
+
" <th></th>\n",
|
| 1151 |
+
" <th></th>\n",
|
| 1152 |
+
" <th></th>\n",
|
| 1153 |
+
" <th></th>\n",
|
| 1154 |
+
" <th></th>\n",
|
| 1155 |
+
" <th></th>\n",
|
| 1156 |
+
" <th></th>\n",
|
| 1157 |
+
" <th></th>\n",
|
| 1158 |
+
" <th></th>\n",
|
| 1159 |
+
" <th></th>\n",
|
| 1160 |
+
" <th></th>\n",
|
| 1161 |
+
" <th></th>\n",
|
| 1162 |
+
" <th></th>\n",
|
| 1163 |
+
" <th></th>\n",
|
| 1164 |
+
" <th></th>\n",
|
| 1165 |
+
" <th></th>\n",
|
| 1166 |
+
" <th></th>\n",
|
| 1167 |
+
" <th></th>\n",
|
| 1168 |
+
" <th></th>\n",
|
| 1169 |
+
" <th></th>\n",
|
| 1170 |
+
" <th></th>\n",
|
| 1171 |
+
" <th></th>\n",
|
| 1172 |
+
" <th></th>\n",
|
| 1173 |
+
" <th></th>\n",
|
| 1174 |
+
" <th></th>\n",
|
| 1175 |
+
" <th></th>\n",
|
| 1176 |
+
" <th></th>\n",
|
| 1177 |
+
" <th></th>\n",
|
| 1178 |
+
" <th></th>\n",
|
| 1179 |
+
" <th></th>\n",
|
| 1180 |
+
" <th></th>\n",
|
| 1181 |
+
" </tr>\n",
|
| 1182 |
+
" </thead>\n",
|
| 1183 |
+
" <tbody>\n",
|
| 1184 |
+
" <tr>\n",
|
| 1185 |
+
" <th>N21803179</th>\n",
|
| 1186 |
+
" <td>1</td>\n",
|
| 1187 |
+
" <td>2</td>\n",
|
| 1188 |
+
" <td>2</td>\n",
|
| 1189 |
+
" <td>1</td>\n",
|
| 1190 |
+
" <td>1</td>\n",
|
| 1191 |
+
" <td>1</td>\n",
|
| 1192 |
+
" <td>1</td>\n",
|
| 1193 |
+
" <td>1</td>\n",
|
| 1194 |
+
" <td>1</td>\n",
|
| 1195 |
+
" <td>1</td>\n",
|
| 1196 |
+
" <td>1</td>\n",
|
| 1197 |
+
" <td>1</td>\n",
|
| 1198 |
+
" <td>0</td>\n",
|
| 1199 |
+
" <td>1</td>\n",
|
| 1200 |
+
" <td>1</td>\n",
|
| 1201 |
+
" <td>1</td>\n",
|
| 1202 |
+
" <td>1</td>\n",
|
| 1203 |
+
" <td>1</td>\n",
|
| 1204 |
+
" <td>1</td>\n",
|
| 1205 |
+
" <td>1</td>\n",
|
| 1206 |
+
" <td>1</td>\n",
|
| 1207 |
+
" <td>1</td>\n",
|
| 1208 |
+
" <td>1</td>\n",
|
| 1209 |
+
" <td>1</td>\n",
|
| 1210 |
+
" <td>0</td>\n",
|
| 1211 |
+
" <td>0</td>\n",
|
| 1212 |
+
" <td>1</td>\n",
|
| 1213 |
+
" <td>1</td>\n",
|
| 1214 |
+
" <td>0</td>\n",
|
| 1215 |
+
" <td>1</td>\n",
|
| 1216 |
+
" <td>1</td>\n",
|
| 1217 |
+
" <td>1</td>\n",
|
| 1218 |
+
" <td>1</td>\n",
|
| 1219 |
+
" <td>1</td>\n",
|
| 1220 |
+
" <td>1</td>\n",
|
| 1221 |
+
" </tr>\n",
|
| 1222 |
+
" <tr>\n",
|
| 1223 |
+
" <th>N21740066</th>\n",
|
| 1224 |
+
" <td>1</td>\n",
|
| 1225 |
+
" <td>5</td>\n",
|
| 1226 |
+
" <td>3</td>\n",
|
| 1227 |
+
" <td>2</td>\n",
|
| 1228 |
+
" <td>1</td>\n",
|
| 1229 |
+
" <td>1</td>\n",
|
| 1230 |
+
" <td>1</td>\n",
|
| 1231 |
+
" <td>1</td>\n",
|
| 1232 |
+
" <td>1</td>\n",
|
| 1233 |
+
" <td>1</td>\n",
|
| 1234 |
+
" <td>1</td>\n",
|
| 1235 |
+
" <td>1</td>\n",
|
| 1236 |
+
" <td>0</td>\n",
|
| 1237 |
+
" <td>1</td>\n",
|
| 1238 |
+
" <td>1</td>\n",
|
| 1239 |
+
" <td>1</td>\n",
|
| 1240 |
+
" <td>1</td>\n",
|
| 1241 |
+
" <td>1</td>\n",
|
| 1242 |
+
" <td>1</td>\n",
|
| 1243 |
+
" <td>1</td>\n",
|
| 1244 |
+
" <td>1</td>\n",
|
| 1245 |
+
" <td>1</td>\n",
|
| 1246 |
+
" <td>1</td>\n",
|
| 1247 |
+
" <td>1</td>\n",
|
| 1248 |
+
" <td>0</td>\n",
|
| 1249 |
+
" <td>0</td>\n",
|
| 1250 |
+
" <td>1</td>\n",
|
| 1251 |
+
" <td>1</td>\n",
|
| 1252 |
+
" <td>0</td>\n",
|
| 1253 |
+
" <td>1</td>\n",
|
| 1254 |
+
" <td>2</td>\n",
|
| 1255 |
+
" <td>1</td>\n",
|
| 1256 |
+
" <td>1</td>\n",
|
| 1257 |
+
" <td>1</td>\n",
|
| 1258 |
+
" <td>0</td>\n",
|
| 1259 |
+
" </tr>\n",
|
| 1260 |
+
" <tr>\n",
|
| 1261 |
+
" <th>N21736218</th>\n",
|
| 1262 |
+
" <td>1</td>\n",
|
| 1263 |
+
" <td>5</td>\n",
|
| 1264 |
+
" <td>3</td>\n",
|
| 1265 |
+
" <td>2</td>\n",
|
| 1266 |
+
" <td>1</td>\n",
|
| 1267 |
+
" <td>1</td>\n",
|
| 1268 |
+
" <td>1</td>\n",
|
| 1269 |
+
" <td>1</td>\n",
|
| 1270 |
+
" <td>1</td>\n",
|
| 1271 |
+
" <td>1</td>\n",
|
| 1272 |
+
" <td>1</td>\n",
|
| 1273 |
+
" <td>1</td>\n",
|
| 1274 |
+
" <td>0</td>\n",
|
| 1275 |
+
" <td>1</td>\n",
|
| 1276 |
+
" <td>1</td>\n",
|
| 1277 |
+
" <td>1</td>\n",
|
| 1278 |
+
" <td>1</td>\n",
|
| 1279 |
+
" <td>1</td>\n",
|
| 1280 |
+
" <td>1</td>\n",
|
| 1281 |
+
" <td>1</td>\n",
|
| 1282 |
+
" <td>1</td>\n",
|
| 1283 |
+
" <td>1</td>\n",
|
| 1284 |
+
" <td>1</td>\n",
|
| 1285 |
+
" <td>1</td>\n",
|
| 1286 |
+
" <td>0</td>\n",
|
| 1287 |
+
" <td>0</td>\n",
|
| 1288 |
+
" <td>1</td>\n",
|
| 1289 |
+
" <td>1</td>\n",
|
| 1290 |
+
" <td>0</td>\n",
|
| 1291 |
+
" <td>1</td>\n",
|
| 1292 |
+
" <td>1</td>\n",
|
| 1293 |
+
" <td>1</td>\n",
|
| 1294 |
+
" <td>1</td>\n",
|
| 1295 |
+
" <td>1</td>\n",
|
| 1296 |
+
" <td>0</td>\n",
|
| 1297 |
+
" </tr>\n",
|
| 1298 |
+
" <tr>\n",
|
| 1299 |
+
" <th>N21736211</th>\n",
|
| 1300 |
+
" <td>1</td>\n",
|
| 1301 |
+
" <td>7</td>\n",
|
| 1302 |
+
" <td>4</td>\n",
|
| 1303 |
+
" <td>2</td>\n",
|
| 1304 |
+
" <td>1</td>\n",
|
| 1305 |
+
" <td>1</td>\n",
|
| 1306 |
+
" <td>1</td>\n",
|
| 1307 |
+
" <td>1</td>\n",
|
| 1308 |
+
" <td>1</td>\n",
|
| 1309 |
+
" <td>1</td>\n",
|
| 1310 |
+
" <td>1</td>\n",
|
| 1311 |
+
" <td>1</td>\n",
|
| 1312 |
+
" <td>0</td>\n",
|
| 1313 |
+
" <td>1</td>\n",
|
| 1314 |
+
" <td>1</td>\n",
|
| 1315 |
+
" <td>1</td>\n",
|
| 1316 |
+
" <td>1</td>\n",
|
| 1317 |
+
" <td>1</td>\n",
|
| 1318 |
+
" <td>1</td>\n",
|
| 1319 |
+
" <td>1</td>\n",
|
| 1320 |
+
" <td>1</td>\n",
|
| 1321 |
+
" <td>1</td>\n",
|
| 1322 |
+
" <td>1</td>\n",
|
| 1323 |
+
" <td>1</td>\n",
|
| 1324 |
+
" <td>0</td>\n",
|
| 1325 |
+
" <td>0</td>\n",
|
| 1326 |
+
" <td>1</td>\n",
|
| 1327 |
+
" <td>1</td>\n",
|
| 1328 |
+
" <td>0</td>\n",
|
| 1329 |
+
" <td>1</td>\n",
|
| 1330 |
+
" <td>1</td>\n",
|
| 1331 |
+
" <td>1</td>\n",
|
| 1332 |
+
" <td>1</td>\n",
|
| 1333 |
+
" <td>1</td>\n",
|
| 1334 |
+
" <td>1</td>\n",
|
| 1335 |
+
" </tr>\n",
|
| 1336 |
+
" <tr>\n",
|
| 1337 |
+
" <th>N21736209</th>\n",
|
| 1338 |
+
" <td>1</td>\n",
|
| 1339 |
+
" <td>7</td>\n",
|
| 1340 |
+
" <td>4</td>\n",
|
| 1341 |
+
" <td>2</td>\n",
|
| 1342 |
+
" <td>1</td>\n",
|
| 1343 |
+
" <td>1</td>\n",
|
| 1344 |
+
" <td>1</td>\n",
|
| 1345 |
+
" <td>1</td>\n",
|
| 1346 |
+
" <td>1</td>\n",
|
| 1347 |
+
" <td>1</td>\n",
|
| 1348 |
+
" <td>1</td>\n",
|
| 1349 |
+
" <td>1</td>\n",
|
| 1350 |
+
" <td>0</td>\n",
|
| 1351 |
+
" <td>1</td>\n",
|
| 1352 |
+
" <td>1</td>\n",
|
| 1353 |
+
" <td>1</td>\n",
|
| 1354 |
+
" <td>1</td>\n",
|
| 1355 |
+
" <td>1</td>\n",
|
| 1356 |
+
" <td>1</td>\n",
|
| 1357 |
+
" <td>1</td>\n",
|
| 1358 |
+
" <td>1</td>\n",
|
| 1359 |
+
" <td>1</td>\n",
|
| 1360 |
+
" <td>1</td>\n",
|
| 1361 |
+
" <td>1</td>\n",
|
| 1362 |
+
" <td>0</td>\n",
|
| 1363 |
+
" <td>0</td>\n",
|
| 1364 |
+
" <td>1</td>\n",
|
| 1365 |
+
" <td>1</td>\n",
|
| 1366 |
+
" <td>0</td>\n",
|
| 1367 |
+
" <td>1</td>\n",
|
| 1368 |
+
" <td>1</td>\n",
|
| 1369 |
+
" <td>1</td>\n",
|
| 1370 |
+
" <td>1</td>\n",
|
| 1371 |
+
" <td>1</td>\n",
|
| 1372 |
+
" <td>0</td>\n",
|
| 1373 |
+
" </tr>\n",
|
| 1374 |
+
" </tbody>\n",
|
| 1375 |
+
"</table>\n",
|
| 1376 |
+
"</div>"
|
| 1377 |
+
],
|
| 1378 |
+
"text/plain": [
|
| 1379 |
+
" Product_(dash) AllPoints_OEM_Part_Number OEM_Part_Number OEM \\\n",
|
| 1380 |
+
"Product \n",
|
| 1381 |
+
"N21803179 1 2 2 1 \n",
|
| 1382 |
+
"N21740066 1 5 3 2 \n",
|
| 1383 |
+
"N21736218 1 5 3 2 \n",
|
| 1384 |
+
"N21736211 1 7 4 2 \n",
|
| 1385 |
+
"N21736209 1 7 4 2 \n",
|
| 1386 |
+
"\n",
|
| 1387 |
+
" Description Stock_Item Unit_of_Stock Dim_Weight Weight Length \\\n",
|
| 1388 |
+
"Product \n",
|
| 1389 |
+
"N21803179 1 1 1 1 1 1 \n",
|
| 1390 |
+
"N21740066 1 1 1 1 1 1 \n",
|
| 1391 |
+
"N21736218 1 1 1 1 1 1 \n",
|
| 1392 |
+
"N21736211 1 1 1 1 1 1 \n",
|
| 1393 |
+
"N21736209 1 1 1 1 1 1 \n",
|
| 1394 |
+
"\n",
|
| 1395 |
+
" Width Height Product_Notes List_Price Prior_Month_List_Price \\\n",
|
| 1396 |
+
"Product \n",
|
| 1397 |
+
"N21803179 1 1 0 1 1 \n",
|
| 1398 |
+
"N21740066 1 1 0 1 1 \n",
|
| 1399 |
+
"N21736218 1 1 0 1 1 \n",
|
| 1400 |
+
"N21736211 1 1 0 1 1 \n",
|
| 1401 |
+
"N21736209 1 1 0 1 1 \n",
|
| 1402 |
+
"\n",
|
| 1403 |
+
" Price Last_Month_Price The_cheapest_price_online_store \\\n",
|
| 1404 |
+
"Product \n",
|
| 1405 |
+
"N21803179 1 1 1 \n",
|
| 1406 |
+
"N21740066 1 1 1 \n",
|
| 1407 |
+
"N21736218 1 1 1 \n",
|
| 1408 |
+
"N21736211 1 1 1 \n",
|
| 1409 |
+
"N21736209 1 1 1 \n",
|
| 1410 |
+
"\n",
|
| 1411 |
+
" %_(Only_online_stores) The_cheapest_price_all \\\n",
|
| 1412 |
+
"Product \n",
|
| 1413 |
+
"N21803179 1 1 \n",
|
| 1414 |
+
"N21740066 1 1 \n",
|
| 1415 |
+
"N21736218 1 1 \n",
|
| 1416 |
+
"N21736211 1 1 \n",
|
| 1417 |
+
"N21736209 1 1 \n",
|
| 1418 |
+
"\n",
|
| 1419 |
+
" %_all_+Marketplace) The_cheapest_price_(Partstown) \\\n",
|
| 1420 |
+
"Product \n",
|
| 1421 |
+
"N21803179 1 1 \n",
|
| 1422 |
+
"N21740066 1 1 \n",
|
| 1423 |
+
"N21736218 1 1 \n",
|
| 1424 |
+
"N21736211 1 1 \n",
|
| 1425 |
+
"N21736209 1 1 \n",
|
| 1426 |
+
"\n",
|
| 1427 |
+
" %_OEM_(Partstown) Hazardous Country_of_Origin Image_Location \\\n",
|
| 1428 |
+
"Product \n",
|
| 1429 |
+
"N21803179 1 1 0 0 \n",
|
| 1430 |
+
"N21740066 1 1 0 0 \n",
|
| 1431 |
+
"N21736218 1 1 0 0 \n",
|
| 1432 |
+
"N21736211 1 1 0 0 \n",
|
| 1433 |
+
"N21736209 1 1 0 0 \n",
|
| 1434 |
+
"\n",
|
| 1435 |
+
" Product_Category Added_to_Catalog_Date Image_Date Product_Type \\\n",
|
| 1436 |
+
"Product \n",
|
| 1437 |
+
"N21803179 1 1 0 1 \n",
|
| 1438 |
+
"N21740066 1 1 0 1 \n",
|
| 1439 |
+
"N21736218 1 1 0 1 \n",
|
| 1440 |
+
"N21736211 1 1 0 1 \n",
|
| 1441 |
+
"N21736209 1 1 0 1 \n",
|
| 1442 |
+
"\n",
|
| 1443 |
+
" Url_a2z Link_crossref Link_all Link_Partstown Category \n",
|
| 1444 |
+
"Product \n",
|
| 1445 |
+
"N21803179 1 1 1 1 1 \n",
|
| 1446 |
+
"N21740066 2 1 1 1 0 \n",
|
| 1447 |
+
"N21736218 1 1 1 1 0 \n",
|
| 1448 |
+
"N21736211 1 1 1 1 1 \n",
|
| 1449 |
+
"N21736209 1 1 1 1 0 "
|
| 1450 |
+
]
|
| 1451 |
+
},
|
| 1452 |
+
"execution_count": 22,
|
| 1453 |
+
"metadata": {},
|
| 1454 |
+
"output_type": "execute_result"
|
| 1455 |
+
}
|
| 1456 |
+
],
|
| 1457 |
+
"source": [
|
| 1458 |
+
"# Sort by Product\n",
|
| 1459 |
+
"#df.sort_values(by=['Product'])\n",
|
| 1460 |
+
"df[df.duplicated(subset=['Product'], keep=False)].sort_values(by=['Product']).head(10)\n",
|
| 1461 |
+
"# Group by duplicated Product and show the columns with different values sorted by the number of unique values\n",
|
| 1462 |
+
"\n",
|
| 1463 |
+
"\n",
|
| 1464 |
+
"df[df.duplicated(subset=['Product'], keep=False)].groupby(['Product']).nunique().sort_values(by=['Product'], ascending=False).head(5)\n",
|
| 1465 |
+
"\n",
|
| 1466 |
+
"# most common columns by duplicated product are: AllPoints_OEM_Part_Number\tOEM_Part_Number\tOEM"
|
| 1467 |
+
]
|
| 1468 |
+
},
|
| 1469 |
+
{
|
| 1470 |
+
"cell_type": "code",
|
| 1471 |
+
"execution_count": 27,
|
| 1472 |
+
"metadata": {},
|
| 1473 |
+
"outputs": [],
|
| 1474 |
+
"source": [
|
| 1475 |
+
"# get columns with the most negative values \n",
|
| 1476 |
+
"#df[df < 0].count().sort_values(ascending=False).head(10)\n",
|
| 1477 |
+
"df.describe()\n",
|
| 1478 |
+
"# Remove rows with zero values in the following columns in one instruction and print how many rows were deleted: Dim_Weight\tWeight\tLength\tWidth\tHeight\n",
|
| 1479 |
+
"\n",
|
| 1480 |
+
"df = df[(df[['Dim_Weight', 'Weight', 'Length', 'Width', 'Height']] != 0).all(axis=1)]\n",
|
| 1481 |
+
"# how many rows were deleted\n"
|
| 1482 |
+
]
|
| 1483 |
+
},
|
| 1484 |
+
{
|
| 1485 |
+
"cell_type": "code",
|
| 1486 |
+
"execution_count": 29,
|
| 1487 |
+
"metadata": {},
|
| 1488 |
+
"outputs": [
|
| 1489 |
+
{
|
| 1490 |
+
"data": {
|
| 1491 |
+
"text/plain": [
|
| 1492 |
+
"(110356, 36)"
|
| 1493 |
+
]
|
| 1494 |
+
},
|
| 1495 |
+
"execution_count": 29,
|
| 1496 |
+
"metadata": {},
|
| 1497 |
+
"output_type": "execute_result"
|
| 1498 |
+
}
|
| 1499 |
+
],
|
| 1500 |
+
"source": [
|
| 1501 |
+
"df.shape"
|
| 1502 |
+
]
|
| 1503 |
+
},
|
| 1504 |
+
{
|
| 1505 |
+
"cell_type": "code",
|
| 1506 |
+
"execution_count": 33,
|
| 1507 |
+
"metadata": {},
|
| 1508 |
+
"outputs": [
|
| 1509 |
+
{
|
| 1510 |
+
"data": {
|
| 1511 |
+
"text/html": [
|
| 1512 |
+
"<div>\n",
|
| 1513 |
+
"<style scoped>\n",
|
| 1514 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1515 |
+
" vertical-align: middle;\n",
|
| 1516 |
+
" }\n",
|
| 1517 |
+
"\n",
|
| 1518 |
+
" .dataframe tbody tr th {\n",
|
| 1519 |
+
" vertical-align: top;\n",
|
| 1520 |
+
" }\n",
|
| 1521 |
+
"\n",
|
| 1522 |
+
" .dataframe thead th {\n",
|
| 1523 |
+
" text-align: right;\n",
|
| 1524 |
+
" }\n",
|
| 1525 |
+
"</style>\n",
|
| 1526 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1527 |
+
" <thead>\n",
|
| 1528 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1529 |
+
" <th></th>\n",
|
| 1530 |
+
" <th>Product</th>\n",
|
| 1531 |
+
" <th>Product_(dash)</th>\n",
|
| 1532 |
+
" <th>AllPoints_OEM_Part_Number</th>\n",
|
| 1533 |
+
" <th>OEM_Part_Number</th>\n",
|
| 1534 |
+
" <th>OEM</th>\n",
|
| 1535 |
+
" <th>Description</th>\n",
|
| 1536 |
+
" <th>Stock_Item</th>\n",
|
| 1537 |
+
" <th>Unit_of_Stock</th>\n",
|
| 1538 |
+
" <th>Dim_Weight</th>\n",
|
| 1539 |
+
" <th>Weight</th>\n",
|
| 1540 |
+
" <th>Length</th>\n",
|
| 1541 |
+
" <th>Width</th>\n",
|
| 1542 |
+
" <th>Height</th>\n",
|
| 1543 |
+
" <th>Product_Notes</th>\n",
|
| 1544 |
+
" <th>List_Price</th>\n",
|
| 1545 |
+
" <th>Prior_Month_List_Price</th>\n",
|
| 1546 |
+
" <th>Price</th>\n",
|
| 1547 |
+
" <th>Last_Month_Price</th>\n",
|
| 1548 |
+
" <th>The_cheapest_price_online_store</th>\n",
|
| 1549 |
+
" <th>%_(Only_online_stores)</th>\n",
|
| 1550 |
+
" <th>The_cheapest_price_all</th>\n",
|
| 1551 |
+
" <th>%_all_+Marketplace)</th>\n",
|
| 1552 |
+
" <th>The_cheapest_price_(Partstown)</th>\n",
|
| 1553 |
+
" <th>%_OEM_(Partstown)</th>\n",
|
| 1554 |
+
" <th>Hazardous</th>\n",
|
| 1555 |
+
" <th>Country_of_Origin</th>\n",
|
| 1556 |
+
" <th>Image_Location</th>\n",
|
| 1557 |
+
" <th>Product_Category</th>\n",
|
| 1558 |
+
" <th>Added_to_Catalog_Date</th>\n",
|
| 1559 |
+
" <th>Image_Date</th>\n",
|
| 1560 |
+
" <th>Product_Type</th>\n",
|
| 1561 |
+
" <th>Url_a2z</th>\n",
|
| 1562 |
+
" <th>Link_crossref</th>\n",
|
| 1563 |
+
" <th>Link_all</th>\n",
|
| 1564 |
+
" <th>Link_Partstown</th>\n",
|
| 1565 |
+
" <th>Category</th>\n",
|
| 1566 |
+
" </tr>\n",
|
| 1567 |
+
" </thead>\n",
|
| 1568 |
+
" <tbody>\n",
|
| 1569 |
+
" <tr>\n",
|
| 1570 |
+
" <th>1</th>\n",
|
| 1571 |
+
" <td>1001012</td>\n",
|
| 1572 |
+
" <td>100-1012</td>\n",
|
| 1573 |
+
" <td>SKL1755-1015-1000</td>\n",
|
| 1574 |
+
" <td>1755-1015-1000</td>\n",
|
| 1575 |
+
" <td>Standard Keil</td>\n",
|
| 1576 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 1577 |
+
" <td>Yes</td>\n",
|
| 1578 |
+
" <td>EA</td>\n",
|
| 1579 |
+
" <td>4.32125</td>\n",
|
| 1580 |
+
" <td>3.457</td>\n",
|
| 1581 |
+
" <td>11.0</td>\n",
|
| 1582 |
+
" <td>4.25</td>\n",
|
| 1583 |
+
" <td>4.5</td>\n",
|
| 1584 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 1585 |
+
" <td>94.8</td>\n",
|
| 1586 |
+
" <td>94.8</td>\n",
|
| 1587 |
+
" <td>41.58</td>\n",
|
| 1588 |
+
" <td>41.58</td>\n",
|
| 1589 |
+
" <td>50.73</td>\n",
|
| 1590 |
+
" <td>22.01</td>\n",
|
| 1591 |
+
" <td>50.73</td>\n",
|
| 1592 |
+
" <td>22.01</td>\n",
|
| 1593 |
+
" <td>NaN</td>\n",
|
| 1594 |
+
" <td>NaN</td>\n",
|
| 1595 |
+
" <td>False</td>\n",
|
| 1596 |
+
" <td>China</td>\n",
|
| 1597 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 1598 |
+
" <td>Parts</td>\n",
|
| 1599 |
+
" <td>2015-12-08</td>\n",
|
| 1600 |
+
" <td>2021-06-09</td>\n",
|
| 1601 |
+
" <td>Mavrik</td>\n",
|
| 1602 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 1603 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1604 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1605 |
+
" <td>NaN</td>\n",
|
| 1606 |
+
" <td>NaN</td>\n",
|
| 1607 |
+
" </tr>\n",
|
| 1608 |
+
" <tr>\n",
|
| 1609 |
+
" <th>2</th>\n",
|
| 1610 |
+
" <td>1001012</td>\n",
|
| 1611 |
+
" <td>100-1012</td>\n",
|
| 1612 |
+
" <td>SKL1755-1020-1000</td>\n",
|
| 1613 |
+
" <td>1755-1020-1000</td>\n",
|
| 1614 |
+
" <td>Standard Keil</td>\n",
|
| 1615 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 1616 |
+
" <td>Yes</td>\n",
|
| 1617 |
+
" <td>EA</td>\n",
|
| 1618 |
+
" <td>4.32125</td>\n",
|
| 1619 |
+
" <td>3.457</td>\n",
|
| 1620 |
+
" <td>11.0</td>\n",
|
| 1621 |
+
" <td>4.25</td>\n",
|
| 1622 |
+
" <td>4.5</td>\n",
|
| 1623 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 1624 |
+
" <td>94.8</td>\n",
|
| 1625 |
+
" <td>94.8</td>\n",
|
| 1626 |
+
" <td>41.58</td>\n",
|
| 1627 |
+
" <td>41.58</td>\n",
|
| 1628 |
+
" <td>50.73</td>\n",
|
| 1629 |
+
" <td>22.01</td>\n",
|
| 1630 |
+
" <td>50.73</td>\n",
|
| 1631 |
+
" <td>22.01</td>\n",
|
| 1632 |
+
" <td>NaN</td>\n",
|
| 1633 |
+
" <td>NaN</td>\n",
|
| 1634 |
+
" <td>False</td>\n",
|
| 1635 |
+
" <td>China</td>\n",
|
| 1636 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 1637 |
+
" <td>Parts</td>\n",
|
| 1638 |
+
" <td>2015-12-08</td>\n",
|
| 1639 |
+
" <td>2021-06-09</td>\n",
|
| 1640 |
+
" <td>Mavrik</td>\n",
|
| 1641 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 1642 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1643 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1644 |
+
" <td>NaN</td>\n",
|
| 1645 |
+
" <td>NaN</td>\n",
|
| 1646 |
+
" </tr>\n",
|
| 1647 |
+
" <tr>\n",
|
| 1648 |
+
" <th>3</th>\n",
|
| 1649 |
+
" <td>1001012</td>\n",
|
| 1650 |
+
" <td>100-1012</td>\n",
|
| 1651 |
+
" <td>SKL1765-1015-1000</td>\n",
|
| 1652 |
+
" <td>1765-1015-1000</td>\n",
|
| 1653 |
+
" <td>Standard Keil</td>\n",
|
| 1654 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 1655 |
+
" <td>Yes</td>\n",
|
| 1656 |
+
" <td>EA</td>\n",
|
| 1657 |
+
" <td>4.32125</td>\n",
|
| 1658 |
+
" <td>3.457</td>\n",
|
| 1659 |
+
" <td>11.0</td>\n",
|
| 1660 |
+
" <td>4.25</td>\n",
|
| 1661 |
+
" <td>4.5</td>\n",
|
| 1662 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 1663 |
+
" <td>94.8</td>\n",
|
| 1664 |
+
" <td>94.8</td>\n",
|
| 1665 |
+
" <td>41.58</td>\n",
|
| 1666 |
+
" <td>41.58</td>\n",
|
| 1667 |
+
" <td>50.73</td>\n",
|
| 1668 |
+
" <td>22.01</td>\n",
|
| 1669 |
+
" <td>50.73</td>\n",
|
| 1670 |
+
" <td>22.01</td>\n",
|
| 1671 |
+
" <td>NaN</td>\n",
|
| 1672 |
+
" <td>NaN</td>\n",
|
| 1673 |
+
" <td>False</td>\n",
|
| 1674 |
+
" <td>China</td>\n",
|
| 1675 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 1676 |
+
" <td>Parts</td>\n",
|
| 1677 |
+
" <td>2015-12-08</td>\n",
|
| 1678 |
+
" <td>2021-06-09</td>\n",
|
| 1679 |
+
" <td>Mavrik</td>\n",
|
| 1680 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 1681 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1682 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1683 |
+
" <td>NaN</td>\n",
|
| 1684 |
+
" <td>NaN</td>\n",
|
| 1685 |
+
" </tr>\n",
|
| 1686 |
+
" <tr>\n",
|
| 1687 |
+
" <th>4</th>\n",
|
| 1688 |
+
" <td>1001012</td>\n",
|
| 1689 |
+
" <td>100-1012</td>\n",
|
| 1690 |
+
" <td>SKL1765-1020-1000</td>\n",
|
| 1691 |
+
" <td>1765-1020-1000</td>\n",
|
| 1692 |
+
" <td>Standard Keil</td>\n",
|
| 1693 |
+
" <td>WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER</td>\n",
|
| 1694 |
+
" <td>Yes</td>\n",
|
| 1695 |
+
" <td>EA</td>\n",
|
| 1696 |
+
" <td>4.32125</td>\n",
|
| 1697 |
+
" <td>3.457</td>\n",
|
| 1698 |
+
" <td>11.0</td>\n",
|
| 1699 |
+
" <td>4.25</td>\n",
|
| 1700 |
+
" <td>4.5</td>\n",
|
| 1701 |
+
" <td>2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C...</td>\n",
|
| 1702 |
+
" <td>94.8</td>\n",
|
| 1703 |
+
" <td>94.8</td>\n",
|
| 1704 |
+
" <td>41.58</td>\n",
|
| 1705 |
+
" <td>41.58</td>\n",
|
| 1706 |
+
" <td>50.73</td>\n",
|
| 1707 |
+
" <td>22.01</td>\n",
|
| 1708 |
+
" <td>50.73</td>\n",
|
| 1709 |
+
" <td>22.01</td>\n",
|
| 1710 |
+
" <td>NaN</td>\n",
|
| 1711 |
+
" <td>NaN</td>\n",
|
| 1712 |
+
" <td>False</td>\n",
|
| 1713 |
+
" <td>China</td>\n",
|
| 1714 |
+
" <td>https://s3.amazonaws.com/dfs-allpoints-images/...</td>\n",
|
| 1715 |
+
" <td>Parts</td>\n",
|
| 1716 |
+
" <td>2015-12-08</td>\n",
|
| 1717 |
+
" <td>2021-06-09</td>\n",
|
| 1718 |
+
" <td>Mavrik</td>\n",
|
| 1719 |
+
" <td>https://dev.a2zparts.com/parts/standard-keil/1...</td>\n",
|
| 1720 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1721 |
+
" <td>https://www.sharpteksupply.com/sharptek-featur...</td>\n",
|
| 1722 |
+
" <td>NaN</td>\n",
|
| 1723 |
+
" <td>NaN</td>\n",
|
| 1724 |
+
" </tr>\n",
|
| 1725 |
+
" </tbody>\n",
|
| 1726 |
+
"</table>\n",
|
| 1727 |
+
"</div>"
|
| 1728 |
+
],
|
| 1729 |
+
"text/plain": [
|
| 1730 |
+
" Product Product_(dash) AllPoints_OEM_Part_Number OEM_Part_Number \\\n",
|
| 1731 |
+
"1 1001012 100-1012 SKL1755-1015-1000 1755-1015-1000 \n",
|
| 1732 |
+
"2 1001012 100-1012 SKL1755-1020-1000 1755-1020-1000 \n",
|
| 1733 |
+
"3 1001012 100-1012 SKL1765-1015-1000 1765-1015-1000 \n",
|
| 1734 |
+
"4 1001012 100-1012 SKL1765-1020-1000 1765-1020-1000 \n",
|
| 1735 |
+
"\n",
|
| 1736 |
+
" OEM Description Stock_Item \\\n",
|
| 1737 |
+
"1 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 1738 |
+
"2 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 1739 |
+
"3 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 1740 |
+
"4 Standard Keil WASTE DRAIN - 3-1/2\" SINK OPENING, LEVER Yes \n",
|
| 1741 |
+
"\n",
|
| 1742 |
+
" Unit_of_Stock Dim_Weight Weight Length Width Height \\\n",
|
| 1743 |
+
"1 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 1744 |
+
"2 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 1745 |
+
"3 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 1746 |
+
"4 EA 4.32125 3.457 11.0 4.25 4.5 \n",
|
| 1747 |
+
"\n",
|
| 1748 |
+
" Product_Notes List_Price \\\n",
|
| 1749 |
+
"1 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 1750 |
+
"2 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 1751 |
+
"3 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 1752 |
+
"4 2\" NPS MALE CONNECTION AND 1-1/2\" NPS FEMALE C... 94.8 \n",
|
| 1753 |
+
"\n",
|
| 1754 |
+
" Prior_Month_List_Price Price Last_Month_Price \\\n",
|
| 1755 |
+
"1 94.8 41.58 41.58 \n",
|
| 1756 |
+
"2 94.8 41.58 41.58 \n",
|
| 1757 |
+
"3 94.8 41.58 41.58 \n",
|
| 1758 |
+
"4 94.8 41.58 41.58 \n",
|
| 1759 |
+
"\n",
|
| 1760 |
+
" The_cheapest_price_online_store %_(Only_online_stores) \\\n",
|
| 1761 |
+
"1 50.73 22.01 \n",
|
| 1762 |
+
"2 50.73 22.01 \n",
|
| 1763 |
+
"3 50.73 22.01 \n",
|
| 1764 |
+
"4 50.73 22.01 \n",
|
| 1765 |
+
"\n",
|
| 1766 |
+
" The_cheapest_price_all %_all_+Marketplace) \\\n",
|
| 1767 |
+
"1 50.73 22.01 \n",
|
| 1768 |
+
"2 50.73 22.01 \n",
|
| 1769 |
+
"3 50.73 22.01 \n",
|
| 1770 |
+
"4 50.73 22.01 \n",
|
| 1771 |
+
"\n",
|
| 1772 |
+
" The_cheapest_price_(Partstown) %_OEM_(Partstown) Hazardous \\\n",
|
| 1773 |
+
"1 NaN NaN False \n",
|
| 1774 |
+
"2 NaN NaN False \n",
|
| 1775 |
+
"3 NaN NaN False \n",
|
| 1776 |
+
"4 NaN NaN False \n",
|
| 1777 |
+
"\n",
|
| 1778 |
+
" Country_of_Origin Image_Location \\\n",
|
| 1779 |
+
"1 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1780 |
+
"2 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1781 |
+
"3 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1782 |
+
"4 China https://s3.amazonaws.com/dfs-allpoints-images/... \n",
|
| 1783 |
+
"\n",
|
| 1784 |
+
" Product_Category Added_to_Catalog_Date Image_Date Product_Type \\\n",
|
| 1785 |
+
"1 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1786 |
+
"2 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1787 |
+
"3 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1788 |
+
"4 Parts 2015-12-08 2021-06-09 Mavrik \n",
|
| 1789 |
+
"\n",
|
| 1790 |
+
" Url_a2z \\\n",
|
| 1791 |
+
"1 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1792 |
+
"2 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1793 |
+
"3 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1794 |
+
"4 https://dev.a2zparts.com/parts/standard-keil/1... \n",
|
| 1795 |
+
"\n",
|
| 1796 |
+
" Link_crossref \\\n",
|
| 1797 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1798 |
+
"2 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1799 |
+
"3 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1800 |
+
"4 https://www.sharpteksupply.com/sharptek-featur... \n",
|
| 1801 |
+
"\n",
|
| 1802 |
+
" Link_all Link_Partstown Category \n",
|
| 1803 |
+
"1 https://www.sharpteksupply.com/sharptek-featur... NaN NaN \n",
|
| 1804 |
+
"2 https://www.sharpteksupply.com/sharptek-featur... NaN NaN \n",
|
| 1805 |
+
"3 https://www.sharpteksupply.com/sharptek-featur... NaN NaN \n",
|
| 1806 |
+
"4 https://www.sharpteksupply.com/sharptek-featur... NaN NaN "
|
| 1807 |
+
]
|
| 1808 |
+
},
|
| 1809 |
+
"execution_count": 33,
|
| 1810 |
+
"metadata": {},
|
| 1811 |
+
"output_type": "execute_result"
|
| 1812 |
+
}
|
| 1813 |
+
],
|
| 1814 |
+
"source": [
|
| 1815 |
+
"df[df.duplicated(subset=['Product'], keep=False)].sort_values(by=['Product']).head(10)\n",
|
| 1816 |
+
"df.query('Product == \"1001012\"')"
|
| 1817 |
+
]
|
| 1818 |
+
},
|
| 1819 |
+
{
|
| 1820 |
+
"cell_type": "code",
|
| 1821 |
+
"execution_count": null,
|
| 1822 |
+
"metadata": {},
|
| 1823 |
+
"outputs": [],
|
| 1824 |
+
"source": []
|
| 1825 |
+
}
|
| 1826 |
+
],
|
| 1827 |
+
"metadata": {
|
| 1828 |
+
"kernelspec": {
|
| 1829 |
+
"display_name": "relu",
|
| 1830 |
+
"language": "python",
|
| 1831 |
+
"name": "python3"
|
| 1832 |
+
},
|
| 1833 |
+
"language_info": {
|
| 1834 |
+
"codemirror_mode": {
|
| 1835 |
+
"name": "ipython",
|
| 1836 |
+
"version": 3
|
| 1837 |
+
},
|
| 1838 |
+
"file_extension": ".py",
|
| 1839 |
+
"mimetype": "text/x-python",
|
| 1840 |
+
"name": "python",
|
| 1841 |
+
"nbconvert_exporter": "python",
|
| 1842 |
+
"pygments_lexer": "ipython3",
|
| 1843 |
+
"version": "3.8.16"
|
| 1844 |
+
},
|
| 1845 |
+
"orig_nbformat": 4
|
| 1846 |
+
},
|
| 1847 |
+
"nbformat": 4,
|
| 1848 |
+
"nbformat_minor": 2
|
| 1849 |
+
}
|
notebooks/amazon_sales copy.ipynb
ADDED
|
@@ -0,0 +1,1245 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 19,
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"outputs": [
|
| 8 |
+
{
|
| 9 |
+
"name": "stderr",
|
| 10 |
+
"output_type": "stream",
|
| 11 |
+
"text": [
|
| 12 |
+
"/Users/servandodavidtorresgarcia/Servando/Relu/Relu/src/data/dataset_reader.py:13: DtypeWarning: Columns (23) have mixed types. Specify dtype option on import or set low_memory=False.\n",
|
| 13 |
+
" df = pd.read_csv(data_path)\n"
|
| 14 |
+
]
|
| 15 |
+
}
|
| 16 |
+
],
|
| 17 |
+
"source": [
|
| 18 |
+
"\n",
|
| 19 |
+
"from src.data.dataset_reader import DatasetReader\n",
|
| 20 |
+
"from pathlib import Path\n",
|
| 21 |
+
"data_folder = Path(\"../data/raw\").resolve()\n",
|
| 22 |
+
"\n",
|
| 23 |
+
"amazon = DatasetReader(data_folder).get_data_csv('Amazon Sale Report.csv')\n",
|
| 24 |
+
"int_sales = DatasetReader(data_folder).get_data_csv('International sale Report.csv')\n",
|
| 25 |
+
"p_l = DatasetReader(data_folder).get_data_csv('P LMarch2021.csv')\n",
|
| 26 |
+
"may_2022 = DatasetReader(data_folder).get_data_csv('May-2022.csv')\n",
|
| 27 |
+
"sale_report = DatasetReader(data_folder).get_data_csv('Sale Report.csv')\n"
|
| 28 |
+
]
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"cell_type": "code",
|
| 32 |
+
"execution_count": 34,
|
| 33 |
+
"metadata": {},
|
| 34 |
+
"outputs": [],
|
| 35 |
+
"source": [
|
| 36 |
+
"expense_iigf = DatasetReader(data_folder).get_data_csv('Expense IIGF.csv')"
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"attachments": {},
|
| 41 |
+
"cell_type": "markdown",
|
| 42 |
+
"metadata": {},
|
| 43 |
+
"source": [
|
| 44 |
+
"This dataset provides an in-depth look at the profitability of e-commerce sales. It contains data on a variety of sales channels, including Shiprocket and INCREFF, as well as financial information on related expenses and profits. The columns contain data such as SKU codes, design numbers, stock levels, product categories, sizes and colors. In addition to this we have included the MRPs across multiple stores like Ajio MRP , Amazon MRP , Amazon FBA MRP , Flipkart MRP , Limeroad MRP Myntra MRP and PaytmMRP along with other key parameters like amount paid by customer for the purchase , rate per piece for every individual transaction Also we have added transactional parameters like Date of sale months category fulfilledby B2b Status Qty Currency Gross amt . This is a must-have dataset for anyone trying to uncover the profitability of e-commerce sales in today's marketplace.\n",
|
| 45 |
+
"This dataset provides a comprehensive overview of e-commerce sales data from different channels covering a variety of products. Using this dataset, retailers and digital marketers can measure the performance of their campaigns more accurately and efficiently.\n",
|
| 46 |
+
"\n",
|
| 47 |
+
"The following steps help users make the most out of this dataset:\n",
|
| 48 |
+
"\n",
|
| 49 |
+
"Analyze the general sales trends by examining info such as month, category, currency, stock level, and customer for each sale. This will give you an idea about how your e-commerce business is performing in each channel.\n",
|
| 50 |
+
"\n",
|
| 51 |
+
"Review the Shiprocket and INCREF data to compare and analyze profitability via different fulfilment methods. This comparison would enable you to make better decisions towards maximizing profit while minimizing costs associated with each method’s referral fees and fulfillment rates.\n",
|
| 52 |
+
"\n",
|
| 53 |
+
"Compare prices between various channels such as Amazon FBA MRP, Myntra MRP, Ajio MRP etc using the corresponding columns for each store (Amazon MRP etc). You can judge which stores are offering more profitable margins without compromising on quality by analyzing these pricing points in combination with other information related to product sales (TP1/TP2 - cost per piece).\n",
|
| 54 |
+
"\n",
|
| 55 |
+
"Look at customer specific data such as TP 1/TP 2 combination wise Gross Amount or Rate info in terms price per piece or total gross amount generated by any SKU dispersed over multiple customers with relevant dates associated to track individual item performance relative to others within its category over time periods shortlisted/filtered appropriately.. Have an eye on items commonly utilized against offers or promotional discounts offered hence crafting strategies towards inventory optimization leading up-selling operations.?\n",
|
| 56 |
+
"\n",
|
| 57 |
+
"Finally Use Overall ‘Stock’ details along all the P & L Data including Yearly Expenses_IIGF information record for takeaways which might be aimed towards essential cost cutting measures like switching amongst delivery options carefully chosen out of Shiprocket & INCREFF leadings away from manual inspections catering savings under support personnel outsourcing structures.? \n",
|
| 58 |
+
"\n",
|
| 59 |
+
"By employing a comprehensive understanding on how our internal subsidiaries perform globally unless attached respective audits may provide us remarkably lower operational costs servicing confidence; costing far lesser than being incurred taking into account entire pallet shipments tracking sheets representing current level supply chains efficiencies achieved internally., then one may finally scale profits exponentially increases cut down unseen losses followed up introducing newer marketing campaigns necessarily tailored according playing around multiple goods based spectrums due powerful backing suitable transportation boundaries set carefully"
|
| 60 |
+
]
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"cell_type": "code",
|
| 64 |
+
"execution_count": 49,
|
| 65 |
+
"metadata": {},
|
| 66 |
+
"outputs": [
|
| 67 |
+
{
|
| 68 |
+
"data": {
|
| 69 |
+
"text/html": [
|
| 70 |
+
"<div>\n",
|
| 71 |
+
"<style scoped>\n",
|
| 72 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 73 |
+
" vertical-align: middle;\n",
|
| 74 |
+
" }\n",
|
| 75 |
+
"\n",
|
| 76 |
+
" .dataframe tbody tr th {\n",
|
| 77 |
+
" vertical-align: top;\n",
|
| 78 |
+
" }\n",
|
| 79 |
+
"\n",
|
| 80 |
+
" .dataframe thead th {\n",
|
| 81 |
+
" text-align: right;\n",
|
| 82 |
+
" }\n",
|
| 83 |
+
"</style>\n",
|
| 84 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 85 |
+
" <thead>\n",
|
| 86 |
+
" <tr style=\"text-align: right;\">\n",
|
| 87 |
+
" <th></th>\n",
|
| 88 |
+
" <th>index</th>\n",
|
| 89 |
+
" <th>Order ID</th>\n",
|
| 90 |
+
" <th>Date</th>\n",
|
| 91 |
+
" <th>Status</th>\n",
|
| 92 |
+
" <th>Fulfilment</th>\n",
|
| 93 |
+
" <th>Sales Channel</th>\n",
|
| 94 |
+
" <th>ship-service-level</th>\n",
|
| 95 |
+
" <th>Style</th>\n",
|
| 96 |
+
" <th>SKU</th>\n",
|
| 97 |
+
" <th>Category</th>\n",
|
| 98 |
+
" <th>Size</th>\n",
|
| 99 |
+
" <th>ASIN</th>\n",
|
| 100 |
+
" <th>Courier Status</th>\n",
|
| 101 |
+
" <th>Qty</th>\n",
|
| 102 |
+
" <th>currency</th>\n",
|
| 103 |
+
" <th>Amount</th>\n",
|
| 104 |
+
" <th>ship-city</th>\n",
|
| 105 |
+
" <th>ship-state</th>\n",
|
| 106 |
+
" <th>ship-postal-code</th>\n",
|
| 107 |
+
" <th>ship-country</th>\n",
|
| 108 |
+
" <th>promotion-ids</th>\n",
|
| 109 |
+
" <th>B2B</th>\n",
|
| 110 |
+
" <th>fulfilled-by</th>\n",
|
| 111 |
+
" <th>Unnamed: 22</th>\n",
|
| 112 |
+
" </tr>\n",
|
| 113 |
+
" </thead>\n",
|
| 114 |
+
" <tbody>\n",
|
| 115 |
+
" <tr>\n",
|
| 116 |
+
" <th>0</th>\n",
|
| 117 |
+
" <td>0</td>\n",
|
| 118 |
+
" <td>405-8078784-5731545</td>\n",
|
| 119 |
+
" <td>04-30-22</td>\n",
|
| 120 |
+
" <td>Cancelled</td>\n",
|
| 121 |
+
" <td>Merchant</td>\n",
|
| 122 |
+
" <td>Amazon.in</td>\n",
|
| 123 |
+
" <td>Standard</td>\n",
|
| 124 |
+
" <td>SET389</td>\n",
|
| 125 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 126 |
+
" <td>Set</td>\n",
|
| 127 |
+
" <td>S</td>\n",
|
| 128 |
+
" <td>B09KXVBD7Z</td>\n",
|
| 129 |
+
" <td>NaN</td>\n",
|
| 130 |
+
" <td>0</td>\n",
|
| 131 |
+
" <td>INR</td>\n",
|
| 132 |
+
" <td>647.62</td>\n",
|
| 133 |
+
" <td>MUMBAI</td>\n",
|
| 134 |
+
" <td>MAHARASHTRA</td>\n",
|
| 135 |
+
" <td>400081.0</td>\n",
|
| 136 |
+
" <td>IN</td>\n",
|
| 137 |
+
" <td>NaN</td>\n",
|
| 138 |
+
" <td>False</td>\n",
|
| 139 |
+
" <td>Easy Ship</td>\n",
|
| 140 |
+
" <td>NaN</td>\n",
|
| 141 |
+
" </tr>\n",
|
| 142 |
+
" </tbody>\n",
|
| 143 |
+
"</table>\n",
|
| 144 |
+
"</div>"
|
| 145 |
+
],
|
| 146 |
+
"text/plain": [
|
| 147 |
+
" index Order ID Date Status Fulfilment Sales Channel \\\n",
|
| 148 |
+
"0 0 405-8078784-5731545 04-30-22 Cancelled Merchant Amazon.in \n",
|
| 149 |
+
"\n",
|
| 150 |
+
" ship-service-level Style SKU Category Size ASIN \\\n",
|
| 151 |
+
"0 Standard SET389 SET389-KR-NP-S Set S B09KXVBD7Z \n",
|
| 152 |
+
"\n",
|
| 153 |
+
" Courier Status Qty currency Amount ship-city ship-state \\\n",
|
| 154 |
+
"0 NaN 0 INR 647.62 MUMBAI MAHARASHTRA \n",
|
| 155 |
+
"\n",
|
| 156 |
+
" ship-postal-code ship-country promotion-ids B2B fulfilled-by Unnamed: 22 \n",
|
| 157 |
+
"0 400081.0 IN NaN False Easy Ship NaN "
|
| 158 |
+
]
|
| 159 |
+
},
|
| 160 |
+
"execution_count": 49,
|
| 161 |
+
"metadata": {},
|
| 162 |
+
"output_type": "execute_result"
|
| 163 |
+
}
|
| 164 |
+
],
|
| 165 |
+
"source": [
|
| 166 |
+
"import pandas as pd\n",
|
| 167 |
+
"pd.set_option('display.max_columns', None)\n",
|
| 168 |
+
"amazon.head(3)\n",
|
| 169 |
+
"amazon.query('SKU == \"SET389-KR-NP-S\"').head(1\n",
|
| 170 |
+
" )\n"
|
| 171 |
+
]
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"cell_type": "code",
|
| 175 |
+
"execution_count": 43,
|
| 176 |
+
"metadata": {},
|
| 177 |
+
"outputs": [],
|
| 178 |
+
"source": [
|
| 179 |
+
"p_l.head()\n",
|
| 180 |
+
"# rename column Sku to SKU\n",
|
| 181 |
+
"p_l.rename(columns={'Sku': 'SKU'}, inplace=True)\n",
|
| 182 |
+
"may_2022.rename(columns={'Sku': 'SKU'}, inplace=True)"
|
| 183 |
+
]
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"cell_type": "code",
|
| 187 |
+
"execution_count": 45,
|
| 188 |
+
"metadata": {},
|
| 189 |
+
"outputs": [
|
| 190 |
+
{
|
| 191 |
+
"name": "stdout",
|
| 192 |
+
"output_type": "stream",
|
| 193 |
+
"text": [
|
| 194 |
+
"7195\n",
|
| 195 |
+
"1330\n",
|
| 196 |
+
"1330\n"
|
| 197 |
+
]
|
| 198 |
+
}
|
| 199 |
+
],
|
| 200 |
+
"source": [
|
| 201 |
+
"print(amazon.SKU.nunique())\n",
|
| 202 |
+
"print(p_l.SKU.nunique())\n",
|
| 203 |
+
"print(may_2022.SKU.nunique())"
|
| 204 |
+
]
|
| 205 |
+
},
|
| 206 |
+
{
|
| 207 |
+
"cell_type": "code",
|
| 208 |
+
"execution_count": 50,
|
| 209 |
+
"metadata": {},
|
| 210 |
+
"outputs": [
|
| 211 |
+
{
|
| 212 |
+
"data": {
|
| 213 |
+
"text/html": [
|
| 214 |
+
"<div>\n",
|
| 215 |
+
"<style scoped>\n",
|
| 216 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 217 |
+
" vertical-align: middle;\n",
|
| 218 |
+
" }\n",
|
| 219 |
+
"\n",
|
| 220 |
+
" .dataframe tbody tr th {\n",
|
| 221 |
+
" vertical-align: top;\n",
|
| 222 |
+
" }\n",
|
| 223 |
+
"\n",
|
| 224 |
+
" .dataframe thead th {\n",
|
| 225 |
+
" text-align: right;\n",
|
| 226 |
+
" }\n",
|
| 227 |
+
"</style>\n",
|
| 228 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 229 |
+
" <thead>\n",
|
| 230 |
+
" <tr style=\"text-align: right;\">\n",
|
| 231 |
+
" <th></th>\n",
|
| 232 |
+
" <th>index</th>\n",
|
| 233 |
+
" <th>Order ID</th>\n",
|
| 234 |
+
" <th>Date</th>\n",
|
| 235 |
+
" <th>Status</th>\n",
|
| 236 |
+
" <th>Fulfilment</th>\n",
|
| 237 |
+
" <th>Sales Channel</th>\n",
|
| 238 |
+
" <th>ship-service-level</th>\n",
|
| 239 |
+
" <th>Style</th>\n",
|
| 240 |
+
" <th>SKU</th>\n",
|
| 241 |
+
" <th>Category</th>\n",
|
| 242 |
+
" <th>Size</th>\n",
|
| 243 |
+
" <th>ASIN</th>\n",
|
| 244 |
+
" <th>Courier Status</th>\n",
|
| 245 |
+
" <th>Qty</th>\n",
|
| 246 |
+
" <th>currency</th>\n",
|
| 247 |
+
" <th>Amount</th>\n",
|
| 248 |
+
" <th>ship-city</th>\n",
|
| 249 |
+
" <th>ship-state</th>\n",
|
| 250 |
+
" <th>ship-postal-code</th>\n",
|
| 251 |
+
" <th>ship-country</th>\n",
|
| 252 |
+
" <th>promotion-ids</th>\n",
|
| 253 |
+
" <th>B2B</th>\n",
|
| 254 |
+
" <th>fulfilled-by</th>\n",
|
| 255 |
+
" <th>Unnamed: 22</th>\n",
|
| 256 |
+
" </tr>\n",
|
| 257 |
+
" </thead>\n",
|
| 258 |
+
" <tbody>\n",
|
| 259 |
+
" <tr>\n",
|
| 260 |
+
" <th>0</th>\n",
|
| 261 |
+
" <td>0</td>\n",
|
| 262 |
+
" <td>405-8078784-5731545</td>\n",
|
| 263 |
+
" <td>04-30-22</td>\n",
|
| 264 |
+
" <td>Cancelled</td>\n",
|
| 265 |
+
" <td>Merchant</td>\n",
|
| 266 |
+
" <td>Amazon.in</td>\n",
|
| 267 |
+
" <td>Standard</td>\n",
|
| 268 |
+
" <td>SET389</td>\n",
|
| 269 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 270 |
+
" <td>Set</td>\n",
|
| 271 |
+
" <td>S</td>\n",
|
| 272 |
+
" <td>B09KXVBD7Z</td>\n",
|
| 273 |
+
" <td>NaN</td>\n",
|
| 274 |
+
" <td>0</td>\n",
|
| 275 |
+
" <td>INR</td>\n",
|
| 276 |
+
" <td>647.62</td>\n",
|
| 277 |
+
" <td>MUMBAI</td>\n",
|
| 278 |
+
" <td>MAHARASHTRA</td>\n",
|
| 279 |
+
" <td>400081.0</td>\n",
|
| 280 |
+
" <td>IN</td>\n",
|
| 281 |
+
" <td>NaN</td>\n",
|
| 282 |
+
" <td>False</td>\n",
|
| 283 |
+
" <td>Easy Ship</td>\n",
|
| 284 |
+
" <td>NaN</td>\n",
|
| 285 |
+
" </tr>\n",
|
| 286 |
+
" </tbody>\n",
|
| 287 |
+
"</table>\n",
|
| 288 |
+
"</div>"
|
| 289 |
+
],
|
| 290 |
+
"text/plain": [
|
| 291 |
+
" index Order ID Date Status Fulfilment Sales Channel \\\n",
|
| 292 |
+
"0 0 405-8078784-5731545 04-30-22 Cancelled Merchant Amazon.in \n",
|
| 293 |
+
"\n",
|
| 294 |
+
" ship-service-level Style SKU Category Size ASIN \\\n",
|
| 295 |
+
"0 Standard SET389 SET389-KR-NP-S Set S B09KXVBD7Z \n",
|
| 296 |
+
"\n",
|
| 297 |
+
" Courier Status Qty currency Amount ship-city ship-state \\\n",
|
| 298 |
+
"0 NaN 0 INR 647.62 MUMBAI MAHARASHTRA \n",
|
| 299 |
+
"\n",
|
| 300 |
+
" ship-postal-code ship-country promotion-ids B2B fulfilled-by Unnamed: 22 \n",
|
| 301 |
+
"0 400081.0 IN NaN False Easy Ship NaN "
|
| 302 |
+
]
|
| 303 |
+
},
|
| 304 |
+
"execution_count": 50,
|
| 305 |
+
"metadata": {},
|
| 306 |
+
"output_type": "execute_result"
|
| 307 |
+
}
|
| 308 |
+
],
|
| 309 |
+
"source": [
|
| 310 |
+
"may_2022.tail()\n",
|
| 311 |
+
"#may_2022.query('Sku == \"SET389-KR-NP-S\"')\n",
|
| 312 |
+
"amazon.query('SKU == \"SET389-KR-NP-S\"').head(1)"
|
| 313 |
+
]
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
"cell_type": "code",
|
| 317 |
+
"execution_count": 51,
|
| 318 |
+
"metadata": {},
|
| 319 |
+
"outputs": [],
|
| 320 |
+
"source": [
|
| 321 |
+
"# Create a new feature called sales that is the the count of \"Amount\" grouped by \"SKU\" in the amazon dataset\n",
|
| 322 |
+
"amazon['sales'] = amazon.groupby('SKU')['Amount'].transform('count')"
|
| 323 |
+
]
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"cell_type": "code",
|
| 327 |
+
"execution_count": 58,
|
| 328 |
+
"metadata": {},
|
| 329 |
+
"outputs": [],
|
| 330 |
+
"source": [
|
| 331 |
+
"amazon.query('SKU == \"SET389-KR-NP-S\"')\n",
|
| 332 |
+
"#amazon.info()\n",
|
| 333 |
+
"# drop columns: index, Order ID, ASIN, Unnamed: 22\n",
|
| 334 |
+
"amazon.drop(columns=[ 'Order ID', 'ASIN', 'Unnamed: 22'], inplace=True)"
|
| 335 |
+
]
|
| 336 |
+
},
|
| 337 |
+
{
|
| 338 |
+
"cell_type": "code",
|
| 339 |
+
"execution_count": 60,
|
| 340 |
+
"metadata": {},
|
| 341 |
+
"outputs": [],
|
| 342 |
+
"source": [
|
| 343 |
+
"amazon.drop(columns=[ 'index'], inplace=True)"
|
| 344 |
+
]
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
"cell_type": "code",
|
| 348 |
+
"execution_count": 62,
|
| 349 |
+
"metadata": {},
|
| 350 |
+
"outputs": [],
|
| 351 |
+
"source": [
|
| 352 |
+
"amazon.head(3)\n",
|
| 353 |
+
"# change Date column to datetime\n",
|
| 354 |
+
"amazon['Date'] = pd.to_datetime(amazon['Date'])"
|
| 355 |
+
]
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"cell_type": "code",
|
| 359 |
+
"execution_count": 67,
|
| 360 |
+
"metadata": {},
|
| 361 |
+
"outputs": [],
|
| 362 |
+
"source": [
|
| 363 |
+
"amazon.head()\n",
|
| 364 |
+
"amazon['ship-postal-code'] = amazon['ship-postal-code'].astype('object')"
|
| 365 |
+
]
|
| 366 |
+
},
|
| 367 |
+
{
|
| 368 |
+
"cell_type": "code",
|
| 369 |
+
"execution_count": 68,
|
| 370 |
+
"metadata": {},
|
| 371 |
+
"outputs": [
|
| 372 |
+
{
|
| 373 |
+
"data": {
|
| 374 |
+
"text/html": [
|
| 375 |
+
"<div>\n",
|
| 376 |
+
"<style scoped>\n",
|
| 377 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 378 |
+
" vertical-align: middle;\n",
|
| 379 |
+
" }\n",
|
| 380 |
+
"\n",
|
| 381 |
+
" .dataframe tbody tr th {\n",
|
| 382 |
+
" vertical-align: top;\n",
|
| 383 |
+
" }\n",
|
| 384 |
+
"\n",
|
| 385 |
+
" .dataframe thead th {\n",
|
| 386 |
+
" text-align: right;\n",
|
| 387 |
+
" }\n",
|
| 388 |
+
"</style>\n",
|
| 389 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 390 |
+
" <thead>\n",
|
| 391 |
+
" <tr style=\"text-align: right;\">\n",
|
| 392 |
+
" <th></th>\n",
|
| 393 |
+
" <th>Date</th>\n",
|
| 394 |
+
" <th>Status</th>\n",
|
| 395 |
+
" <th>Fulfilment</th>\n",
|
| 396 |
+
" <th>Sales Channel</th>\n",
|
| 397 |
+
" <th>ship-service-level</th>\n",
|
| 398 |
+
" <th>Style</th>\n",
|
| 399 |
+
" <th>SKU</th>\n",
|
| 400 |
+
" <th>Category</th>\n",
|
| 401 |
+
" <th>Size</th>\n",
|
| 402 |
+
" <th>Courier Status</th>\n",
|
| 403 |
+
" <th>Qty</th>\n",
|
| 404 |
+
" <th>currency</th>\n",
|
| 405 |
+
" <th>Amount</th>\n",
|
| 406 |
+
" <th>ship-city</th>\n",
|
| 407 |
+
" <th>ship-state</th>\n",
|
| 408 |
+
" <th>ship-postal-code</th>\n",
|
| 409 |
+
" <th>ship-country</th>\n",
|
| 410 |
+
" <th>promotion-ids</th>\n",
|
| 411 |
+
" <th>B2B</th>\n",
|
| 412 |
+
" <th>fulfilled-by</th>\n",
|
| 413 |
+
" <th>sales</th>\n",
|
| 414 |
+
" </tr>\n",
|
| 415 |
+
" </thead>\n",
|
| 416 |
+
" <tbody>\n",
|
| 417 |
+
" <tr>\n",
|
| 418 |
+
" <th>0</th>\n",
|
| 419 |
+
" <td>2022-04-30</td>\n",
|
| 420 |
+
" <td>Cancelled</td>\n",
|
| 421 |
+
" <td>Merchant</td>\n",
|
| 422 |
+
" <td>Amazon.in</td>\n",
|
| 423 |
+
" <td>Standard</td>\n",
|
| 424 |
+
" <td>SET389</td>\n",
|
| 425 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 426 |
+
" <td>Set</td>\n",
|
| 427 |
+
" <td>S</td>\n",
|
| 428 |
+
" <td>NaN</td>\n",
|
| 429 |
+
" <td>0</td>\n",
|
| 430 |
+
" <td>INR</td>\n",
|
| 431 |
+
" <td>647.62</td>\n",
|
| 432 |
+
" <td>MUMBAI</td>\n",
|
| 433 |
+
" <td>MAHARASHTRA</td>\n",
|
| 434 |
+
" <td>400081.0</td>\n",
|
| 435 |
+
" <td>IN</td>\n",
|
| 436 |
+
" <td>NaN</td>\n",
|
| 437 |
+
" <td>False</td>\n",
|
| 438 |
+
" <td>Easy Ship</td>\n",
|
| 439 |
+
" <td>35</td>\n",
|
| 440 |
+
" </tr>\n",
|
| 441 |
+
" <tr>\n",
|
| 442 |
+
" <th>1</th>\n",
|
| 443 |
+
" <td>2022-04-30</td>\n",
|
| 444 |
+
" <td>Shipped - Delivered to Buyer</td>\n",
|
| 445 |
+
" <td>Merchant</td>\n",
|
| 446 |
+
" <td>Amazon.in</td>\n",
|
| 447 |
+
" <td>Standard</td>\n",
|
| 448 |
+
" <td>JNE3781</td>\n",
|
| 449 |
+
" <td>JNE3781-KR-XXXL</td>\n",
|
| 450 |
+
" <td>kurta</td>\n",
|
| 451 |
+
" <td>3XL</td>\n",
|
| 452 |
+
" <td>Shipped</td>\n",
|
| 453 |
+
" <td>1</td>\n",
|
| 454 |
+
" <td>INR</td>\n",
|
| 455 |
+
" <td>406.00</td>\n",
|
| 456 |
+
" <td>BENGALURU</td>\n",
|
| 457 |
+
" <td>KARNATAKA</td>\n",
|
| 458 |
+
" <td>560085.0</td>\n",
|
| 459 |
+
" <td>IN</td>\n",
|
| 460 |
+
" <td>Amazon PLCC Free-Financing Universal Merchant ...</td>\n",
|
| 461 |
+
" <td>False</td>\n",
|
| 462 |
+
" <td>Easy Ship</td>\n",
|
| 463 |
+
" <td>101</td>\n",
|
| 464 |
+
" </tr>\n",
|
| 465 |
+
" </tbody>\n",
|
| 466 |
+
"</table>\n",
|
| 467 |
+
"</div>"
|
| 468 |
+
],
|
| 469 |
+
"text/plain": [
|
| 470 |
+
" Date Status Fulfilment Sales Channel \\\n",
|
| 471 |
+
"0 2022-04-30 Cancelled Merchant Amazon.in \n",
|
| 472 |
+
"1 2022-04-30 Shipped - Delivered to Buyer Merchant Amazon.in \n",
|
| 473 |
+
"\n",
|
| 474 |
+
" ship-service-level Style SKU Category Size Courier Status \\\n",
|
| 475 |
+
"0 Standard SET389 SET389-KR-NP-S Set S NaN \n",
|
| 476 |
+
"1 Standard JNE3781 JNE3781-KR-XXXL kurta 3XL Shipped \n",
|
| 477 |
+
"\n",
|
| 478 |
+
" Qty currency Amount ship-city ship-state ship-postal-code ship-country \\\n",
|
| 479 |
+
"0 0 INR 647.62 MUMBAI MAHARASHTRA 400081.0 IN \n",
|
| 480 |
+
"1 1 INR 406.00 BENGALURU KARNATAKA 560085.0 IN \n",
|
| 481 |
+
"\n",
|
| 482 |
+
" promotion-ids B2B fulfilled-by \\\n",
|
| 483 |
+
"0 NaN False Easy Ship \n",
|
| 484 |
+
"1 Amazon PLCC Free-Financing Universal Merchant ... False Easy Ship \n",
|
| 485 |
+
"\n",
|
| 486 |
+
" sales \n",
|
| 487 |
+
"0 35 \n",
|
| 488 |
+
"1 101 "
|
| 489 |
+
]
|
| 490 |
+
},
|
| 491 |
+
"execution_count": 68,
|
| 492 |
+
"metadata": {},
|
| 493 |
+
"output_type": "execute_result"
|
| 494 |
+
}
|
| 495 |
+
],
|
| 496 |
+
"source": [
|
| 497 |
+
"amazon.head(2)"
|
| 498 |
+
]
|
| 499 |
+
},
|
| 500 |
+
{
|
| 501 |
+
"cell_type": "code",
|
| 502 |
+
"execution_count": 70,
|
| 503 |
+
"metadata": {},
|
| 504 |
+
"outputs": [
|
| 505 |
+
{
|
| 506 |
+
"name": "stdout",
|
| 507 |
+
"output_type": "stream",
|
| 508 |
+
"text": [
|
| 509 |
+
"The selected dataframe has 21 columns and 9 columns with missing values.\n"
|
| 510 |
+
]
|
| 511 |
+
},
|
| 512 |
+
{
|
| 513 |
+
"data": {
|
| 514 |
+
"text/html": [
|
| 515 |
+
"<div>\n",
|
| 516 |
+
"<style scoped>\n",
|
| 517 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 518 |
+
" vertical-align: middle;\n",
|
| 519 |
+
" }\n",
|
| 520 |
+
"\n",
|
| 521 |
+
" .dataframe tbody tr th {\n",
|
| 522 |
+
" vertical-align: top;\n",
|
| 523 |
+
" }\n",
|
| 524 |
+
"\n",
|
| 525 |
+
" .dataframe thead th {\n",
|
| 526 |
+
" text-align: right;\n",
|
| 527 |
+
" }\n",
|
| 528 |
+
"</style>\n",
|
| 529 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 530 |
+
" <thead>\n",
|
| 531 |
+
" <tr style=\"text-align: right;\">\n",
|
| 532 |
+
" <th></th>\n",
|
| 533 |
+
" <th>Missing Values</th>\n",
|
| 534 |
+
" <th>% of Total Values</th>\n",
|
| 535 |
+
" </tr>\n",
|
| 536 |
+
" </thead>\n",
|
| 537 |
+
" <tbody>\n",
|
| 538 |
+
" <tr>\n",
|
| 539 |
+
" <th>fulfilled-by</th>\n",
|
| 540 |
+
" <td>89698</td>\n",
|
| 541 |
+
" <td>69.5</td>\n",
|
| 542 |
+
" </tr>\n",
|
| 543 |
+
" <tr>\n",
|
| 544 |
+
" <th>promotion-ids</th>\n",
|
| 545 |
+
" <td>49153</td>\n",
|
| 546 |
+
" <td>38.1</td>\n",
|
| 547 |
+
" </tr>\n",
|
| 548 |
+
" <tr>\n",
|
| 549 |
+
" <th>currency</th>\n",
|
| 550 |
+
" <td>7795</td>\n",
|
| 551 |
+
" <td>6.0</td>\n",
|
| 552 |
+
" </tr>\n",
|
| 553 |
+
" <tr>\n",
|
| 554 |
+
" <th>Amount</th>\n",
|
| 555 |
+
" <td>7795</td>\n",
|
| 556 |
+
" <td>6.0</td>\n",
|
| 557 |
+
" </tr>\n",
|
| 558 |
+
" <tr>\n",
|
| 559 |
+
" <th>Courier Status</th>\n",
|
| 560 |
+
" <td>6872</td>\n",
|
| 561 |
+
" <td>5.3</td>\n",
|
| 562 |
+
" </tr>\n",
|
| 563 |
+
" <tr>\n",
|
| 564 |
+
" <th>ship-city</th>\n",
|
| 565 |
+
" <td>33</td>\n",
|
| 566 |
+
" <td>0.0</td>\n",
|
| 567 |
+
" </tr>\n",
|
| 568 |
+
" <tr>\n",
|
| 569 |
+
" <th>ship-state</th>\n",
|
| 570 |
+
" <td>33</td>\n",
|
| 571 |
+
" <td>0.0</td>\n",
|
| 572 |
+
" </tr>\n",
|
| 573 |
+
" <tr>\n",
|
| 574 |
+
" <th>ship-postal-code</th>\n",
|
| 575 |
+
" <td>33</td>\n",
|
| 576 |
+
" <td>0.0</td>\n",
|
| 577 |
+
" </tr>\n",
|
| 578 |
+
" <tr>\n",
|
| 579 |
+
" <th>ship-country</th>\n",
|
| 580 |
+
" <td>33</td>\n",
|
| 581 |
+
" <td>0.0</td>\n",
|
| 582 |
+
" </tr>\n",
|
| 583 |
+
" </tbody>\n",
|
| 584 |
+
"</table>\n",
|
| 585 |
+
"</div>"
|
| 586 |
+
],
|
| 587 |
+
"text/plain": [
|
| 588 |
+
" Missing Values % of Total Values\n",
|
| 589 |
+
"fulfilled-by 89698 69.5\n",
|
| 590 |
+
"promotion-ids 49153 38.1\n",
|
| 591 |
+
"currency 7795 6.0\n",
|
| 592 |
+
"Amount 7795 6.0\n",
|
| 593 |
+
"Courier Status 6872 5.3\n",
|
| 594 |
+
"ship-city 33 0.0\n",
|
| 595 |
+
"ship-state 33 0.0\n",
|
| 596 |
+
"ship-postal-code 33 0.0\n",
|
| 597 |
+
"ship-country 33 0.0"
|
| 598 |
+
]
|
| 599 |
+
},
|
| 600 |
+
"execution_count": 70,
|
| 601 |
+
"metadata": {},
|
| 602 |
+
"output_type": "execute_result"
|
| 603 |
+
}
|
| 604 |
+
],
|
| 605 |
+
"source": [
|
| 606 |
+
"from src.data.eda import Eda\n",
|
| 607 |
+
"eda = Eda( \n",
|
| 608 |
+
")\n",
|
| 609 |
+
"\n",
|
| 610 |
+
"eda.missing_values_table(amazon)"
|
| 611 |
+
]
|
| 612 |
+
},
|
| 613 |
+
{
|
| 614 |
+
"cell_type": "code",
|
| 615 |
+
"execution_count": 71,
|
| 616 |
+
"metadata": {},
|
| 617 |
+
"outputs": [
|
| 618 |
+
{
|
| 619 |
+
"data": {
|
| 620 |
+
"text/html": [
|
| 621 |
+
"<div>\n",
|
| 622 |
+
"<style scoped>\n",
|
| 623 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 624 |
+
" vertical-align: middle;\n",
|
| 625 |
+
" }\n",
|
| 626 |
+
"\n",
|
| 627 |
+
" .dataframe tbody tr th {\n",
|
| 628 |
+
" vertical-align: top;\n",
|
| 629 |
+
" }\n",
|
| 630 |
+
"\n",
|
| 631 |
+
" .dataframe thead th {\n",
|
| 632 |
+
" text-align: right;\n",
|
| 633 |
+
" }\n",
|
| 634 |
+
"</style>\n",
|
| 635 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 636 |
+
" <thead>\n",
|
| 637 |
+
" <tr style=\"text-align: right;\">\n",
|
| 638 |
+
" <th></th>\n",
|
| 639 |
+
" <th>Date</th>\n",
|
| 640 |
+
" <th>Status</th>\n",
|
| 641 |
+
" <th>Fulfilment</th>\n",
|
| 642 |
+
" <th>Sales Channel</th>\n",
|
| 643 |
+
" <th>ship-service-level</th>\n",
|
| 644 |
+
" <th>Style</th>\n",
|
| 645 |
+
" <th>SKU</th>\n",
|
| 646 |
+
" <th>Category</th>\n",
|
| 647 |
+
" <th>Size</th>\n",
|
| 648 |
+
" <th>Courier Status</th>\n",
|
| 649 |
+
" <th>Qty</th>\n",
|
| 650 |
+
" <th>currency</th>\n",
|
| 651 |
+
" <th>Amount</th>\n",
|
| 652 |
+
" <th>ship-city</th>\n",
|
| 653 |
+
" <th>ship-state</th>\n",
|
| 654 |
+
" <th>ship-postal-code</th>\n",
|
| 655 |
+
" <th>ship-country</th>\n",
|
| 656 |
+
" <th>promotion-ids</th>\n",
|
| 657 |
+
" <th>B2B</th>\n",
|
| 658 |
+
" <th>fulfilled-by</th>\n",
|
| 659 |
+
" <th>sales</th>\n",
|
| 660 |
+
" </tr>\n",
|
| 661 |
+
" </thead>\n",
|
| 662 |
+
" <tbody>\n",
|
| 663 |
+
" <tr>\n",
|
| 664 |
+
" <th>0</th>\n",
|
| 665 |
+
" <td>2022-04-30</td>\n",
|
| 666 |
+
" <td>Cancelled</td>\n",
|
| 667 |
+
" <td>Merchant</td>\n",
|
| 668 |
+
" <td>Amazon.in</td>\n",
|
| 669 |
+
" <td>Standard</td>\n",
|
| 670 |
+
" <td>SET389</td>\n",
|
| 671 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 672 |
+
" <td>Set</td>\n",
|
| 673 |
+
" <td>S</td>\n",
|
| 674 |
+
" <td>NaN</td>\n",
|
| 675 |
+
" <td>0</td>\n",
|
| 676 |
+
" <td>INR</td>\n",
|
| 677 |
+
" <td>647.62</td>\n",
|
| 678 |
+
" <td>MUMBAI</td>\n",
|
| 679 |
+
" <td>MAHARASHTRA</td>\n",
|
| 680 |
+
" <td>400081.0</td>\n",
|
| 681 |
+
" <td>IN</td>\n",
|
| 682 |
+
" <td>NaN</td>\n",
|
| 683 |
+
" <td>False</td>\n",
|
| 684 |
+
" <td>Easy Ship</td>\n",
|
| 685 |
+
" <td>35</td>\n",
|
| 686 |
+
" </tr>\n",
|
| 687 |
+
" <tr>\n",
|
| 688 |
+
" <th>1</th>\n",
|
| 689 |
+
" <td>2022-04-30</td>\n",
|
| 690 |
+
" <td>Shipped - Delivered to Buyer</td>\n",
|
| 691 |
+
" <td>Merchant</td>\n",
|
| 692 |
+
" <td>Amazon.in</td>\n",
|
| 693 |
+
" <td>Standard</td>\n",
|
| 694 |
+
" <td>JNE3781</td>\n",
|
| 695 |
+
" <td>JNE3781-KR-XXXL</td>\n",
|
| 696 |
+
" <td>kurta</td>\n",
|
| 697 |
+
" <td>3XL</td>\n",
|
| 698 |
+
" <td>Shipped</td>\n",
|
| 699 |
+
" <td>1</td>\n",
|
| 700 |
+
" <td>INR</td>\n",
|
| 701 |
+
" <td>406.00</td>\n",
|
| 702 |
+
" <td>BENGALURU</td>\n",
|
| 703 |
+
" <td>KARNATAKA</td>\n",
|
| 704 |
+
" <td>560085.0</td>\n",
|
| 705 |
+
" <td>IN</td>\n",
|
| 706 |
+
" <td>Amazon PLCC Free-Financing Universal Merchant ...</td>\n",
|
| 707 |
+
" <td>False</td>\n",
|
| 708 |
+
" <td>Easy Ship</td>\n",
|
| 709 |
+
" <td>101</td>\n",
|
| 710 |
+
" </tr>\n",
|
| 711 |
+
" </tbody>\n",
|
| 712 |
+
"</table>\n",
|
| 713 |
+
"</div>"
|
| 714 |
+
],
|
| 715 |
+
"text/plain": [
|
| 716 |
+
" Date Status Fulfilment Sales Channel \\\n",
|
| 717 |
+
"0 2022-04-30 Cancelled Merchant Amazon.in \n",
|
| 718 |
+
"1 2022-04-30 Shipped - Delivered to Buyer Merchant Amazon.in \n",
|
| 719 |
+
"\n",
|
| 720 |
+
" ship-service-level Style SKU Category Size Courier Status \\\n",
|
| 721 |
+
"0 Standard SET389 SET389-KR-NP-S Set S NaN \n",
|
| 722 |
+
"1 Standard JNE3781 JNE3781-KR-XXXL kurta 3XL Shipped \n",
|
| 723 |
+
"\n",
|
| 724 |
+
" Qty currency Amount ship-city ship-state ship-postal-code ship-country \\\n",
|
| 725 |
+
"0 0 INR 647.62 MUMBAI MAHARASHTRA 400081.0 IN \n",
|
| 726 |
+
"1 1 INR 406.00 BENGALURU KARNATAKA 560085.0 IN \n",
|
| 727 |
+
"\n",
|
| 728 |
+
" promotion-ids B2B fulfilled-by \\\n",
|
| 729 |
+
"0 NaN False Easy Ship \n",
|
| 730 |
+
"1 Amazon PLCC Free-Financing Universal Merchant ... False Easy Ship \n",
|
| 731 |
+
"\n",
|
| 732 |
+
" sales \n",
|
| 733 |
+
"0 35 \n",
|
| 734 |
+
"1 101 "
|
| 735 |
+
]
|
| 736 |
+
},
|
| 737 |
+
"execution_count": 71,
|
| 738 |
+
"metadata": {},
|
| 739 |
+
"output_type": "execute_result"
|
| 740 |
+
}
|
| 741 |
+
],
|
| 742 |
+
"source": [
|
| 743 |
+
"amazon.head(2)"
|
| 744 |
+
]
|
| 745 |
+
},
|
| 746 |
+
{
|
| 747 |
+
"cell_type": "code",
|
| 748 |
+
"execution_count": 122,
|
| 749 |
+
"metadata": {},
|
| 750 |
+
"outputs": [],
|
| 751 |
+
"source": [
|
| 752 |
+
"amazon_beta = amazon[['Date', 'SKU', 'Qty', 'Amount', 'sales']]"
|
| 753 |
+
]
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"cell_type": "code",
|
| 757 |
+
"execution_count": 123,
|
| 758 |
+
"metadata": {},
|
| 759 |
+
"outputs": [],
|
| 760 |
+
"source": [
|
| 761 |
+
"amazon_beta.rename(columns={'Amount': 'price'}, inplace=True)"
|
| 762 |
+
]
|
| 763 |
+
},
|
| 764 |
+
{
|
| 765 |
+
"cell_type": "code",
|
| 766 |
+
"execution_count": 82,
|
| 767 |
+
"metadata": {},
|
| 768 |
+
"outputs": [
|
| 769 |
+
{
|
| 770 |
+
"data": {
|
| 771 |
+
"text/html": [
|
| 772 |
+
"<div>\n",
|
| 773 |
+
"<style scoped>\n",
|
| 774 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 775 |
+
" vertical-align: middle;\n",
|
| 776 |
+
" }\n",
|
| 777 |
+
"\n",
|
| 778 |
+
" .dataframe tbody tr th {\n",
|
| 779 |
+
" vertical-align: top;\n",
|
| 780 |
+
" }\n",
|
| 781 |
+
"\n",
|
| 782 |
+
" .dataframe thead th {\n",
|
| 783 |
+
" text-align: right;\n",
|
| 784 |
+
" }\n",
|
| 785 |
+
"</style>\n",
|
| 786 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 787 |
+
" <thead>\n",
|
| 788 |
+
" <tr style=\"text-align: right;\">\n",
|
| 789 |
+
" <th></th>\n",
|
| 790 |
+
" <th>Date</th>\n",
|
| 791 |
+
" <th>SKU</th>\n",
|
| 792 |
+
" <th>Qty</th>\n",
|
| 793 |
+
" <th>price</th>\n",
|
| 794 |
+
" <th>sales</th>\n",
|
| 795 |
+
" </tr>\n",
|
| 796 |
+
" </thead>\n",
|
| 797 |
+
" <tbody>\n",
|
| 798 |
+
" <tr>\n",
|
| 799 |
+
" <th>47784</th>\n",
|
| 800 |
+
" <td>2022-04-01</td>\n",
|
| 801 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 802 |
+
" <td>1</td>\n",
|
| 803 |
+
" <td>749.00</td>\n",
|
| 804 |
+
" <td>35</td>\n",
|
| 805 |
+
" </tr>\n",
|
| 806 |
+
" <tr>\n",
|
| 807 |
+
" <th>41605</th>\n",
|
| 808 |
+
" <td>2022-04-05</td>\n",
|
| 809 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 810 |
+
" <td>1</td>\n",
|
| 811 |
+
" <td>0.00</td>\n",
|
| 812 |
+
" <td>35</td>\n",
|
| 813 |
+
" </tr>\n",
|
| 814 |
+
" <tr>\n",
|
| 815 |
+
" <th>36996</th>\n",
|
| 816 |
+
" <td>2022-04-08</td>\n",
|
| 817 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 818 |
+
" <td>1</td>\n",
|
| 819 |
+
" <td>680.00</td>\n",
|
| 820 |
+
" <td>35</td>\n",
|
| 821 |
+
" </tr>\n",
|
| 822 |
+
" <tr>\n",
|
| 823 |
+
" <th>18468</th>\n",
|
| 824 |
+
" <td>2022-04-19</td>\n",
|
| 825 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 826 |
+
" <td>1</td>\n",
|
| 827 |
+
" <td>680.00</td>\n",
|
| 828 |
+
" <td>35</td>\n",
|
| 829 |
+
" </tr>\n",
|
| 830 |
+
" <tr>\n",
|
| 831 |
+
" <th>16932</th>\n",
|
| 832 |
+
" <td>2022-04-20</td>\n",
|
| 833 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 834 |
+
" <td>0</td>\n",
|
| 835 |
+
" <td>647.62</td>\n",
|
| 836 |
+
" <td>35</td>\n",
|
| 837 |
+
" </tr>\n",
|
| 838 |
+
" </tbody>\n",
|
| 839 |
+
"</table>\n",
|
| 840 |
+
"</div>"
|
| 841 |
+
],
|
| 842 |
+
"text/plain": [
|
| 843 |
+
" Date SKU Qty price sales\n",
|
| 844 |
+
"47784 2022-04-01 SET389-KR-NP-S 1 749.00 35\n",
|
| 845 |
+
"41605 2022-04-05 SET389-KR-NP-S 1 0.00 35\n",
|
| 846 |
+
"36996 2022-04-08 SET389-KR-NP-S 1 680.00 35\n",
|
| 847 |
+
"18468 2022-04-19 SET389-KR-NP-S 1 680.00 35\n",
|
| 848 |
+
"16932 2022-04-20 SET389-KR-NP-S 0 647.62 35"
|
| 849 |
+
]
|
| 850 |
+
},
|
| 851 |
+
"execution_count": 82,
|
| 852 |
+
"metadata": {},
|
| 853 |
+
"output_type": "execute_result"
|
| 854 |
+
}
|
| 855 |
+
],
|
| 856 |
+
"source": [
|
| 857 |
+
"amazon_beta.head(2)\n",
|
| 858 |
+
"amazon_beta.query('SKU == \"SET389-KR-NP-S\"').sort_values(by='Date', ascending=True).head()"
|
| 859 |
+
]
|
| 860 |
+
},
|
| 861 |
+
{
|
| 862 |
+
"cell_type": "code",
|
| 863 |
+
"execution_count": 124,
|
| 864 |
+
"metadata": {},
|
| 865 |
+
"outputs": [],
|
| 866 |
+
"source": [
|
| 867 |
+
"# show duplicates in amazon_beta \n",
|
| 868 |
+
"#amazon_beta[amazon_beta.duplicated(keep=False)].sort_values(by='SKU', ascending=True).head(10)\n",
|
| 869 |
+
"# drop duplicates in amazon_beta\n",
|
| 870 |
+
"amazon_beta.drop_duplicates(inplace=True)"
|
| 871 |
+
]
|
| 872 |
+
},
|
| 873 |
+
{
|
| 874 |
+
"cell_type": "code",
|
| 875 |
+
"execution_count": 125,
|
| 876 |
+
"metadata": {},
|
| 877 |
+
"outputs": [
|
| 878 |
+
{
|
| 879 |
+
"data": {
|
| 880 |
+
"text/html": [
|
| 881 |
+
"<div>\n",
|
| 882 |
+
"<style scoped>\n",
|
| 883 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 884 |
+
" vertical-align: middle;\n",
|
| 885 |
+
" }\n",
|
| 886 |
+
"\n",
|
| 887 |
+
" .dataframe tbody tr th {\n",
|
| 888 |
+
" vertical-align: top;\n",
|
| 889 |
+
" }\n",
|
| 890 |
+
"\n",
|
| 891 |
+
" .dataframe thead th {\n",
|
| 892 |
+
" text-align: right;\n",
|
| 893 |
+
" }\n",
|
| 894 |
+
"</style>\n",
|
| 895 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 896 |
+
" <thead>\n",
|
| 897 |
+
" <tr style=\"text-align: right;\">\n",
|
| 898 |
+
" <th></th>\n",
|
| 899 |
+
" <th>Date</th>\n",
|
| 900 |
+
" <th>SKU</th>\n",
|
| 901 |
+
" <th>Qty</th>\n",
|
| 902 |
+
" <th>price</th>\n",
|
| 903 |
+
" <th>sales</th>\n",
|
| 904 |
+
" </tr>\n",
|
| 905 |
+
" </thead>\n",
|
| 906 |
+
" <tbody>\n",
|
| 907 |
+
" <tr>\n",
|
| 908 |
+
" <th>47784</th>\n",
|
| 909 |
+
" <td>2022-04-01</td>\n",
|
| 910 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 911 |
+
" <td>1</td>\n",
|
| 912 |
+
" <td>749.00</td>\n",
|
| 913 |
+
" <td>35</td>\n",
|
| 914 |
+
" </tr>\n",
|
| 915 |
+
" <tr>\n",
|
| 916 |
+
" <th>41605</th>\n",
|
| 917 |
+
" <td>2022-04-05</td>\n",
|
| 918 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 919 |
+
" <td>1</td>\n",
|
| 920 |
+
" <td>0.00</td>\n",
|
| 921 |
+
" <td>35</td>\n",
|
| 922 |
+
" </tr>\n",
|
| 923 |
+
" <tr>\n",
|
| 924 |
+
" <th>36996</th>\n",
|
| 925 |
+
" <td>2022-04-08</td>\n",
|
| 926 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 927 |
+
" <td>1</td>\n",
|
| 928 |
+
" <td>680.00</td>\n",
|
| 929 |
+
" <td>35</td>\n",
|
| 930 |
+
" </tr>\n",
|
| 931 |
+
" <tr>\n",
|
| 932 |
+
" <th>18468</th>\n",
|
| 933 |
+
" <td>2022-04-19</td>\n",
|
| 934 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 935 |
+
" <td>1</td>\n",
|
| 936 |
+
" <td>680.00</td>\n",
|
| 937 |
+
" <td>35</td>\n",
|
| 938 |
+
" </tr>\n",
|
| 939 |
+
" <tr>\n",
|
| 940 |
+
" <th>16932</th>\n",
|
| 941 |
+
" <td>2022-04-20</td>\n",
|
| 942 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 943 |
+
" <td>0</td>\n",
|
| 944 |
+
" <td>647.62</td>\n",
|
| 945 |
+
" <td>35</td>\n",
|
| 946 |
+
" </tr>\n",
|
| 947 |
+
" </tbody>\n",
|
| 948 |
+
"</table>\n",
|
| 949 |
+
"</div>"
|
| 950 |
+
],
|
| 951 |
+
"text/plain": [
|
| 952 |
+
" Date SKU Qty price sales\n",
|
| 953 |
+
"47784 2022-04-01 SET389-KR-NP-S 1 749.00 35\n",
|
| 954 |
+
"41605 2022-04-05 SET389-KR-NP-S 1 0.00 35\n",
|
| 955 |
+
"36996 2022-04-08 SET389-KR-NP-S 1 680.00 35\n",
|
| 956 |
+
"18468 2022-04-19 SET389-KR-NP-S 1 680.00 35\n",
|
| 957 |
+
"16932 2022-04-20 SET389-KR-NP-S 0 647.62 35"
|
| 958 |
+
]
|
| 959 |
+
},
|
| 960 |
+
"execution_count": 125,
|
| 961 |
+
"metadata": {},
|
| 962 |
+
"output_type": "execute_result"
|
| 963 |
+
}
|
| 964 |
+
],
|
| 965 |
+
"source": [
|
| 966 |
+
"amazon_beta.query('SKU == \"SET389-KR-NP-S\"').sort_values(by='Date', ascending=True).head()"
|
| 967 |
+
]
|
| 968 |
+
},
|
| 969 |
+
{
|
| 970 |
+
"cell_type": "code",
|
| 971 |
+
"execution_count": 126,
|
| 972 |
+
"metadata": {},
|
| 973 |
+
"outputs": [
|
| 974 |
+
{
|
| 975 |
+
"name": "stdout",
|
| 976 |
+
"output_type": "stream",
|
| 977 |
+
"text": [
|
| 978 |
+
"The selected dataframe has 5 columns and 1 columns with missing values.\n"
|
| 979 |
+
]
|
| 980 |
+
},
|
| 981 |
+
{
|
| 982 |
+
"data": {
|
| 983 |
+
"text/html": [
|
| 984 |
+
"<div>\n",
|
| 985 |
+
"<style scoped>\n",
|
| 986 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 987 |
+
" vertical-align: middle;\n",
|
| 988 |
+
" }\n",
|
| 989 |
+
"\n",
|
| 990 |
+
" .dataframe tbody tr th {\n",
|
| 991 |
+
" vertical-align: top;\n",
|
| 992 |
+
" }\n",
|
| 993 |
+
"\n",
|
| 994 |
+
" .dataframe thead th {\n",
|
| 995 |
+
" text-align: right;\n",
|
| 996 |
+
" }\n",
|
| 997 |
+
"</style>\n",
|
| 998 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 999 |
+
" <thead>\n",
|
| 1000 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1001 |
+
" <th></th>\n",
|
| 1002 |
+
" <th>Missing Values</th>\n",
|
| 1003 |
+
" <th>% of Total Values</th>\n",
|
| 1004 |
+
" </tr>\n",
|
| 1005 |
+
" </thead>\n",
|
| 1006 |
+
" <tbody>\n",
|
| 1007 |
+
" <tr>\n",
|
| 1008 |
+
" <th>price</th>\n",
|
| 1009 |
+
" <td>6957</td>\n",
|
| 1010 |
+
" <td>7.6</td>\n",
|
| 1011 |
+
" </tr>\n",
|
| 1012 |
+
" </tbody>\n",
|
| 1013 |
+
"</table>\n",
|
| 1014 |
+
"</div>"
|
| 1015 |
+
],
|
| 1016 |
+
"text/plain": [
|
| 1017 |
+
" Missing Values % of Total Values\n",
|
| 1018 |
+
"price 6957 7.6"
|
| 1019 |
+
]
|
| 1020 |
+
},
|
| 1021 |
+
"execution_count": 126,
|
| 1022 |
+
"metadata": {},
|
| 1023 |
+
"output_type": "execute_result"
|
| 1024 |
+
}
|
| 1025 |
+
],
|
| 1026 |
+
"source": [
|
| 1027 |
+
"eda.missing_values_table(amazon_beta)"
|
| 1028 |
+
]
|
| 1029 |
+
},
|
| 1030 |
+
{
|
| 1031 |
+
"cell_type": "code",
|
| 1032 |
+
"execution_count": 127,
|
| 1033 |
+
"metadata": {},
|
| 1034 |
+
"outputs": [],
|
| 1035 |
+
"source": [
|
| 1036 |
+
"# ignore warnings\n",
|
| 1037 |
+
"import warnings\n",
|
| 1038 |
+
"warnings.filterwarnings('ignore')\n"
|
| 1039 |
+
]
|
| 1040 |
+
},
|
| 1041 |
+
{
|
| 1042 |
+
"cell_type": "code",
|
| 1043 |
+
"execution_count": 132,
|
| 1044 |
+
"metadata": {},
|
| 1045 |
+
"outputs": [],
|
| 1046 |
+
"source": [
|
| 1047 |
+
"import pandas as pd\n",
|
| 1048 |
+
"\n",
|
| 1049 |
+
"def calculate_rolling_average_price(dataset, window=13):\n",
|
| 1050 |
+
" \"\"\"\n",
|
| 1051 |
+
" Calculate the average price for the last `window` days grouped by SKU.\n",
|
| 1052 |
+
" \n",
|
| 1053 |
+
" Parameters:\n",
|
| 1054 |
+
" - dataset: DataFrame with the columns ['Date', 'SKU', 'Qty', 'price', 'sales'].\n",
|
| 1055 |
+
" - window: Integer, the number of days to calculate the rolling average.\n",
|
| 1056 |
+
" \n",
|
| 1057 |
+
" Returns:\n",
|
| 1058 |
+
" - DataFrame with a new column 'avg_price_30' containing the rolling average prices.\n",
|
| 1059 |
+
" \"\"\"\n",
|
| 1060 |
+
" \n",
|
| 1061 |
+
" # Sort by SKU and Date\n",
|
| 1062 |
+
" dataset = dataset.sort_values(by=['SKU', 'Date'])\n",
|
| 1063 |
+
"\n",
|
| 1064 |
+
" # Set the date as the index for rolling operation\n",
|
| 1065 |
+
" dataset = dataset.set_index('Date')\n",
|
| 1066 |
+
" \n",
|
| 1067 |
+
" # Calculate the rolling average price grouped by SKU\n",
|
| 1068 |
+
" def rolling_avg(x):\n",
|
| 1069 |
+
" return x.rolling(window, min_periods=1).mean()\n",
|
| 1070 |
+
" \n",
|
| 1071 |
+
" dataset['avg_price_N'] = dataset.groupby('SKU')['price'].apply(rolling_avg)\n",
|
| 1072 |
+
"\n",
|
| 1073 |
+
" # Reset the index\n",
|
| 1074 |
+
" dataset = dataset.reset_index()\n",
|
| 1075 |
+
" \n",
|
| 1076 |
+
" return dataset\n",
|
| 1077 |
+
"\n",
|
| 1078 |
+
"\n",
|
| 1079 |
+
"\n",
|
| 1080 |
+
"\n"
|
| 1081 |
+
]
|
| 1082 |
+
},
|
| 1083 |
+
{
|
| 1084 |
+
"cell_type": "code",
|
| 1085 |
+
"execution_count": 133,
|
| 1086 |
+
"metadata": {},
|
| 1087 |
+
"outputs": [],
|
| 1088 |
+
"source": [
|
| 1089 |
+
"amazon_beta = calculate_rolling_average_price(amazon_beta, window=13)"
|
| 1090 |
+
]
|
| 1091 |
+
},
|
| 1092 |
+
{
|
| 1093 |
+
"cell_type": "code",
|
| 1094 |
+
"execution_count": 135,
|
| 1095 |
+
"metadata": {},
|
| 1096 |
+
"outputs": [
|
| 1097 |
+
{
|
| 1098 |
+
"data": {
|
| 1099 |
+
"text/html": [
|
| 1100 |
+
"<div>\n",
|
| 1101 |
+
"<style scoped>\n",
|
| 1102 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 1103 |
+
" vertical-align: middle;\n",
|
| 1104 |
+
" }\n",
|
| 1105 |
+
"\n",
|
| 1106 |
+
" .dataframe tbody tr th {\n",
|
| 1107 |
+
" vertical-align: top;\n",
|
| 1108 |
+
" }\n",
|
| 1109 |
+
"\n",
|
| 1110 |
+
" .dataframe thead th {\n",
|
| 1111 |
+
" text-align: right;\n",
|
| 1112 |
+
" }\n",
|
| 1113 |
+
"</style>\n",
|
| 1114 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 1115 |
+
" <thead>\n",
|
| 1116 |
+
" <tr style=\"text-align: right;\">\n",
|
| 1117 |
+
" <th></th>\n",
|
| 1118 |
+
" <th>Date</th>\n",
|
| 1119 |
+
" <th>SKU</th>\n",
|
| 1120 |
+
" <th>Qty</th>\n",
|
| 1121 |
+
" <th>price</th>\n",
|
| 1122 |
+
" <th>sales</th>\n",
|
| 1123 |
+
" <th>avg_price_N</th>\n",
|
| 1124 |
+
" </tr>\n",
|
| 1125 |
+
" </thead>\n",
|
| 1126 |
+
" <tbody>\n",
|
| 1127 |
+
" <tr>\n",
|
| 1128 |
+
" <th>0</th>\n",
|
| 1129 |
+
" <td>2022-04-07</td>\n",
|
| 1130 |
+
" <td>AN201-RED-M</td>\n",
|
| 1131 |
+
" <td>1</td>\n",
|
| 1132 |
+
" <td>229.0</td>\n",
|
| 1133 |
+
" <td>2</td>\n",
|
| 1134 |
+
" <td>229.0</td>\n",
|
| 1135 |
+
" </tr>\n",
|
| 1136 |
+
" <tr>\n",
|
| 1137 |
+
" <th>1</th>\n",
|
| 1138 |
+
" <td>2022-05-01</td>\n",
|
| 1139 |
+
" <td>AN201-RED-M</td>\n",
|
| 1140 |
+
" <td>1</td>\n",
|
| 1141 |
+
" <td>229.0</td>\n",
|
| 1142 |
+
" <td>2</td>\n",
|
| 1143 |
+
" <td>229.0</td>\n",
|
| 1144 |
+
" </tr>\n",
|
| 1145 |
+
" <tr>\n",
|
| 1146 |
+
" <th>2</th>\n",
|
| 1147 |
+
" <td>2022-06-24</td>\n",
|
| 1148 |
+
" <td>AN201-RED-XL</td>\n",
|
| 1149 |
+
" <td>1</td>\n",
|
| 1150 |
+
" <td>301.0</td>\n",
|
| 1151 |
+
" <td>2</td>\n",
|
| 1152 |
+
" <td>301.0</td>\n",
|
| 1153 |
+
" </tr>\n",
|
| 1154 |
+
" <tr>\n",
|
| 1155 |
+
" <th>3</th>\n",
|
| 1156 |
+
" <td>2022-06-26</td>\n",
|
| 1157 |
+
" <td>AN201-RED-XL</td>\n",
|
| 1158 |
+
" <td>1</td>\n",
|
| 1159 |
+
" <td>301.0</td>\n",
|
| 1160 |
+
" <td>2</td>\n",
|
| 1161 |
+
" <td>301.0</td>\n",
|
| 1162 |
+
" </tr>\n",
|
| 1163 |
+
" <tr>\n",
|
| 1164 |
+
" <th>4</th>\n",
|
| 1165 |
+
" <td>2022-05-03</td>\n",
|
| 1166 |
+
" <td>AN201-RED-XXL</td>\n",
|
| 1167 |
+
" <td>1</td>\n",
|
| 1168 |
+
" <td>229.0</td>\n",
|
| 1169 |
+
" <td>1</td>\n",
|
| 1170 |
+
" <td>229.0</td>\n",
|
| 1171 |
+
" </tr>\n",
|
| 1172 |
+
" </tbody>\n",
|
| 1173 |
+
"</table>\n",
|
| 1174 |
+
"</div>"
|
| 1175 |
+
],
|
| 1176 |
+
"text/plain": [
|
| 1177 |
+
" Date SKU Qty price sales avg_price_N\n",
|
| 1178 |
+
"0 2022-04-07 AN201-RED-M 1 229.0 2 229.0\n",
|
| 1179 |
+
"1 2022-05-01 AN201-RED-M 1 229.0 2 229.0\n",
|
| 1180 |
+
"2 2022-06-24 AN201-RED-XL 1 301.0 2 301.0\n",
|
| 1181 |
+
"3 2022-06-26 AN201-RED-XL 1 301.0 2 301.0\n",
|
| 1182 |
+
"4 2022-05-03 AN201-RED-XXL 1 229.0 1 229.0"
|
| 1183 |
+
]
|
| 1184 |
+
},
|
| 1185 |
+
"execution_count": 135,
|
| 1186 |
+
"metadata": {},
|
| 1187 |
+
"output_type": "execute_result"
|
| 1188 |
+
}
|
| 1189 |
+
],
|
| 1190 |
+
"source": [
|
| 1191 |
+
"amazon_beta.head()"
|
| 1192 |
+
]
|
| 1193 |
+
},
|
| 1194 |
+
{
|
| 1195 |
+
"cell_type": "code",
|
| 1196 |
+
"execution_count": 136,
|
| 1197 |
+
"metadata": {},
|
| 1198 |
+
"outputs": [],
|
| 1199 |
+
"source": [
|
| 1200 |
+
"def filter_rows(group):\n",
|
| 1201 |
+
" return group[group['price'] != group['avg_price_N']]\n",
|
| 1202 |
+
"\n",
|
| 1203 |
+
"amazon_beta_filtered = amazon_beta.groupby('SKU').apply(filter_rows).reset_index(drop=True)"
|
| 1204 |
+
]
|
| 1205 |
+
},
|
| 1206 |
+
{
|
| 1207 |
+
"cell_type": "code",
|
| 1208 |
+
"execution_count": null,
|
| 1209 |
+
"metadata": {},
|
| 1210 |
+
"outputs": [],
|
| 1211 |
+
"source": []
|
| 1212 |
+
},
|
| 1213 |
+
{
|
| 1214 |
+
"cell_type": "code",
|
| 1215 |
+
"execution_count": null,
|
| 1216 |
+
"metadata": {},
|
| 1217 |
+
"outputs": [],
|
| 1218 |
+
"source": [
|
| 1219 |
+
"# calculate the average number of days"
|
| 1220 |
+
]
|
| 1221 |
+
}
|
| 1222 |
+
],
|
| 1223 |
+
"metadata": {
|
| 1224 |
+
"kernelspec": {
|
| 1225 |
+
"display_name": "relu",
|
| 1226 |
+
"language": "python",
|
| 1227 |
+
"name": "python3"
|
| 1228 |
+
},
|
| 1229 |
+
"language_info": {
|
| 1230 |
+
"codemirror_mode": {
|
| 1231 |
+
"name": "ipython",
|
| 1232 |
+
"version": 3
|
| 1233 |
+
},
|
| 1234 |
+
"file_extension": ".py",
|
| 1235 |
+
"mimetype": "text/x-python",
|
| 1236 |
+
"name": "python",
|
| 1237 |
+
"nbconvert_exporter": "python",
|
| 1238 |
+
"pygments_lexer": "ipython3",
|
| 1239 |
+
"version": "3.8.16"
|
| 1240 |
+
},
|
| 1241 |
+
"orig_nbformat": 4
|
| 1242 |
+
},
|
| 1243 |
+
"nbformat": 4,
|
| 1244 |
+
"nbformat_minor": 2
|
| 1245 |
+
}
|
notebooks/amazon_sales.ipynb
ADDED
|
@@ -0,0 +1,985 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "code",
|
| 5 |
+
"execution_count": 59,
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"outputs": [
|
| 8 |
+
{
|
| 9 |
+
"name": "stdout",
|
| 10 |
+
"output_type": "stream",
|
| 11 |
+
"text": [
|
| 12 |
+
"The autoreload extension is already loaded. To reload it, use:\n",
|
| 13 |
+
" %reload_ext autoreload\n"
|
| 14 |
+
]
|
| 15 |
+
}
|
| 16 |
+
],
|
| 17 |
+
"source": [
|
| 18 |
+
"\n",
|
| 19 |
+
"from src.data.dataset_reader import DatasetReader\n",
|
| 20 |
+
"from pathlib import Path\n",
|
| 21 |
+
"%load_ext autoreload\n",
|
| 22 |
+
"%autoreload 2\n",
|
| 23 |
+
"# ignore warnings\n",
|
| 24 |
+
"import warnings\n",
|
| 25 |
+
"warnings.filterwarnings('ignore')\n",
|
| 26 |
+
"data_folder = Path(\"../data/raw\").resolve()\n",
|
| 27 |
+
"\n",
|
| 28 |
+
"amazon = DatasetReader(data_folder).get_data_csv('Amazon Sale Report.csv')\n",
|
| 29 |
+
"#int_sales = DatasetReader(data_folder).get_data_csv('International sale Report.csv')\n",
|
| 30 |
+
"#p_l = DatasetReader(data_folder).get_data_csv('P LMarch2021.csv')\n",
|
| 31 |
+
"#may_2022 = DatasetReader(data_folder).get_data_csv('May-2022.csv')\n",
|
| 32 |
+
"#sale_report = DatasetReader(data_folder).get_data_csv('Sale Report.csv')\n"
|
| 33 |
+
]
|
| 34 |
+
},
|
| 35 |
+
{
|
| 36 |
+
"cell_type": "code",
|
| 37 |
+
"execution_count": 60,
|
| 38 |
+
"metadata": {},
|
| 39 |
+
"outputs": [
|
| 40 |
+
{
|
| 41 |
+
"data": {
|
| 42 |
+
"text/html": [
|
| 43 |
+
"<div>\n",
|
| 44 |
+
"<style scoped>\n",
|
| 45 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 46 |
+
" vertical-align: middle;\n",
|
| 47 |
+
" }\n",
|
| 48 |
+
"\n",
|
| 49 |
+
" .dataframe tbody tr th {\n",
|
| 50 |
+
" vertical-align: top;\n",
|
| 51 |
+
" }\n",
|
| 52 |
+
"\n",
|
| 53 |
+
" .dataframe thead th {\n",
|
| 54 |
+
" text-align: right;\n",
|
| 55 |
+
" }\n",
|
| 56 |
+
"</style>\n",
|
| 57 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 58 |
+
" <thead>\n",
|
| 59 |
+
" <tr style=\"text-align: right;\">\n",
|
| 60 |
+
" <th></th>\n",
|
| 61 |
+
" <th>index</th>\n",
|
| 62 |
+
" <th>Order ID</th>\n",
|
| 63 |
+
" <th>Date</th>\n",
|
| 64 |
+
" <th>Status</th>\n",
|
| 65 |
+
" <th>Fulfilment</th>\n",
|
| 66 |
+
" <th>Sales Channel</th>\n",
|
| 67 |
+
" <th>ship-service-level</th>\n",
|
| 68 |
+
" <th>Style</th>\n",
|
| 69 |
+
" <th>SKU</th>\n",
|
| 70 |
+
" <th>Category</th>\n",
|
| 71 |
+
" <th>Size</th>\n",
|
| 72 |
+
" <th>ASIN</th>\n",
|
| 73 |
+
" <th>Courier Status</th>\n",
|
| 74 |
+
" <th>Qty</th>\n",
|
| 75 |
+
" <th>currency</th>\n",
|
| 76 |
+
" <th>Amount</th>\n",
|
| 77 |
+
" <th>ship-city</th>\n",
|
| 78 |
+
" <th>ship-state</th>\n",
|
| 79 |
+
" <th>ship-postal-code</th>\n",
|
| 80 |
+
" <th>ship-country</th>\n",
|
| 81 |
+
" <th>promotion-ids</th>\n",
|
| 82 |
+
" <th>B2B</th>\n",
|
| 83 |
+
" <th>fulfilled-by</th>\n",
|
| 84 |
+
" <th>Unnamed: 22</th>\n",
|
| 85 |
+
" </tr>\n",
|
| 86 |
+
" </thead>\n",
|
| 87 |
+
" <tbody>\n",
|
| 88 |
+
" <tr>\n",
|
| 89 |
+
" <th>0</th>\n",
|
| 90 |
+
" <td>0</td>\n",
|
| 91 |
+
" <td>405-8078784-5731545</td>\n",
|
| 92 |
+
" <td>04-30-22</td>\n",
|
| 93 |
+
" <td>Cancelled</td>\n",
|
| 94 |
+
" <td>Merchant</td>\n",
|
| 95 |
+
" <td>Amazon.in</td>\n",
|
| 96 |
+
" <td>Standard</td>\n",
|
| 97 |
+
" <td>SET389</td>\n",
|
| 98 |
+
" <td>SET389-KR-NP-S</td>\n",
|
| 99 |
+
" <td>Set</td>\n",
|
| 100 |
+
" <td>S</td>\n",
|
| 101 |
+
" <td>B09KXVBD7Z</td>\n",
|
| 102 |
+
" <td>NaN</td>\n",
|
| 103 |
+
" <td>0</td>\n",
|
| 104 |
+
" <td>INR</td>\n",
|
| 105 |
+
" <td>647.62</td>\n",
|
| 106 |
+
" <td>MUMBAI</td>\n",
|
| 107 |
+
" <td>MAHARASHTRA</td>\n",
|
| 108 |
+
" <td>400081.0</td>\n",
|
| 109 |
+
" <td>IN</td>\n",
|
| 110 |
+
" <td>NaN</td>\n",
|
| 111 |
+
" <td>False</td>\n",
|
| 112 |
+
" <td>Easy Ship</td>\n",
|
| 113 |
+
" <td>NaN</td>\n",
|
| 114 |
+
" </tr>\n",
|
| 115 |
+
" <tr>\n",
|
| 116 |
+
" <th>1</th>\n",
|
| 117 |
+
" <td>1</td>\n",
|
| 118 |
+
" <td>171-9198151-1101146</td>\n",
|
| 119 |
+
" <td>04-30-22</td>\n",
|
| 120 |
+
" <td>Shipped - Delivered to Buyer</td>\n",
|
| 121 |
+
" <td>Merchant</td>\n",
|
| 122 |
+
" <td>Amazon.in</td>\n",
|
| 123 |
+
" <td>Standard</td>\n",
|
| 124 |
+
" <td>JNE3781</td>\n",
|
| 125 |
+
" <td>JNE3781-KR-XXXL</td>\n",
|
| 126 |
+
" <td>kurta</td>\n",
|
| 127 |
+
" <td>3XL</td>\n",
|
| 128 |
+
" <td>B09K3WFS32</td>\n",
|
| 129 |
+
" <td>Shipped</td>\n",
|
| 130 |
+
" <td>1</td>\n",
|
| 131 |
+
" <td>INR</td>\n",
|
| 132 |
+
" <td>406.00</td>\n",
|
| 133 |
+
" <td>BENGALURU</td>\n",
|
| 134 |
+
" <td>KARNATAKA</td>\n",
|
| 135 |
+
" <td>560085.0</td>\n",
|
| 136 |
+
" <td>IN</td>\n",
|
| 137 |
+
" <td>Amazon PLCC Free-Financing Universal Merchant ...</td>\n",
|
| 138 |
+
" <td>False</td>\n",
|
| 139 |
+
" <td>Easy Ship</td>\n",
|
| 140 |
+
" <td>NaN</td>\n",
|
| 141 |
+
" </tr>\n",
|
| 142 |
+
" <tr>\n",
|
| 143 |
+
" <th>2</th>\n",
|
| 144 |
+
" <td>2</td>\n",
|
| 145 |
+
" <td>404-0687676-7273146</td>\n",
|
| 146 |
+
" <td>04-30-22</td>\n",
|
| 147 |
+
" <td>Shipped</td>\n",
|
| 148 |
+
" <td>Amazon</td>\n",
|
| 149 |
+
" <td>Amazon.in</td>\n",
|
| 150 |
+
" <td>Expedited</td>\n",
|
| 151 |
+
" <td>JNE3371</td>\n",
|
| 152 |
+
" <td>JNE3371-KR-XL</td>\n",
|
| 153 |
+
" <td>kurta</td>\n",
|
| 154 |
+
" <td>XL</td>\n",
|
| 155 |
+
" <td>B07WV4JV4D</td>\n",
|
| 156 |
+
" <td>Shipped</td>\n",
|
| 157 |
+
" <td>1</td>\n",
|
| 158 |
+
" <td>INR</td>\n",
|
| 159 |
+
" <td>329.00</td>\n",
|
| 160 |
+
" <td>NAVI MUMBAI</td>\n",
|
| 161 |
+
" <td>MAHARASHTRA</td>\n",
|
| 162 |
+
" <td>410210.0</td>\n",
|
| 163 |
+
" <td>IN</td>\n",
|
| 164 |
+
" <td>IN Core Free Shipping 2015/04/08 23-48-5-108</td>\n",
|
| 165 |
+
" <td>True</td>\n",
|
| 166 |
+
" <td>NaN</td>\n",
|
| 167 |
+
" <td>NaN</td>\n",
|
| 168 |
+
" </tr>\n",
|
| 169 |
+
" </tbody>\n",
|
| 170 |
+
"</table>\n",
|
| 171 |
+
"</div>"
|
| 172 |
+
],
|
| 173 |
+
"text/plain": [
|
| 174 |
+
" index Order ID Date Status \\\n",
|
| 175 |
+
"0 0 405-8078784-5731545 04-30-22 Cancelled \n",
|
| 176 |
+
"1 1 171-9198151-1101146 04-30-22 Shipped - Delivered to Buyer \n",
|
| 177 |
+
"2 2 404-0687676-7273146 04-30-22 Shipped \n",
|
| 178 |
+
"\n",
|
| 179 |
+
" Fulfilment Sales Channel ship-service-level Style SKU \\\n",
|
| 180 |
+
"0 Merchant Amazon.in Standard SET389 SET389-KR-NP-S \n",
|
| 181 |
+
"1 Merchant Amazon.in Standard JNE3781 JNE3781-KR-XXXL \n",
|
| 182 |
+
"2 Amazon Amazon.in Expedited JNE3371 JNE3371-KR-XL \n",
|
| 183 |
+
"\n",
|
| 184 |
+
" Category Size ASIN Courier Status Qty currency Amount ship-city \\\n",
|
| 185 |
+
"0 Set S B09KXVBD7Z NaN 0 INR 647.62 MUMBAI \n",
|
| 186 |
+
"1 kurta 3XL B09K3WFS32 Shipped 1 INR 406.00 BENGALURU \n",
|
| 187 |
+
"2 kurta XL B07WV4JV4D Shipped 1 INR 329.00 NAVI MUMBAI \n",
|
| 188 |
+
"\n",
|
| 189 |
+
" ship-state ship-postal-code ship-country \\\n",
|
| 190 |
+
"0 MAHARASHTRA 400081.0 IN \n",
|
| 191 |
+
"1 KARNATAKA 560085.0 IN \n",
|
| 192 |
+
"2 MAHARASHTRA 410210.0 IN \n",
|
| 193 |
+
"\n",
|
| 194 |
+
" promotion-ids B2B fulfilled-by \\\n",
|
| 195 |
+
"0 NaN False Easy Ship \n",
|
| 196 |
+
"1 Amazon PLCC Free-Financing Universal Merchant ... False Easy Ship \n",
|
| 197 |
+
"2 IN Core Free Shipping 2015/04/08 23-48-5-108 True NaN \n",
|
| 198 |
+
"\n",
|
| 199 |
+
" Unnamed: 22 \n",
|
| 200 |
+
"0 NaN \n",
|
| 201 |
+
"1 NaN \n",
|
| 202 |
+
"2 NaN "
|
| 203 |
+
]
|
| 204 |
+
},
|
| 205 |
+
"execution_count": 60,
|
| 206 |
+
"metadata": {},
|
| 207 |
+
"output_type": "execute_result"
|
| 208 |
+
}
|
| 209 |
+
],
|
| 210 |
+
"source": [
|
| 211 |
+
"import pandas as pd\n",
|
| 212 |
+
"pd.set_option('display.max_columns', None)\n",
|
| 213 |
+
"amazon.head(3)\n",
|
| 214 |
+
"#amazon.query('SKU == \"SET389-KR-NP-S\"').head(1)\n",
|
| 215 |
+
" \n"
|
| 216 |
+
]
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"cell_type": "code",
|
| 220 |
+
"execution_count": 61,
|
| 221 |
+
"metadata": {},
|
| 222 |
+
"outputs": [],
|
| 223 |
+
"source": [
|
| 224 |
+
"from src.data.feature_engineering import FeatureEngineeringProcess\n",
|
| 225 |
+
"fep = FeatureEngineeringProcess()\n"
|
| 226 |
+
]
|
| 227 |
+
},
|
| 228 |
+
{
|
| 229 |
+
"cell_type": "code",
|
| 230 |
+
"execution_count": null,
|
| 231 |
+
"metadata": {},
|
| 232 |
+
"outputs": [],
|
| 233 |
+
"source": []
|
| 234 |
+
},
|
| 235 |
+
{
|
| 236 |
+
"cell_type": "code",
|
| 237 |
+
"execution_count": 3,
|
| 238 |
+
"metadata": {},
|
| 239 |
+
"outputs": [],
|
| 240 |
+
"source": [
|
| 241 |
+
"# Create a new feature called sales that is the the count of \"Amount\" grouped by \"SKU\" in the amazon dataset\n",
|
| 242 |
+
"#amazon['sales'] = amazon.groupby('SKU')['Amount'].transform('count')\n",
|
| 243 |
+
"#amazon.drop(columns=[ 'Order ID', 'ASIN', 'Unnamed: 22', 'index'], inplace=True\n",
|
| 244 |
+
"amazon['Date'] = pd.to_datetime(amazon['Date'])\n",
|
| 245 |
+
"amazon['ship-postal-code'] = amazon['ship-postal-code'].astype('object')\n",
|
| 246 |
+
"amazon_beta = amazon[['Order ID','Date', 'SKU', 'Qty', 'Amount']]"
|
| 247 |
+
]
|
| 248 |
+
},
|
| 249 |
+
{
|
| 250 |
+
"cell_type": "code",
|
| 251 |
+
"execution_count": 4,
|
| 252 |
+
"metadata": {},
|
| 253 |
+
"outputs": [
|
| 254 |
+
{
|
| 255 |
+
"name": "stdout",
|
| 256 |
+
"output_type": "stream",
|
| 257 |
+
"text": [
|
| 258 |
+
"The selected dataframe has 5 columns and 1 columns with missing values.\n"
|
| 259 |
+
]
|
| 260 |
+
},
|
| 261 |
+
{
|
| 262 |
+
"data": {
|
| 263 |
+
"text/html": [
|
| 264 |
+
"<div>\n",
|
| 265 |
+
"<style scoped>\n",
|
| 266 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 267 |
+
" vertical-align: middle;\n",
|
| 268 |
+
" }\n",
|
| 269 |
+
"\n",
|
| 270 |
+
" .dataframe tbody tr th {\n",
|
| 271 |
+
" vertical-align: top;\n",
|
| 272 |
+
" }\n",
|
| 273 |
+
"\n",
|
| 274 |
+
" .dataframe thead th {\n",
|
| 275 |
+
" text-align: right;\n",
|
| 276 |
+
" }\n",
|
| 277 |
+
"</style>\n",
|
| 278 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 279 |
+
" <thead>\n",
|
| 280 |
+
" <tr style=\"text-align: right;\">\n",
|
| 281 |
+
" <th></th>\n",
|
| 282 |
+
" <th>Missing Values</th>\n",
|
| 283 |
+
" <th>% of Total Values</th>\n",
|
| 284 |
+
" </tr>\n",
|
| 285 |
+
" </thead>\n",
|
| 286 |
+
" <tbody>\n",
|
| 287 |
+
" <tr>\n",
|
| 288 |
+
" <th>Amount</th>\n",
|
| 289 |
+
" <td>7795</td>\n",
|
| 290 |
+
" <td>6.0</td>\n",
|
| 291 |
+
" </tr>\n",
|
| 292 |
+
" </tbody>\n",
|
| 293 |
+
"</table>\n",
|
| 294 |
+
"</div>"
|
| 295 |
+
],
|
| 296 |
+
"text/plain": [
|
| 297 |
+
" Missing Values % of Total Values\n",
|
| 298 |
+
"Amount 7795 6.0"
|
| 299 |
+
]
|
| 300 |
+
},
|
| 301 |
+
"execution_count": 4,
|
| 302 |
+
"metadata": {},
|
| 303 |
+
"output_type": "execute_result"
|
| 304 |
+
}
|
| 305 |
+
],
|
| 306 |
+
"source": [
|
| 307 |
+
"from src.data.eda import Eda\n",
|
| 308 |
+
"eda = Eda( \n",
|
| 309 |
+
")\n",
|
| 310 |
+
"\n",
|
| 311 |
+
"eda.missing_values_table(amazon_beta)"
|
| 312 |
+
]
|
| 313 |
+
},
|
| 314 |
+
{
|
| 315 |
+
"cell_type": "code",
|
| 316 |
+
"execution_count": 5,
|
| 317 |
+
"metadata": {},
|
| 318 |
+
"outputs": [],
|
| 319 |
+
"source": [
|
| 320 |
+
"amazon_beta.rename(columns={'Amount': 'price'}, inplace=True)"
|
| 321 |
+
]
|
| 322 |
+
},
|
| 323 |
+
{
|
| 324 |
+
"cell_type": "code",
|
| 325 |
+
"execution_count": 6,
|
| 326 |
+
"metadata": {},
|
| 327 |
+
"outputs": [],
|
| 328 |
+
"source": [
|
| 329 |
+
"amazon_beta.head()\n",
|
| 330 |
+
"# Create a column called \"sales\" that is the count of the \"Order ID\" grouped by \"SKU\" and \"Date\" in the amazon_beta dataset\n",
|
| 331 |
+
"amazon_beta['sales'] = amazon_beta.groupby(['SKU', 'Date'])['Order ID'].transform('count')\n"
|
| 332 |
+
]
|
| 333 |
+
},
|
| 334 |
+
{
|
| 335 |
+
"cell_type": "code",
|
| 336 |
+
"execution_count": null,
|
| 337 |
+
"metadata": {},
|
| 338 |
+
"outputs": [],
|
| 339 |
+
"source": [
|
| 340 |
+
"#amazon_beta.query('SKU == \"SET389-KR-NP-S\"').sort_values(by=['Date'], ascending=True).head()"
|
| 341 |
+
]
|
| 342 |
+
},
|
| 343 |
+
{
|
| 344 |
+
"cell_type": "code",
|
| 345 |
+
"execution_count": null,
|
| 346 |
+
"metadata": {},
|
| 347 |
+
"outputs": [],
|
| 348 |
+
"source": [
|
| 349 |
+
"# show duplicates in amazon_beta \n",
|
| 350 |
+
"#amazon_beta[amazon_beta.duplicated(keep=False)].sort_values(by='SKU', ascending=True).head(10)\n",
|
| 351 |
+
"# drop duplicates in amazon_beta\n",
|
| 352 |
+
"#amazon_beta.drop_duplicates(inplace=True)"
|
| 353 |
+
]
|
| 354 |
+
},
|
| 355 |
+
{
|
| 356 |
+
"cell_type": "code",
|
| 357 |
+
"execution_count": null,
|
| 358 |
+
"metadata": {},
|
| 359 |
+
"outputs": [],
|
| 360 |
+
"source": [
|
| 361 |
+
"eda.missing_values_table(amazon_beta)"
|
| 362 |
+
]
|
| 363 |
+
},
|
| 364 |
+
{
|
| 365 |
+
"cell_type": "code",
|
| 366 |
+
"execution_count": 7,
|
| 367 |
+
"metadata": {},
|
| 368 |
+
"outputs": [],
|
| 369 |
+
"source": [
|
| 370 |
+
"amazon_beta.sort_values(by=['SKU', 'Date'], ascending=True, inplace=True)"
|
| 371 |
+
]
|
| 372 |
+
},
|
| 373 |
+
{
|
| 374 |
+
"cell_type": "code",
|
| 375 |
+
"execution_count": 8,
|
| 376 |
+
"metadata": {},
|
| 377 |
+
"outputs": [],
|
| 378 |
+
"source": [
|
| 379 |
+
"from src.data.feature_engineering import FeatureEngineeringProcess\n",
|
| 380 |
+
"fep = FeatureEngineeringProcess()"
|
| 381 |
+
]
|
| 382 |
+
},
|
| 383 |
+
{
|
| 384 |
+
"cell_type": "code",
|
| 385 |
+
"execution_count": 9,
|
| 386 |
+
"metadata": {},
|
| 387 |
+
"outputs": [],
|
| 388 |
+
"source": [
|
| 389 |
+
"amazon_beta_fe1 = fep.price_sales_correlation_features_updated(amazon_beta, 15, [1, 2], [1,2],)\n",
|
| 390 |
+
"#amazon_beta_fe1.head(3)"
|
| 391 |
+
]
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"cell_type": "code",
|
| 395 |
+
"execution_count": null,
|
| 396 |
+
"metadata": {},
|
| 397 |
+
"outputs": [],
|
| 398 |
+
"source": [
|
| 399 |
+
"#print this instruction: amazon_beta_fe1.query('SKU == \"SET389-KR-NP-S\"') without index\n",
|
| 400 |
+
"#amazon_beta_fe1.query('SKU == \"SET389-KR-NP-S\"').head(3)"
|
| 401 |
+
]
|
| 402 |
+
},
|
| 403 |
+
{
|
| 404 |
+
"cell_type": "code",
|
| 405 |
+
"execution_count": 10,
|
| 406 |
+
"metadata": {},
|
| 407 |
+
"outputs": [],
|
| 408 |
+
"source": [
|
| 409 |
+
"amazon_beta_fe2 = fep.normalize_features(amazon_beta_fe1, 8, 15)"
|
| 410 |
+
]
|
| 411 |
+
},
|
| 412 |
+
{
|
| 413 |
+
"cell_type": "code",
|
| 414 |
+
"execution_count": null,
|
| 415 |
+
"metadata": {},
|
| 416 |
+
"outputs": [],
|
| 417 |
+
"source": [
|
| 418 |
+
"#amazon_beta_fe2.query('SKU == \"SET389-KR-NP-S\"').T"
|
| 419 |
+
]
|
| 420 |
+
},
|
| 421 |
+
{
|
| 422 |
+
"cell_type": "code",
|
| 423 |
+
"execution_count": 11,
|
| 424 |
+
"metadata": {},
|
| 425 |
+
"outputs": [],
|
| 426 |
+
"source": [
|
| 427 |
+
"amazon_beta_fe3 = fep.filter_stability_periods(amazon_beta_fe2, 7, 0.04)"
|
| 428 |
+
]
|
| 429 |
+
},
|
| 430 |
+
{
|
| 431 |
+
"cell_type": "code",
|
| 432 |
+
"execution_count": null,
|
| 433 |
+
"metadata": {},
|
| 434 |
+
"outputs": [],
|
| 435 |
+
"source": [
|
| 436 |
+
"# print without index amazon_beta_fe3.query('SKU == \"SET389-KR-NP-S\"') without index column\n",
|
| 437 |
+
"\n",
|
| 438 |
+
"\n",
|
| 439 |
+
"#amazon_beta_fe3[['Order ID', 'Date', 'SKU', 'price', 'sales','avg_price_last_7_days', 'price_variation']].query('SKU == \"SET389-KR-NP-S\"')\n",
|
| 440 |
+
"\n",
|
| 441 |
+
"\n",
|
| 442 |
+
"# NOTE: Still seeing repeated values in the \"price\" column. Either low the threshold or increase removal_percentage\n"
|
| 443 |
+
]
|
| 444 |
+
},
|
| 445 |
+
{
|
| 446 |
+
"cell_type": "code",
|
| 447 |
+
"execution_count": null,
|
| 448 |
+
"metadata": {},
|
| 449 |
+
"outputs": [],
|
| 450 |
+
"source": [
|
| 451 |
+
"\n",
|
| 452 |
+
"eda.missing_values_table(amazon_beta_fe3)"
|
| 453 |
+
]
|
| 454 |
+
},
|
| 455 |
+
{
|
| 456 |
+
"cell_type": "code",
|
| 457 |
+
"execution_count": null,
|
| 458 |
+
"metadata": {},
|
| 459 |
+
"outputs": [],
|
| 460 |
+
"source": [
|
| 461 |
+
"amazon_beta_fe3.head()"
|
| 462 |
+
]
|
| 463 |
+
},
|
| 464 |
+
{
|
| 465 |
+
"cell_type": "code",
|
| 466 |
+
"execution_count": 12,
|
| 467 |
+
"metadata": {},
|
| 468 |
+
"outputs": [],
|
| 469 |
+
"source": [
|
| 470 |
+
"# drop rows where price is null\n",
|
| 471 |
+
"amazon_beta_train = amazon_beta_fe3.dropna(subset=['price'])"
|
| 472 |
+
]
|
| 473 |
+
},
|
| 474 |
+
{
|
| 475 |
+
"cell_type": "code",
|
| 476 |
+
"execution_count": 13,
|
| 477 |
+
"metadata": {},
|
| 478 |
+
"outputs": [],
|
| 479 |
+
"source": [
|
| 480 |
+
"amazon_beta_train.fillna(0, inplace=True)"
|
| 481 |
+
]
|
| 482 |
+
},
|
| 483 |
+
{
|
| 484 |
+
"cell_type": "code",
|
| 485 |
+
"execution_count": 53,
|
| 486 |
+
"metadata": {},
|
| 487 |
+
"outputs": [],
|
| 488 |
+
"source": [
|
| 489 |
+
"amazon_beta_train1= fep.datetime_transform(amazon_beta_train, 'Date',['day_of_the_year', 'month', 'day_of_the_week'])"
|
| 490 |
+
]
|
| 491 |
+
},
|
| 492 |
+
{
|
| 493 |
+
"cell_type": "code",
|
| 494 |
+
"execution_count": 51,
|
| 495 |
+
"metadata": {},
|
| 496 |
+
"outputs": [
|
| 497 |
+
{
|
| 498 |
+
"data": {
|
| 499 |
+
"text/html": [
|
| 500 |
+
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #800000; text-decoration-color: #800000\">╭─────────────────────────────── </span><span style=\"color: #800000; text-decoration-color: #800000; font-weight: bold\">Traceback </span><span style=\"color: #bf7f7f; text-decoration-color: #bf7f7f; font-weight: bold\">(most recent call last)</span><span style=\"color: #800000; text-decoration-color: #800000\"> ────────────────────────────────╮</span>\n",
|
| 501 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">/var/folders/qd/2qwtnqg57r915dp6p3dq762c0000gn/T/ipykernel_10141/</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">2553612276.py</span>:<span style=\"color: #0000ff; text-decoration-color: #0000ff\">2</span> in <span style=\"color: #00ff00; text-decoration-color: #00ff00\"><cell line: </span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 502 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #00ff00; text-decoration-color: #00ff00\">2></span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 503 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 504 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 505 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/util/</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">_d</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 506 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">ecorators.py</span>:<span style=\"color: #0000ff; text-decoration-color: #0000ff\">311</span> in <span style=\"color: #00ff00; text-decoration-color: #00ff00\">wrapper</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 507 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 508 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">310 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ │ </span>) <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 509 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">❱ </span>311 <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span><span style=\"color: #0000ff; text-decoration-color: #0000ff\">return</span> func(*args, **kwargs) <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 510 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">312 </span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 511 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 512 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">fr</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 513 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">ame.py</span>:<span style=\"color: #0000ff; text-decoration-color: #0000ff\">4954</span> in <span style=\"color: #00ff00; text-decoration-color: #00ff00\">drop</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 514 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 515 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4953 </span><span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">│ │ </span><span style=\"color: #808000; text-decoration-color: #808000\">\"\"\"</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 516 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">❱ </span> 4954 <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ </span><span style=\"color: #0000ff; text-decoration-color: #0000ff\">return</span> <span style=\"color: #00ffff; text-decoration-color: #00ffff\">super</span>().drop( <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 517 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4955 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span>labels=labels, <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 518 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 519 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">ge</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 520 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">neric.py</span>:<span style=\"color: #0000ff; text-decoration-color: #0000ff\">4267</span> in <span style=\"color: #00ff00; text-decoration-color: #00ff00\">drop</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 521 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 522 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4266 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span><span style=\"color: #0000ff; text-decoration-color: #0000ff\">if</span> labels <span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">is</span> <span style=\"color: #ff00ff; text-decoration-color: #ff00ff\">not</span> <span style=\"color: #0000ff; text-decoration-color: #0000ff\">None</span>: <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 523 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">❱ </span> 4267 <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ │ </span>obj = obj._drop_axis(labels, axis, level=level, errors=errors) <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 524 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4268 </span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 525 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 526 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">ge</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 527 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">neric.py</span>:<span style=\"color: #0000ff; text-decoration-color: #0000ff\">4311</span> in <span style=\"color: #00ff00; text-decoration-color: #00ff00\">_drop_axis</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 528 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 529 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4310 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span><span style=\"color: #0000ff; text-decoration-color: #0000ff\">else</span>: <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 530 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">❱ </span> 4311 <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ │ </span>new_axis = axis.drop(labels, errors=errors) <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 531 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\"> 4312 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span>indexer = axis.get_indexer(new_axis) <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 532 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 533 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/in</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 534 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #bfbf7f; text-decoration-color: #bfbf7f\">dexes/</span><span style=\"color: #808000; text-decoration-color: #808000; font-weight: bold\">base.py</span>:<span style=\"color: #0000ff; text-decoration-color: #0000ff\">6644</span> in <span style=\"color: #00ff00; text-decoration-color: #00ff00\">drop</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 535 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 536 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">6643 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span><span style=\"color: #0000ff; text-decoration-color: #0000ff\">if</span> errors != <span style=\"color: #808000; text-decoration-color: #808000\">\"ignore\"</span>: <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 537 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #800000; text-decoration-color: #800000\">❱ </span>6644 <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ │ </span><span style=\"color: #0000ff; text-decoration-color: #0000ff\">raise</span> <span style=\"color: #00ffff; text-decoration-color: #00ffff\">KeyError</span>(<span style=\"color: #808000; text-decoration-color: #808000\">f\"{</span><span style=\"color: #00ffff; text-decoration-color: #00ffff\">list</span>(labels[mask])<span style=\"color: #808000; text-decoration-color: #808000\">} not found in axis\"</span>) <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 538 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">│</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">6645 </span><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">│ │ │ </span>indexer = indexer[~mask] <span style=\"color: #800000; text-decoration-color: #800000\">│</span>\n",
|
| 539 |
+
"<span style=\"color: #800000; text-decoration-color: #800000\">╰──────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
|
| 540 |
+
"<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-weight: bold\">KeyError: </span><span style=\"color: #008000; text-decoration-color: #008000\">\"['Order ID', 'price_variation', 'insufficient_data'] not found in axis\"</span>\n",
|
| 541 |
+
"</pre>\n"
|
| 542 |
+
],
|
| 543 |
+
"text/plain": [
|
| 544 |
+
"\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
|
| 545 |
+
"\u001b[31m│\u001b[0m \u001b[2;33m/var/folders/qd/2qwtnqg57r915dp6p3dq762c0000gn/T/ipykernel_10141/\u001b[0m\u001b[1;33m2553612276.py\u001b[0m:\u001b[94m2\u001b[0m in \u001b[92m<cell line: \u001b[0m \u001b[31m│\u001b[0m\n",
|
| 546 |
+
"\u001b[31m│\u001b[0m \u001b[92m2>\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 547 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 548 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 549 |
+
"\u001b[31m│\u001b[0m \u001b[2;33m/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/util/\u001b[0m\u001b[1;33m_d\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 550 |
+
"\u001b[31m│\u001b[0m \u001b[1;33mecorators.py\u001b[0m:\u001b[94m311\u001b[0m in \u001b[92mwrapper\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 551 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 552 |
+
"\u001b[31m│\u001b[0m \u001b[2m310 \u001b[0m\u001b[2m│ │ │ │ \u001b[0m) \u001b[31m│\u001b[0m\n",
|
| 553 |
+
"\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m311 \u001b[2m│ │ │ \u001b[0m\u001b[94mreturn\u001b[0m func(*args, **kwargs) \u001b[31m│\u001b[0m\n",
|
| 554 |
+
"\u001b[31m│\u001b[0m \u001b[2m312 \u001b[0m \u001b[31m│\u001b[0m\n",
|
| 555 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 556 |
+
"\u001b[31m│\u001b[0m \u001b[2;33m/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/\u001b[0m\u001b[1;33mfr\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 557 |
+
"\u001b[31m│\u001b[0m \u001b[1;33mame.py\u001b[0m:\u001b[94m4954\u001b[0m in \u001b[92mdrop\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 558 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 559 |
+
"\u001b[31m│\u001b[0m \u001b[2m 4953 \u001b[0m\u001b[2;33m│ │ \u001b[0m\u001b[33m\"\"\"\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 560 |
+
"\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 4954 \u001b[2m│ │ \u001b[0m\u001b[94mreturn\u001b[0m \u001b[96msuper\u001b[0m().drop( \u001b[31m│\u001b[0m\n",
|
| 561 |
+
"\u001b[31m│\u001b[0m \u001b[2m 4955 \u001b[0m\u001b[2m│ │ │ \u001b[0mlabels=labels, \u001b[31m│\u001b[0m\n",
|
| 562 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 563 |
+
"\u001b[31m│\u001b[0m \u001b[2;33m/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/\u001b[0m\u001b[1;33mge\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 564 |
+
"\u001b[31m│\u001b[0m \u001b[1;33mneric.py\u001b[0m:\u001b[94m4267\u001b[0m in \u001b[92mdrop\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 565 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 566 |
+
"\u001b[31m│\u001b[0m \u001b[2m 4266 \u001b[0m\u001b[2m│ │ │ \u001b[0m\u001b[94mif\u001b[0m labels \u001b[95mis\u001b[0m \u001b[95mnot\u001b[0m \u001b[94mNone\u001b[0m: \u001b[31m│\u001b[0m\n",
|
| 567 |
+
"\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 4267 \u001b[2m│ │ │ │ \u001b[0mobj = obj._drop_axis(labels, axis, level=level, errors=errors) \u001b[31m│\u001b[0m\n",
|
| 568 |
+
"\u001b[31m│\u001b[0m \u001b[2m 4268 \u001b[0m \u001b[31m│\u001b[0m\n",
|
| 569 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 570 |
+
"\u001b[31m│\u001b[0m \u001b[2;33m/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/\u001b[0m\u001b[1;33mge\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 571 |
+
"\u001b[31m│\u001b[0m \u001b[1;33mneric.py\u001b[0m:\u001b[94m4311\u001b[0m in \u001b[92m_drop_axis\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 572 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 573 |
+
"\u001b[31m│\u001b[0m \u001b[2m 4310 \u001b[0m\u001b[2m│ │ │ \u001b[0m\u001b[94melse\u001b[0m: \u001b[31m│\u001b[0m\n",
|
| 574 |
+
"\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 4311 \u001b[2m│ │ │ │ \u001b[0mnew_axis = axis.drop(labels, errors=errors) \u001b[31m│\u001b[0m\n",
|
| 575 |
+
"\u001b[31m│\u001b[0m \u001b[2m 4312 \u001b[0m\u001b[2m│ │ │ \u001b[0mindexer = axis.get_indexer(new_axis) \u001b[31m│\u001b[0m\n",
|
| 576 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 577 |
+
"\u001b[31m│\u001b[0m \u001b[2;33m/Users/servandodavidtorresgarcia/miniconda3/envs/relu/lib/python3.8/site-packages/pandas/core/in\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 578 |
+
"\u001b[31m│\u001b[0m \u001b[2;33mdexes/\u001b[0m\u001b[1;33mbase.py\u001b[0m:\u001b[94m6644\u001b[0m in \u001b[92mdrop\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 579 |
+
"\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
|
| 580 |
+
"\u001b[31m│\u001b[0m \u001b[2m6643 \u001b[0m\u001b[2m│ │ │ \u001b[0m\u001b[94mif\u001b[0m errors != \u001b[33m\"\u001b[0m\u001b[33mignore\u001b[0m\u001b[33m\"\u001b[0m: \u001b[31m│\u001b[0m\n",
|
| 581 |
+
"\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m6644 \u001b[2m│ │ │ │ \u001b[0m\u001b[94mraise\u001b[0m \u001b[96mKeyError\u001b[0m(\u001b[33mf\u001b[0m\u001b[33m\"\u001b[0m\u001b[33m{\u001b[0m\u001b[96mlist\u001b[0m(labels[mask])\u001b[33m}\u001b[0m\u001b[33m not found in axis\u001b[0m\u001b[33m\"\u001b[0m) \u001b[31m│\u001b[0m\n",
|
| 582 |
+
"\u001b[31m│\u001b[0m \u001b[2m6645 \u001b[0m\u001b[2m│ │ │ \u001b[0mindexer = indexer[~mask] \u001b[31m│\u001b[0m\n",
|
| 583 |
+
"\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
|
| 584 |
+
"\u001b[1;91mKeyError: \u001b[0m\u001b[32m\"\u001b[0m\u001b[32m[\u001b[0m\u001b[32m'Order ID', 'price_variation', 'insufficient_data'\u001b[0m\u001b[32m]\u001b[0m\u001b[32m not found in axis\"\u001b[0m\n"
|
| 585 |
+
]
|
| 586 |
+
},
|
| 587 |
+
"metadata": {},
|
| 588 |
+
"output_type": "display_data"
|
| 589 |
+
}
|
| 590 |
+
],
|
| 591 |
+
"source": [
|
| 592 |
+
"# Drop Order Id, price_variation, insufficient_data\n",
|
| 593 |
+
"amazon_beta_train1.drop(columns=['Order ID', 'price_variation', 'insufficient_data'], inplace=True)"
|
| 594 |
+
]
|
| 595 |
+
},
|
| 596 |
+
{
|
| 597 |
+
"cell_type": "code",
|
| 598 |
+
"execution_count": 55,
|
| 599 |
+
"metadata": {},
|
| 600 |
+
"outputs": [],
|
| 601 |
+
"source": [
|
| 602 |
+
"#amazon_beta_train1.head()\n",
|
| 603 |
+
"amazon_beta_train1.drop(columns=['Date_season'], inplace=True)"
|
| 604 |
+
]
|
| 605 |
+
},
|
| 606 |
+
{
|
| 607 |
+
"cell_type": "code",
|
| 608 |
+
"execution_count": 56,
|
| 609 |
+
"metadata": {},
|
| 610 |
+
"outputs": [
|
| 611 |
+
{
|
| 612 |
+
"name": "stdout",
|
| 613 |
+
"output_type": "stream",
|
| 614 |
+
"text": [
|
| 615 |
+
"Min Date: 2022-03-31 00:00:00, Max Date: 2022-06-29 00:00:00, Total Months: 3\n",
|
| 616 |
+
"Train data types:\n",
|
| 617 |
+
"Date datetime64[ns]\n",
|
| 618 |
+
"SKU object\n",
|
| 619 |
+
"Qty int64\n",
|
| 620 |
+
"price float64\n",
|
| 621 |
+
"sales int64\n",
|
| 622 |
+
"f_corr_1_1 float64\n",
|
| 623 |
+
"f_corr_1_2 float64\n",
|
| 624 |
+
"f_corr_2_1 float64\n",
|
| 625 |
+
"f_corr_2_2 float64\n",
|
| 626 |
+
"normalized_avg_price float64\n",
|
| 627 |
+
"normalized_avg_sales float64\n",
|
| 628 |
+
"normalized_log_avg_price float64\n",
|
| 629 |
+
"normalized_log_avg_sales float64\n",
|
| 630 |
+
"normalized_std_price float64\n",
|
| 631 |
+
"normalized_std_sales float64\n",
|
| 632 |
+
"avg_price_last_7_days float64\n",
|
| 633 |
+
"Date_month int64\n",
|
| 634 |
+
"Date_day_of_the_year int64\n",
|
| 635 |
+
"dtype: object\n",
|
| 636 |
+
"\n",
|
| 637 |
+
"Test data types:\n",
|
| 638 |
+
"Date datetime64[ns]\n",
|
| 639 |
+
"SKU object\n",
|
| 640 |
+
"Qty int64\n",
|
| 641 |
+
"price float64\n",
|
| 642 |
+
"sales int64\n",
|
| 643 |
+
"f_corr_1_1 float64\n",
|
| 644 |
+
"f_corr_1_2 float64\n",
|
| 645 |
+
"f_corr_2_1 float64\n",
|
| 646 |
+
"f_corr_2_2 float64\n",
|
| 647 |
+
"normalized_avg_price float64\n",
|
| 648 |
+
"normalized_avg_sales float64\n",
|
| 649 |
+
"normalized_log_avg_price float64\n",
|
| 650 |
+
"normalized_log_avg_sales float64\n",
|
| 651 |
+
"normalized_std_price float64\n",
|
| 652 |
+
"normalized_std_sales float64\n",
|
| 653 |
+
"avg_price_last_7_days float64\n",
|
| 654 |
+
"Date_month int64\n",
|
| 655 |
+
"Date_day_of_the_year int64\n",
|
| 656 |
+
"dtype: object\n"
|
| 657 |
+
]
|
| 658 |
+
}
|
| 659 |
+
],
|
| 660 |
+
"source": [
|
| 661 |
+
"from src.data.data_splitter import DataSplitter\n",
|
| 662 |
+
"\n",
|
| 663 |
+
"splitter = DataSplitter(amazon_beta_train1, train_months=1, test_weeks=2)\n",
|
| 664 |
+
"train, test = splitter.split_data()"
|
| 665 |
+
]
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
"cell_type": "code",
|
| 669 |
+
"execution_count": 18,
|
| 670 |
+
"metadata": {},
|
| 671 |
+
"outputs": [
|
| 672 |
+
{
|
| 673 |
+
"data": {
|
| 674 |
+
"text/plain": [
|
| 675 |
+
"(Timestamp('2022-03-31 00:00:00'),\n",
|
| 676 |
+
" Timestamp('2022-05-29 00:00:00'),\n",
|
| 677 |
+
" Timestamp('2022-05-30 00:00:00'),\n",
|
| 678 |
+
" Timestamp('2022-06-29 00:00:00'))"
|
| 679 |
+
]
|
| 680 |
+
},
|
| 681 |
+
"execution_count": 18,
|
| 682 |
+
"metadata": {},
|
| 683 |
+
"output_type": "execute_result"
|
| 684 |
+
}
|
| 685 |
+
],
|
| 686 |
+
"source": [
|
| 687 |
+
"train.shape, test.shape\n",
|
| 688 |
+
"# print min and max dates of train and test\n",
|
| 689 |
+
"train['Date'].min(), train['Date'].max(), test['Date'].min(), test['Date'].max()\n",
|
| 690 |
+
"# Min Date: 2022-03-31 00:00:00, Max Date: 2022-06-29 00:00:00, Total Months: 3"
|
| 691 |
+
]
|
| 692 |
+
},
|
| 693 |
+
{
|
| 694 |
+
"cell_type": "code",
|
| 695 |
+
"execution_count": 57,
|
| 696 |
+
"metadata": {},
|
| 697 |
+
"outputs": [],
|
| 698 |
+
"source": [
|
| 699 |
+
"# Drop Date column\n",
|
| 700 |
+
"train.drop(columns=['Date'], inplace=True)\n",
|
| 701 |
+
"test.drop(columns=['Date'], inplace=True)\n",
|
| 702 |
+
"# one hot encode Date_season\n",
|
| 703 |
+
"#train = pd.get_dummies(train, columns=['Date_season'])\n",
|
| 704 |
+
"#test = pd.get_dummies(test, columns=['Date_season'])"
|
| 705 |
+
]
|
| 706 |
+
},
|
| 707 |
+
{
|
| 708 |
+
"cell_type": "code",
|
| 709 |
+
"execution_count": null,
|
| 710 |
+
"metadata": {},
|
| 711 |
+
"outputs": [],
|
| 712 |
+
"source": [
|
| 713 |
+
"# Clean memory usage and delete dataframes that are not needed\n",
|
| 714 |
+
"#import gc\n",
|
| 715 |
+
"#del amazon, amazon_beta, amazon_beta_fe1, amazon_beta_fe2, amazon_beta_fe3, amazon_beta_train, amazon_beta_train1\n",
|
| 716 |
+
"#gc.collect()\n",
|
| 717 |
+
"\n"
|
| 718 |
+
]
|
| 719 |
+
},
|
| 720 |
+
{
|
| 721 |
+
"cell_type": "code",
|
| 722 |
+
"execution_count": 58,
|
| 723 |
+
"metadata": {},
|
| 724 |
+
"outputs": [],
|
| 725 |
+
"source": [
|
| 726 |
+
"# dump as pickel files train and test dataframes in the data/processed folder\n",
|
| 727 |
+
"train.to_pickle('../data/processed/train.pkl')\n",
|
| 728 |
+
"test.to_pickle('../data/processed/test.pkl')"
|
| 729 |
+
]
|
| 730 |
+
},
|
| 731 |
+
{
|
| 732 |
+
"cell_type": "code",
|
| 733 |
+
"execution_count": 38,
|
| 734 |
+
"metadata": {},
|
| 735 |
+
"outputs": [],
|
| 736 |
+
"source": [
|
| 737 |
+
"# load train and test pickle from the data/processed folder\n",
|
| 738 |
+
"train = pd.read_pickle('../data/processed/train.pkl')"
|
| 739 |
+
]
|
| 740 |
+
},
|
| 741 |
+
{
|
| 742 |
+
"cell_type": "code",
|
| 743 |
+
"execution_count": 40,
|
| 744 |
+
"metadata": {},
|
| 745 |
+
"outputs": [],
|
| 746 |
+
"source": [
|
| 747 |
+
"# load test pickle from the data/processed folder\n",
|
| 748 |
+
"test = pd.read_pickle('../data/processed/test.pkl')"
|
| 749 |
+
]
|
| 750 |
+
},
|
| 751 |
+
{
|
| 752 |
+
"cell_type": "code",
|
| 753 |
+
"execution_count": 42,
|
| 754 |
+
"metadata": {},
|
| 755 |
+
"outputs": [
|
| 756 |
+
{
|
| 757 |
+
"data": {
|
| 758 |
+
"text/plain": [
|
| 759 |
+
"Index(['SKU', 'Qty', 'price', 'sales', 'f_corr_1_1', 'f_corr_1_2',\n",
|
| 760 |
+
" 'f_corr_2_1', 'f_corr_2_2', 'normalized_avg_price',\n",
|
| 761 |
+
" 'normalized_avg_sales', 'normalized_log_avg_price',\n",
|
| 762 |
+
" 'normalized_log_avg_sales', 'normalized_std_price',\n",
|
| 763 |
+
" 'normalized_std_sales', 'avg_price_last_7_days', 'Date_month',\n",
|
| 764 |
+
" 'Date_day_of_the_year', 'Date_season_Spring'],\n",
|
| 765 |
+
" dtype='object')"
|
| 766 |
+
]
|
| 767 |
+
},
|
| 768 |
+
"execution_count": 42,
|
| 769 |
+
"metadata": {},
|
| 770 |
+
"output_type": "execute_result"
|
| 771 |
+
}
|
| 772 |
+
],
|
| 773 |
+
"source": [
|
| 774 |
+
"train.columns"
|
| 775 |
+
]
|
| 776 |
+
},
|
| 777 |
+
{
|
| 778 |
+
"cell_type": "code",
|
| 779 |
+
"execution_count": null,
|
| 780 |
+
"metadata": {},
|
| 781 |
+
"outputs": [],
|
| 782 |
+
"source": [
|
| 783 |
+
"import psutil\n",
|
| 784 |
+
"\n",
|
| 785 |
+
"# Get memory usage in bytes\n",
|
| 786 |
+
"memory_usage = psutil.virtual_memory()\n",
|
| 787 |
+
"total_memory = memory_usage.total\n",
|
| 788 |
+
"available_memory = memory_usage.available\n",
|
| 789 |
+
"used_memory = memory_usage.used\n",
|
| 790 |
+
"percent_memory_used = memory_usage.percent\n",
|
| 791 |
+
"\n",
|
| 792 |
+
"# Convert memory values to human-readable format\n",
|
| 793 |
+
"total_memory_readable = psutil._common.bytes2human(total_memory)\n",
|
| 794 |
+
"available_memory_readable = psutil._common.bytes2human(available_memory)\n",
|
| 795 |
+
"used_memory_readable = psutil._common.bytes2human(used_memory)\n",
|
| 796 |
+
"\n",
|
| 797 |
+
"# Print memory usage information\n",
|
| 798 |
+
"print(f\"Total Memory: {total_memory_readable}\")\n",
|
| 799 |
+
"print(f\"Available Memory: {available_memory_readable}\")\n",
|
| 800 |
+
"print(f\"Used Memory: {used_memory_readable}\")\n",
|
| 801 |
+
"print(f\"Percent Memory Used: {percent_memory_used}%\")\n"
|
| 802 |
+
]
|
| 803 |
+
},
|
| 804 |
+
{
|
| 805 |
+
"cell_type": "code",
|
| 806 |
+
"execution_count": null,
|
| 807 |
+
"metadata": {},
|
| 808 |
+
"outputs": [],
|
| 809 |
+
"source": [
|
| 810 |
+
"may = 467\n",
|
| 811 |
+
"june = 467\n",
|
| 812 |
+
"july = 497\n",
|
| 813 |
+
"august = 498\n",
|
| 814 |
+
"september = 515\n",
|
| 815 |
+
"october = 500\n",
|
| 816 |
+
"november = 515\n",
|
| 817 |
+
"december = 523\n",
|
| 818 |
+
"\n",
|
| 819 |
+
"# get total sum of sales for each month\n",
|
| 820 |
+
"\n",
|
| 821 |
+
"total_sales = may + june + july + august + september + october + november + december\n"
|
| 822 |
+
]
|
| 823 |
+
},
|
| 824 |
+
{
|
| 825 |
+
"cell_type": "code",
|
| 826 |
+
"execution_count": null,
|
| 827 |
+
"metadata": {},
|
| 828 |
+
"outputs": [],
|
| 829 |
+
"source": [
|
| 830 |
+
"import modal\n",
|
| 831 |
+
"\n",
|
| 832 |
+
"stub = modal.Stub(\"example-get-started\")\n",
|
| 833 |
+
"@stub.function()\n",
|
| 834 |
+
"def f():\n",
|
| 835 |
+
" return \"hello\"\n",
|
| 836 |
+
"\n",
|
| 837 |
+
"with stub.run():\n",
|
| 838 |
+
" assert \"hello\" == f.call() # remote call works ✔️\n",
|
| 839 |
+
" f() # raises error in notebook ⚠️"
|
| 840 |
+
]
|
| 841 |
+
},
|
| 842 |
+
{
|
| 843 |
+
"cell_type": "code",
|
| 844 |
+
"execution_count": 36,
|
| 845 |
+
"metadata": {},
|
| 846 |
+
"outputs": [
|
| 847 |
+
{
|
| 848 |
+
"data": {
|
| 849 |
+
"text/plain": [
|
| 850 |
+
"'1.4.2'"
|
| 851 |
+
]
|
| 852 |
+
},
|
| 853 |
+
"execution_count": 36,
|
| 854 |
+
"metadata": {},
|
| 855 |
+
"output_type": "execute_result"
|
| 856 |
+
}
|
| 857 |
+
],
|
| 858 |
+
"source": [
|
| 859 |
+
"#check version of pandas\n",
|
| 860 |
+
"pd.__version__"
|
| 861 |
+
]
|
| 862 |
+
},
|
| 863 |
+
{
|
| 864 |
+
"cell_type": "code",
|
| 865 |
+
"execution_count": 37,
|
| 866 |
+
"metadata": {},
|
| 867 |
+
"outputs": [
|
| 868 |
+
{
|
| 869 |
+
"data": {
|
| 870 |
+
"text/plain": [
|
| 871 |
+
"((43121, 18), (20316, 19))"
|
| 872 |
+
]
|
| 873 |
+
},
|
| 874 |
+
"execution_count": 37,
|
| 875 |
+
"metadata": {},
|
| 876 |
+
"output_type": "execute_result"
|
| 877 |
+
}
|
| 878 |
+
],
|
| 879 |
+
"source": [
|
| 880 |
+
"train.shape, test.shape"
|
| 881 |
+
]
|
| 882 |
+
},
|
| 883 |
+
{
|
| 884 |
+
"cell_type": "code",
|
| 885 |
+
"execution_count": 45,
|
| 886 |
+
"metadata": {},
|
| 887 |
+
"outputs": [
|
| 888 |
+
{
|
| 889 |
+
"data": {
|
| 890 |
+
"text/plain": [
|
| 891 |
+
"Index(['SKU', 'Qty', 'price', 'sales', 'f_corr_1_1', 'f_corr_1_2',\n",
|
| 892 |
+
" 'f_corr_2_1', 'f_corr_2_2', 'normalized_avg_price',\n",
|
| 893 |
+
" 'normalized_avg_sales', 'normalized_log_avg_price',\n",
|
| 894 |
+
" 'normalized_log_avg_sales', 'normalized_std_price',\n",
|
| 895 |
+
" 'normalized_std_sales', 'avg_price_last_7_days', 'Date_month',\n",
|
| 896 |
+
" 'Date_day_of_the_year', 'Date_season_Spring', 'Date_season_Summer'],\n",
|
| 897 |
+
" dtype='object')"
|
| 898 |
+
]
|
| 899 |
+
},
|
| 900 |
+
"execution_count": 45,
|
| 901 |
+
"metadata": {},
|
| 902 |
+
"output_type": "execute_result"
|
| 903 |
+
}
|
| 904 |
+
],
|
| 905 |
+
"source": [
|
| 906 |
+
"test.columns"
|
| 907 |
+
]
|
| 908 |
+
},
|
| 909 |
+
{
|
| 910 |
+
"cell_type": "code",
|
| 911 |
+
"execution_count": 49,
|
| 912 |
+
"metadata": {},
|
| 913 |
+
"outputs": [
|
| 914 |
+
{
|
| 915 |
+
"data": {
|
| 916 |
+
"text/plain": [
|
| 917 |
+
"Index(['SKU', 'Qty', 'price', 'sales', 'f_corr_1_1', 'f_corr_1_2',\n",
|
| 918 |
+
" 'f_corr_2_1', 'f_corr_2_2', 'normalized_avg_price',\n",
|
| 919 |
+
" 'normalized_avg_sales', 'normalized_log_avg_price',\n",
|
| 920 |
+
" 'normalized_log_avg_sales', 'normalized_std_price',\n",
|
| 921 |
+
" 'normalized_std_sales', 'avg_price_last_7_days', 'Date_month',\n",
|
| 922 |
+
" 'Date_day_of_the_year', 'Date_season_Spring'],\n",
|
| 923 |
+
" dtype='object')"
|
| 924 |
+
]
|
| 925 |
+
},
|
| 926 |
+
"execution_count": 49,
|
| 927 |
+
"metadata": {},
|
| 928 |
+
"output_type": "execute_result"
|
| 929 |
+
}
|
| 930 |
+
],
|
| 931 |
+
"source": [
|
| 932 |
+
"train.columns"
|
| 933 |
+
]
|
| 934 |
+
},
|
| 935 |
+
{
|
| 936 |
+
"cell_type": "code",
|
| 937 |
+
"execution_count": 48,
|
| 938 |
+
"metadata": {},
|
| 939 |
+
"outputs": [
|
| 940 |
+
{
|
| 941 |
+
"data": {
|
| 942 |
+
"text/plain": [
|
| 943 |
+
"(20316, 19)"
|
| 944 |
+
]
|
| 945 |
+
},
|
| 946 |
+
"execution_count": 48,
|
| 947 |
+
"metadata": {},
|
| 948 |
+
"output_type": "execute_result"
|
| 949 |
+
}
|
| 950 |
+
],
|
| 951 |
+
"source": [
|
| 952 |
+
"test.shape"
|
| 953 |
+
]
|
| 954 |
+
},
|
| 955 |
+
{
|
| 956 |
+
"cell_type": "code",
|
| 957 |
+
"execution_count": null,
|
| 958 |
+
"metadata": {},
|
| 959 |
+
"outputs": [],
|
| 960 |
+
"source": []
|
| 961 |
+
}
|
| 962 |
+
],
|
| 963 |
+
"metadata": {
|
| 964 |
+
"kernelspec": {
|
| 965 |
+
"display_name": "relu",
|
| 966 |
+
"language": "python",
|
| 967 |
+
"name": "python3"
|
| 968 |
+
},
|
| 969 |
+
"language_info": {
|
| 970 |
+
"codemirror_mode": {
|
| 971 |
+
"name": "ipython",
|
| 972 |
+
"version": 3
|
| 973 |
+
},
|
| 974 |
+
"file_extension": ".py",
|
| 975 |
+
"mimetype": "text/x-python",
|
| 976 |
+
"name": "python",
|
| 977 |
+
"nbconvert_exporter": "python",
|
| 978 |
+
"pygments_lexer": "ipython3",
|
| 979 |
+
"version": "3.8.16"
|
| 980 |
+
},
|
| 981 |
+
"orig_nbformat": 4
|
| 982 |
+
},
|
| 983 |
+
"nbformat": 4,
|
| 984 |
+
"nbformat_minor": 2
|
| 985 |
+
}
|
notebooks/amazon_sales_v2.ipynb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:041d1ad8cf5ec6736bd2f40ad36aa81f90c52af0446daebfb03c43c5464ca3b1
|
| 3 |
+
size 15130091
|
notebooks/dashboard.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/data.ipynb
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
notebooks/fake_data_v0.ipynb
ADDED
|
@@ -0,0 +1,1144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"%autoreload 2\n"
|
| 11 |
+
]
|
| 12 |
+
},
|
| 13 |
+
{
|
| 14 |
+
"cell_type": "code",
|
| 15 |
+
"execution_count": 17,
|
| 16 |
+
"metadata": {},
|
| 17 |
+
"outputs": [],
|
| 18 |
+
"source": [
|
| 19 |
+
"import pandas as pd\n",
|
| 20 |
+
"import numpy as np\n",
|
| 21 |
+
"def generate_synthetic_data(n=1000):\n",
|
| 22 |
+
"\n",
|
| 23 |
+
"\n",
|
| 24 |
+
" # Set a seed for reproducibility\n",
|
| 25 |
+
" np.random.seed(42)\n",
|
| 26 |
+
"\n",
|
| 27 |
+
" # Dates ranging over a year\n",
|
| 28 |
+
" dates = pd.date_range(start='2022-01-01', periods=n)\n",
|
| 29 |
+
"\n",
|
| 30 |
+
" # Product categories\n",
|
| 31 |
+
" categories = ['Electronics', 'Furniture', 'Grocery', 'Clothing']\n",
|
| 32 |
+
" product_categories = np.random.choice(categories, n)\n",
|
| 33 |
+
"\n",
|
| 34 |
+
" # Products and SKUs\n",
|
| 35 |
+
" products = [f'Product_{i}' for i in range(1, 51)] # 50 products\n",
|
| 36 |
+
" product_list = np.random.choice(products, n)\n",
|
| 37 |
+
" SKUs = [f'SKU_{i}' for i in range(1, 51)] # 50 SKUs\n",
|
| 38 |
+
" sku_list = np.random.choice(SKUs, n)\n",
|
| 39 |
+
"\n",
|
| 40 |
+
" # Prices normally distributed and positive\n",
|
| 41 |
+
" prices = np.abs(np.random.normal(loc=100, scale=20, size=n))\n",
|
| 42 |
+
"\n",
|
| 43 |
+
" # Quantity sold - we assume that it's a Poisson distribution\n",
|
| 44 |
+
" quantity = np.random.poisson(lam=10, size=n)\n",
|
| 45 |
+
"\n",
|
| 46 |
+
" # Competitor's price - usually it would be around the actual product price\n",
|
| 47 |
+
" competitor_prices = prices + np.random.normal(loc=0, scale=10, size=n)\n",
|
| 48 |
+
"\n",
|
| 49 |
+
" # Discounts\n",
|
| 50 |
+
" discounts = np.random.choice([0, 5, 10, 15, 20], size=n) # in percentage\n",
|
| 51 |
+
"\n",
|
| 52 |
+
" # Create a dataframe\n",
|
| 53 |
+
" df = pd.DataFrame({\n",
|
| 54 |
+
" 'date': dates,\n",
|
| 55 |
+
" 'product': product_list,\n",
|
| 56 |
+
" 'SKU': sku_list,\n",
|
| 57 |
+
" 'category': product_categories,\n",
|
| 58 |
+
" 'price': prices,\n",
|
| 59 |
+
" 'quantity': quantity,\n",
|
| 60 |
+
" 'competitor_price': competitor_prices,\n",
|
| 61 |
+
" 'discount': discounts\n",
|
| 62 |
+
" })\n",
|
| 63 |
+
"\n",
|
| 64 |
+
" # Black Friday dates\n",
|
| 65 |
+
" df['black_friday_date'] = pd.to_datetime(['2022-11-25' if date.month >= 11 else '2023-11-24' for date in df['date']])\n",
|
| 66 |
+
"\n",
|
| 67 |
+
" # Additional fields for feature engineering\n",
|
| 68 |
+
" df['views'] = np.random.randint(0, 100, size=n)\n",
|
| 69 |
+
" df['clicks'] = np.random.randint(0, 50, size=n)\n",
|
| 70 |
+
" df['favorites'] = np.random.randint(0, 20, size=n)\n",
|
| 71 |
+
" df['buys'] = np.random.randint(0, 10, size=n)\n",
|
| 72 |
+
" \n",
|
| 73 |
+
"\n",
|
| 74 |
+
" #df.to_csv('synthetic_data.csv', index=False)\n",
|
| 75 |
+
" print(f\"Synthetic data of size {n} generated and saved to 'synthetic_data.csv'\")\n",
|
| 76 |
+
"\n",
|
| 77 |
+
" return df\n",
|
| 78 |
+
"\n",
|
| 79 |
+
"# Call the function with a custom size\n",
|
| 80 |
+
"\n"
|
| 81 |
+
]
|
| 82 |
+
},
|
| 83 |
+
{
|
| 84 |
+
"cell_type": "code",
|
| 85 |
+
"execution_count": null,
|
| 86 |
+
"metadata": {},
|
| 87 |
+
"outputs": [],
|
| 88 |
+
"source": []
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"cell_type": "code",
|
| 92 |
+
"execution_count": 22,
|
| 93 |
+
"metadata": {},
|
| 94 |
+
"outputs": [
|
| 95 |
+
{
|
| 96 |
+
"name": "stdout",
|
| 97 |
+
"output_type": "stream",
|
| 98 |
+
"text": [
|
| 99 |
+
"Synthetic data of size 500 generated and saved to 'synthetic_data.csv'\n"
|
| 100 |
+
]
|
| 101 |
+
}
|
| 102 |
+
],
|
| 103 |
+
"source": [
|
| 104 |
+
"df = generate_synthetic_data(n=500)"
|
| 105 |
+
]
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"cell_type": "code",
|
| 109 |
+
"execution_count": 4,
|
| 110 |
+
"metadata": {},
|
| 111 |
+
"outputs": [
|
| 112 |
+
{
|
| 113 |
+
"data": {
|
| 114 |
+
"text/html": [
|
| 115 |
+
"<div>\n",
|
| 116 |
+
"<style scoped>\n",
|
| 117 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 118 |
+
" vertical-align: middle;\n",
|
| 119 |
+
" }\n",
|
| 120 |
+
"\n",
|
| 121 |
+
" .dataframe tbody tr th {\n",
|
| 122 |
+
" vertical-align: top;\n",
|
| 123 |
+
" }\n",
|
| 124 |
+
"\n",
|
| 125 |
+
" .dataframe thead th {\n",
|
| 126 |
+
" text-align: right;\n",
|
| 127 |
+
" }\n",
|
| 128 |
+
"</style>\n",
|
| 129 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 130 |
+
" <thead>\n",
|
| 131 |
+
" <tr style=\"text-align: right;\">\n",
|
| 132 |
+
" <th></th>\n",
|
| 133 |
+
" <th>date</th>\n",
|
| 134 |
+
" <th>product</th>\n",
|
| 135 |
+
" <th>SKU</th>\n",
|
| 136 |
+
" <th>category</th>\n",
|
| 137 |
+
" <th>price</th>\n",
|
| 138 |
+
" <th>quantity</th>\n",
|
| 139 |
+
" <th>competitor_price</th>\n",
|
| 140 |
+
" <th>discount</th>\n",
|
| 141 |
+
" <th>black_friday_date</th>\n",
|
| 142 |
+
" <th>views</th>\n",
|
| 143 |
+
" <th>clicks</th>\n",
|
| 144 |
+
" <th>favorites</th>\n",
|
| 145 |
+
" <th>buys</th>\n",
|
| 146 |
+
" </tr>\n",
|
| 147 |
+
" </thead>\n",
|
| 148 |
+
" <tbody>\n",
|
| 149 |
+
" <tr>\n",
|
| 150 |
+
" <th>0</th>\n",
|
| 151 |
+
" <td>2022-01-01</td>\n",
|
| 152 |
+
" <td>Product_21</td>\n",
|
| 153 |
+
" <td>SKU_34</td>\n",
|
| 154 |
+
" <td>Grocery</td>\n",
|
| 155 |
+
" <td>127.347405</td>\n",
|
| 156 |
+
" <td>15</td>\n",
|
| 157 |
+
" <td>126.257644</td>\n",
|
| 158 |
+
" <td>0</td>\n",
|
| 159 |
+
" <td>2023-11-24</td>\n",
|
| 160 |
+
" <td>57</td>\n",
|
| 161 |
+
" <td>29</td>\n",
|
| 162 |
+
" <td>6</td>\n",
|
| 163 |
+
" <td>7</td>\n",
|
| 164 |
+
" </tr>\n",
|
| 165 |
+
" <tr>\n",
|
| 166 |
+
" <th>1</th>\n",
|
| 167 |
+
" <td>2022-01-02</td>\n",
|
| 168 |
+
" <td>Product_32</td>\n",
|
| 169 |
+
" <td>SKU_6</td>\n",
|
| 170 |
+
" <td>Clothing</td>\n",
|
| 171 |
+
" <td>119.165077</td>\n",
|
| 172 |
+
" <td>5</td>\n",
|
| 173 |
+
" <td>129.504709</td>\n",
|
| 174 |
+
" <td>5</td>\n",
|
| 175 |
+
" <td>2023-11-24</td>\n",
|
| 176 |
+
" <td>93</td>\n",
|
| 177 |
+
" <td>27</td>\n",
|
| 178 |
+
" <td>7</td>\n",
|
| 179 |
+
" <td>1</td>\n",
|
| 180 |
+
" </tr>\n",
|
| 181 |
+
" <tr>\n",
|
| 182 |
+
" <th>2</th>\n",
|
| 183 |
+
" <td>2022-01-03</td>\n",
|
| 184 |
+
" <td>Product_23</td>\n",
|
| 185 |
+
" <td>SKU_2</td>\n",
|
| 186 |
+
" <td>Electronics</td>\n",
|
| 187 |
+
" <td>104.545228</td>\n",
|
| 188 |
+
" <td>9</td>\n",
|
| 189 |
+
" <td>98.015648</td>\n",
|
| 190 |
+
" <td>20</td>\n",
|
| 191 |
+
" <td>2023-11-24</td>\n",
|
| 192 |
+
" <td>40</td>\n",
|
| 193 |
+
" <td>16</td>\n",
|
| 194 |
+
" <td>6</td>\n",
|
| 195 |
+
" <td>3</td>\n",
|
| 196 |
+
" </tr>\n",
|
| 197 |
+
" <tr>\n",
|
| 198 |
+
" <th>3</th>\n",
|
| 199 |
+
" <td>2022-01-04</td>\n",
|
| 200 |
+
" <td>Product_33</td>\n",
|
| 201 |
+
" <td>SKU_13</td>\n",
|
| 202 |
+
" <td>Grocery</td>\n",
|
| 203 |
+
" <td>114.959609</td>\n",
|
| 204 |
+
" <td>5</td>\n",
|
| 205 |
+
" <td>127.093423</td>\n",
|
| 206 |
+
" <td>10</td>\n",
|
| 207 |
+
" <td>2023-11-24</td>\n",
|
| 208 |
+
" <td>24</td>\n",
|
| 209 |
+
" <td>2</td>\n",
|
| 210 |
+
" <td>13</td>\n",
|
| 211 |
+
" <td>2</td>\n",
|
| 212 |
+
" </tr>\n",
|
| 213 |
+
" <tr>\n",
|
| 214 |
+
" <th>4</th>\n",
|
| 215 |
+
" <td>2022-01-05</td>\n",
|
| 216 |
+
" <td>Product_3</td>\n",
|
| 217 |
+
" <td>SKU_43</td>\n",
|
| 218 |
+
" <td>Grocery</td>\n",
|
| 219 |
+
" <td>120.102043</td>\n",
|
| 220 |
+
" <td>11</td>\n",
|
| 221 |
+
" <td>120.733836</td>\n",
|
| 222 |
+
" <td>10</td>\n",
|
| 223 |
+
" <td>2023-11-24</td>\n",
|
| 224 |
+
" <td>77</td>\n",
|
| 225 |
+
" <td>15</td>\n",
|
| 226 |
+
" <td>18</td>\n",
|
| 227 |
+
" <td>1</td>\n",
|
| 228 |
+
" </tr>\n",
|
| 229 |
+
" </tbody>\n",
|
| 230 |
+
"</table>\n",
|
| 231 |
+
"</div>"
|
| 232 |
+
],
|
| 233 |
+
"text/plain": [
|
| 234 |
+
" date product SKU category price quantity \\\n",
|
| 235 |
+
"0 2022-01-01 Product_21 SKU_34 Grocery 127.347405 15 \n",
|
| 236 |
+
"1 2022-01-02 Product_32 SKU_6 Clothing 119.165077 5 \n",
|
| 237 |
+
"2 2022-01-03 Product_23 SKU_2 Electronics 104.545228 9 \n",
|
| 238 |
+
"3 2022-01-04 Product_33 SKU_13 Grocery 114.959609 5 \n",
|
| 239 |
+
"4 2022-01-05 Product_3 SKU_43 Grocery 120.102043 11 \n",
|
| 240 |
+
"\n",
|
| 241 |
+
" competitor_price discount black_friday_date views clicks favorites \\\n",
|
| 242 |
+
"0 126.257644 0 2023-11-24 57 29 6 \n",
|
| 243 |
+
"1 129.504709 5 2023-11-24 93 27 7 \n",
|
| 244 |
+
"2 98.015648 20 2023-11-24 40 16 6 \n",
|
| 245 |
+
"3 127.093423 10 2023-11-24 24 2 13 \n",
|
| 246 |
+
"4 120.733836 10 2023-11-24 77 15 18 \n",
|
| 247 |
+
"\n",
|
| 248 |
+
" buys \n",
|
| 249 |
+
"0 7 \n",
|
| 250 |
+
"1 1 \n",
|
| 251 |
+
"2 3 \n",
|
| 252 |
+
"3 2 \n",
|
| 253 |
+
"4 1 "
|
| 254 |
+
]
|
| 255 |
+
},
|
| 256 |
+
"execution_count": 4,
|
| 257 |
+
"metadata": {},
|
| 258 |
+
"output_type": "execute_result"
|
| 259 |
+
}
|
| 260 |
+
],
|
| 261 |
+
"source": [
|
| 262 |
+
"df.head()\n"
|
| 263 |
+
]
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"cell_type": "code",
|
| 267 |
+
"execution_count": 18,
|
| 268 |
+
"metadata": {},
|
| 269 |
+
"outputs": [],
|
| 270 |
+
"source": [
|
| 271 |
+
"import sys\n",
|
| 272 |
+
"sys.path.append('../src')"
|
| 273 |
+
]
|
| 274 |
+
},
|
| 275 |
+
{
|
| 276 |
+
"cell_type": "code",
|
| 277 |
+
"execution_count": 39,
|
| 278 |
+
"metadata": {},
|
| 279 |
+
"outputs": [],
|
| 280 |
+
"source": [
|
| 281 |
+
"from data.feature_engineering import FeatureEngineeringProcess\n"
|
| 282 |
+
]
|
| 283 |
+
},
|
| 284 |
+
{
|
| 285 |
+
"cell_type": "code",
|
| 286 |
+
"execution_count": 7,
|
| 287 |
+
"metadata": {},
|
| 288 |
+
"outputs": [
|
| 289 |
+
{
|
| 290 |
+
"name": "stdout",
|
| 291 |
+
"output_type": "stream",
|
| 292 |
+
"text": [
|
| 293 |
+
"updated ___\n"
|
| 294 |
+
]
|
| 295 |
+
}
|
| 296 |
+
],
|
| 297 |
+
"source": [
|
| 298 |
+
"#date_fe = FeatureEngineeringProcess.datetime_transform\n",
|
| 299 |
+
"feature_engineering = FeatureEngineeringProcess()\n",
|
| 300 |
+
"df = feature_engineering.datetime_transform(df, date_feature='date', \n",
|
| 301 |
+
" features=['month', 'day', 'day_name', 'week', 'year',\n",
|
| 302 |
+
" 'quarter', 'season','holidays'],\n",
|
| 303 |
+
" )"
|
| 304 |
+
]
|
| 305 |
+
},
|
| 306 |
+
{
|
| 307 |
+
"cell_type": "code",
|
| 308 |
+
"execution_count": null,
|
| 309 |
+
"metadata": {},
|
| 310 |
+
"outputs": [],
|
| 311 |
+
"source": [
|
| 312 |
+
"df.head()"
|
| 313 |
+
]
|
| 314 |
+
},
|
| 315 |
+
{
|
| 316 |
+
"cell_type": "code",
|
| 317 |
+
"execution_count": null,
|
| 318 |
+
"metadata": {},
|
| 319 |
+
"outputs": [],
|
| 320 |
+
"source": [
|
| 321 |
+
"df.date_holidays.value_counts()"
|
| 322 |
+
]
|
| 323 |
+
},
|
| 324 |
+
{
|
| 325 |
+
"cell_type": "code",
|
| 326 |
+
"execution_count": null,
|
| 327 |
+
"metadata": {},
|
| 328 |
+
"outputs": [],
|
| 329 |
+
"source": [
|
| 330 |
+
"from datetime import date\n",
|
| 331 |
+
"import holidays\n",
|
| 332 |
+
"\n",
|
| 333 |
+
"us_holidays = holidays.US() # this is a dict\n",
|
| 334 |
+
"# the below is the same, but takes a string:\n",
|
| 335 |
+
"us_holidays = holidays.country_holidays('US') # this is a dict\n",
|
| 336 |
+
"\n",
|
| 337 |
+
"\n",
|
| 338 |
+
"\n",
|
| 339 |
+
"date(2015, 1, 1) in us_holidays # True\n",
|
| 340 |
+
"date(2015, 1, 2) in us_holidays # False\n",
|
| 341 |
+
"us_holidays.get('2014-01-01') # \"New Year's Day\""
|
| 342 |
+
]
|
| 343 |
+
},
|
| 344 |
+
{
|
| 345 |
+
"cell_type": "code",
|
| 346 |
+
"execution_count": null,
|
| 347 |
+
"metadata": {},
|
| 348 |
+
"outputs": [],
|
| 349 |
+
"source": [
|
| 350 |
+
"holidays.CountryHoliday('PL', years=2022).keys()"
|
| 351 |
+
]
|
| 352 |
+
},
|
| 353 |
+
{
|
| 354 |
+
"cell_type": "code",
|
| 355 |
+
"execution_count": null,
|
| 356 |
+
"metadata": {},
|
| 357 |
+
"outputs": [],
|
| 358 |
+
"source": [
|
| 359 |
+
"print(df.head())"
|
| 360 |
+
]
|
| 361 |
+
},
|
| 362 |
+
{
|
| 363 |
+
"cell_type": "code",
|
| 364 |
+
"execution_count": 40,
|
| 365 |
+
"metadata": {},
|
| 366 |
+
"outputs": [],
|
| 367 |
+
"source": [
|
| 368 |
+
"feature_engineering = FeatureEngineeringProcess()"
|
| 369 |
+
]
|
| 370 |
+
},
|
| 371 |
+
{
|
| 372 |
+
"cell_type": "code",
|
| 373 |
+
"execution_count": 24,
|
| 374 |
+
"metadata": {},
|
| 375 |
+
"outputs": [
|
| 376 |
+
{
|
| 377 |
+
"data": {
|
| 378 |
+
"text/html": [
|
| 379 |
+
"<div>\n",
|
| 380 |
+
"<style scoped>\n",
|
| 381 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 382 |
+
" vertical-align: middle;\n",
|
| 383 |
+
" }\n",
|
| 384 |
+
"\n",
|
| 385 |
+
" .dataframe tbody tr th {\n",
|
| 386 |
+
" vertical-align: top;\n",
|
| 387 |
+
" }\n",
|
| 388 |
+
"\n",
|
| 389 |
+
" .dataframe thead th {\n",
|
| 390 |
+
" text-align: right;\n",
|
| 391 |
+
" }\n",
|
| 392 |
+
"</style>\n",
|
| 393 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 394 |
+
" <thead>\n",
|
| 395 |
+
" <tr style=\"text-align: right;\">\n",
|
| 396 |
+
" <th></th>\n",
|
| 397 |
+
" <th>date</th>\n",
|
| 398 |
+
" <th>product</th>\n",
|
| 399 |
+
" <th>SKU</th>\n",
|
| 400 |
+
" <th>category</th>\n",
|
| 401 |
+
" <th>price</th>\n",
|
| 402 |
+
" <th>quantity</th>\n",
|
| 403 |
+
" <th>competitor_price</th>\n",
|
| 404 |
+
" <th>discount</th>\n",
|
| 405 |
+
" <th>black_friday_date</th>\n",
|
| 406 |
+
" <th>views</th>\n",
|
| 407 |
+
" <th>clicks</th>\n",
|
| 408 |
+
" <th>favorites</th>\n",
|
| 409 |
+
" <th>buys</th>\n",
|
| 410 |
+
" </tr>\n",
|
| 411 |
+
" </thead>\n",
|
| 412 |
+
" <tbody>\n",
|
| 413 |
+
" <tr>\n",
|
| 414 |
+
" <th>0</th>\n",
|
| 415 |
+
" <td>2022-01-01</td>\n",
|
| 416 |
+
" <td>Product_21</td>\n",
|
| 417 |
+
" <td>SKU_34</td>\n",
|
| 418 |
+
" <td>Grocery</td>\n",
|
| 419 |
+
" <td>127.347405</td>\n",
|
| 420 |
+
" <td>15</td>\n",
|
| 421 |
+
" <td>126.257644</td>\n",
|
| 422 |
+
" <td>0</td>\n",
|
| 423 |
+
" <td>2023-11-24</td>\n",
|
| 424 |
+
" <td>57</td>\n",
|
| 425 |
+
" <td>29</td>\n",
|
| 426 |
+
" <td>6</td>\n",
|
| 427 |
+
" <td>7</td>\n",
|
| 428 |
+
" </tr>\n",
|
| 429 |
+
" <tr>\n",
|
| 430 |
+
" <th>1</th>\n",
|
| 431 |
+
" <td>2022-01-02</td>\n",
|
| 432 |
+
" <td>Product_32</td>\n",
|
| 433 |
+
" <td>SKU_6</td>\n",
|
| 434 |
+
" <td>Clothing</td>\n",
|
| 435 |
+
" <td>119.165077</td>\n",
|
| 436 |
+
" <td>5</td>\n",
|
| 437 |
+
" <td>129.504709</td>\n",
|
| 438 |
+
" <td>5</td>\n",
|
| 439 |
+
" <td>2023-11-24</td>\n",
|
| 440 |
+
" <td>93</td>\n",
|
| 441 |
+
" <td>27</td>\n",
|
| 442 |
+
" <td>7</td>\n",
|
| 443 |
+
" <td>1</td>\n",
|
| 444 |
+
" </tr>\n",
|
| 445 |
+
" <tr>\n",
|
| 446 |
+
" <th>2</th>\n",
|
| 447 |
+
" <td>2022-01-03</td>\n",
|
| 448 |
+
" <td>Product_23</td>\n",
|
| 449 |
+
" <td>SKU_2</td>\n",
|
| 450 |
+
" <td>Electronics</td>\n",
|
| 451 |
+
" <td>104.545228</td>\n",
|
| 452 |
+
" <td>9</td>\n",
|
| 453 |
+
" <td>98.015648</td>\n",
|
| 454 |
+
" <td>20</td>\n",
|
| 455 |
+
" <td>2023-11-24</td>\n",
|
| 456 |
+
" <td>40</td>\n",
|
| 457 |
+
" <td>16</td>\n",
|
| 458 |
+
" <td>6</td>\n",
|
| 459 |
+
" <td>3</td>\n",
|
| 460 |
+
" </tr>\n",
|
| 461 |
+
" <tr>\n",
|
| 462 |
+
" <th>3</th>\n",
|
| 463 |
+
" <td>2022-01-04</td>\n",
|
| 464 |
+
" <td>Product_33</td>\n",
|
| 465 |
+
" <td>SKU_13</td>\n",
|
| 466 |
+
" <td>Grocery</td>\n",
|
| 467 |
+
" <td>114.959609</td>\n",
|
| 468 |
+
" <td>5</td>\n",
|
| 469 |
+
" <td>127.093423</td>\n",
|
| 470 |
+
" <td>10</td>\n",
|
| 471 |
+
" <td>2023-11-24</td>\n",
|
| 472 |
+
" <td>24</td>\n",
|
| 473 |
+
" <td>2</td>\n",
|
| 474 |
+
" <td>13</td>\n",
|
| 475 |
+
" <td>2</td>\n",
|
| 476 |
+
" </tr>\n",
|
| 477 |
+
" <tr>\n",
|
| 478 |
+
" <th>4</th>\n",
|
| 479 |
+
" <td>2022-01-05</td>\n",
|
| 480 |
+
" <td>Product_3</td>\n",
|
| 481 |
+
" <td>SKU_43</td>\n",
|
| 482 |
+
" <td>Grocery</td>\n",
|
| 483 |
+
" <td>120.102043</td>\n",
|
| 484 |
+
" <td>11</td>\n",
|
| 485 |
+
" <td>120.733836</td>\n",
|
| 486 |
+
" <td>10</td>\n",
|
| 487 |
+
" <td>2023-11-24</td>\n",
|
| 488 |
+
" <td>77</td>\n",
|
| 489 |
+
" <td>15</td>\n",
|
| 490 |
+
" <td>18</td>\n",
|
| 491 |
+
" <td>1</td>\n",
|
| 492 |
+
" </tr>\n",
|
| 493 |
+
" </tbody>\n",
|
| 494 |
+
"</table>\n",
|
| 495 |
+
"</div>"
|
| 496 |
+
],
|
| 497 |
+
"text/plain": [
|
| 498 |
+
" date product SKU category price quantity \\\n",
|
| 499 |
+
"0 2022-01-01 Product_21 SKU_34 Grocery 127.347405 15 \n",
|
| 500 |
+
"1 2022-01-02 Product_32 SKU_6 Clothing 119.165077 5 \n",
|
| 501 |
+
"2 2022-01-03 Product_23 SKU_2 Electronics 104.545228 9 \n",
|
| 502 |
+
"3 2022-01-04 Product_33 SKU_13 Grocery 114.959609 5 \n",
|
| 503 |
+
"4 2022-01-05 Product_3 SKU_43 Grocery 120.102043 11 \n",
|
| 504 |
+
"\n",
|
| 505 |
+
" competitor_price discount black_friday_date views clicks favorites \\\n",
|
| 506 |
+
"0 126.257644 0 2023-11-24 57 29 6 \n",
|
| 507 |
+
"1 129.504709 5 2023-11-24 93 27 7 \n",
|
| 508 |
+
"2 98.015648 20 2023-11-24 40 16 6 \n",
|
| 509 |
+
"3 127.093423 10 2023-11-24 24 2 13 \n",
|
| 510 |
+
"4 120.733836 10 2023-11-24 77 15 18 \n",
|
| 511 |
+
"\n",
|
| 512 |
+
" buys \n",
|
| 513 |
+
"0 7 \n",
|
| 514 |
+
"1 1 \n",
|
| 515 |
+
"2 3 \n",
|
| 516 |
+
"3 2 \n",
|
| 517 |
+
"4 1 "
|
| 518 |
+
]
|
| 519 |
+
},
|
| 520 |
+
"execution_count": 24,
|
| 521 |
+
"metadata": {},
|
| 522 |
+
"output_type": "execute_result"
|
| 523 |
+
}
|
| 524 |
+
],
|
| 525 |
+
"source": [
|
| 526 |
+
"df.head()"
|
| 527 |
+
]
|
| 528 |
+
},
|
| 529 |
+
{
|
| 530 |
+
"cell_type": "code",
|
| 531 |
+
"execution_count": 37,
|
| 532 |
+
"metadata": {},
|
| 533 |
+
"outputs": [
|
| 534 |
+
{
|
| 535 |
+
"data": {
|
| 536 |
+
"text/html": [
|
| 537 |
+
"<div>\n",
|
| 538 |
+
"<style scoped>\n",
|
| 539 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 540 |
+
" vertical-align: middle;\n",
|
| 541 |
+
" }\n",
|
| 542 |
+
"\n",
|
| 543 |
+
" .dataframe tbody tr th {\n",
|
| 544 |
+
" vertical-align: top;\n",
|
| 545 |
+
" }\n",
|
| 546 |
+
"\n",
|
| 547 |
+
" .dataframe thead th {\n",
|
| 548 |
+
" text-align: right;\n",
|
| 549 |
+
" }\n",
|
| 550 |
+
"</style>\n",
|
| 551 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 552 |
+
" <thead>\n",
|
| 553 |
+
" <tr style=\"text-align: right;\">\n",
|
| 554 |
+
" <th></th>\n",
|
| 555 |
+
" <th>date</th>\n",
|
| 556 |
+
" <th>product</th>\n",
|
| 557 |
+
" <th>SKU</th>\n",
|
| 558 |
+
" <th>category</th>\n",
|
| 559 |
+
" <th>price</th>\n",
|
| 560 |
+
" <th>quantity</th>\n",
|
| 561 |
+
" <th>competitor_price</th>\n",
|
| 562 |
+
" <th>discount</th>\n",
|
| 563 |
+
" <th>black_friday_date</th>\n",
|
| 564 |
+
" <th>views</th>\n",
|
| 565 |
+
" <th>clicks</th>\n",
|
| 566 |
+
" <th>favorites</th>\n",
|
| 567 |
+
" <th>buys</th>\n",
|
| 568 |
+
" <th>quantity_mean</th>\n",
|
| 569 |
+
" <th>quantity_min</th>\n",
|
| 570 |
+
" <th>quantity_max</th>\n",
|
| 571 |
+
" <th>views_mean</th>\n",
|
| 572 |
+
" <th>views_min</th>\n",
|
| 573 |
+
" <th>views_max</th>\n",
|
| 574 |
+
" </tr>\n",
|
| 575 |
+
" </thead>\n",
|
| 576 |
+
" <tbody>\n",
|
| 577 |
+
" <tr>\n",
|
| 578 |
+
" <th>0</th>\n",
|
| 579 |
+
" <td>2022-01-01</td>\n",
|
| 580 |
+
" <td>Product_21</td>\n",
|
| 581 |
+
" <td>SKU_34</td>\n",
|
| 582 |
+
" <td>Grocery</td>\n",
|
| 583 |
+
" <td>127.347405</td>\n",
|
| 584 |
+
" <td>15</td>\n",
|
| 585 |
+
" <td>126.257644</td>\n",
|
| 586 |
+
" <td>0</td>\n",
|
| 587 |
+
" <td>2023-11-24</td>\n",
|
| 588 |
+
" <td>57</td>\n",
|
| 589 |
+
" <td>29</td>\n",
|
| 590 |
+
" <td>6</td>\n",
|
| 591 |
+
" <td>7</td>\n",
|
| 592 |
+
" <td>40.250000</td>\n",
|
| 593 |
+
" <td>1</td>\n",
|
| 594 |
+
" <td>69</td>\n",
|
| 595 |
+
" <td>40.250000</td>\n",
|
| 596 |
+
" <td>1</td>\n",
|
| 597 |
+
" <td>69</td>\n",
|
| 598 |
+
" </tr>\n",
|
| 599 |
+
" <tr>\n",
|
| 600 |
+
" <th>1</th>\n",
|
| 601 |
+
" <td>2022-01-02</td>\n",
|
| 602 |
+
" <td>Product_32</td>\n",
|
| 603 |
+
" <td>SKU_6</td>\n",
|
| 604 |
+
" <td>Clothing</td>\n",
|
| 605 |
+
" <td>119.165077</td>\n",
|
| 606 |
+
" <td>5</td>\n",
|
| 607 |
+
" <td>129.504709</td>\n",
|
| 608 |
+
" <td>5</td>\n",
|
| 609 |
+
" <td>2023-11-24</td>\n",
|
| 610 |
+
" <td>93</td>\n",
|
| 611 |
+
" <td>27</td>\n",
|
| 612 |
+
" <td>7</td>\n",
|
| 613 |
+
" <td>1</td>\n",
|
| 614 |
+
" <td>37.428571</td>\n",
|
| 615 |
+
" <td>4</td>\n",
|
| 616 |
+
" <td>95</td>\n",
|
| 617 |
+
" <td>37.428571</td>\n",
|
| 618 |
+
" <td>4</td>\n",
|
| 619 |
+
" <td>95</td>\n",
|
| 620 |
+
" </tr>\n",
|
| 621 |
+
" <tr>\n",
|
| 622 |
+
" <th>2</th>\n",
|
| 623 |
+
" <td>2022-01-03</td>\n",
|
| 624 |
+
" <td>Product_23</td>\n",
|
| 625 |
+
" <td>SKU_2</td>\n",
|
| 626 |
+
" <td>Electronics</td>\n",
|
| 627 |
+
" <td>104.545228</td>\n",
|
| 628 |
+
" <td>9</td>\n",
|
| 629 |
+
" <td>98.015648</td>\n",
|
| 630 |
+
" <td>20</td>\n",
|
| 631 |
+
" <td>2023-11-24</td>\n",
|
| 632 |
+
" <td>40</td>\n",
|
| 633 |
+
" <td>16</td>\n",
|
| 634 |
+
" <td>6</td>\n",
|
| 635 |
+
" <td>3</td>\n",
|
| 636 |
+
" <td>46.000000</td>\n",
|
| 637 |
+
" <td>1</td>\n",
|
| 638 |
+
" <td>94</td>\n",
|
| 639 |
+
" <td>46.000000</td>\n",
|
| 640 |
+
" <td>1</td>\n",
|
| 641 |
+
" <td>94</td>\n",
|
| 642 |
+
" </tr>\n",
|
| 643 |
+
" <tr>\n",
|
| 644 |
+
" <th>3</th>\n",
|
| 645 |
+
" <td>2022-01-04</td>\n",
|
| 646 |
+
" <td>Product_33</td>\n",
|
| 647 |
+
" <td>SKU_13</td>\n",
|
| 648 |
+
" <td>Grocery</td>\n",
|
| 649 |
+
" <td>114.959609</td>\n",
|
| 650 |
+
" <td>5</td>\n",
|
| 651 |
+
" <td>127.093423</td>\n",
|
| 652 |
+
" <td>10</td>\n",
|
| 653 |
+
" <td>2023-11-24</td>\n",
|
| 654 |
+
" <td>24</td>\n",
|
| 655 |
+
" <td>2</td>\n",
|
| 656 |
+
" <td>13</td>\n",
|
| 657 |
+
" <td>2</td>\n",
|
| 658 |
+
" <td>50.428571</td>\n",
|
| 659 |
+
" <td>3</td>\n",
|
| 660 |
+
" <td>95</td>\n",
|
| 661 |
+
" <td>50.428571</td>\n",
|
| 662 |
+
" <td>3</td>\n",
|
| 663 |
+
" <td>95</td>\n",
|
| 664 |
+
" </tr>\n",
|
| 665 |
+
" <tr>\n",
|
| 666 |
+
" <th>4</th>\n",
|
| 667 |
+
" <td>2022-01-05</td>\n",
|
| 668 |
+
" <td>Product_3</td>\n",
|
| 669 |
+
" <td>SKU_43</td>\n",
|
| 670 |
+
" <td>Grocery</td>\n",
|
| 671 |
+
" <td>120.102043</td>\n",
|
| 672 |
+
" <td>11</td>\n",
|
| 673 |
+
" <td>120.733836</td>\n",
|
| 674 |
+
" <td>10</td>\n",
|
| 675 |
+
" <td>2023-11-24</td>\n",
|
| 676 |
+
" <td>77</td>\n",
|
| 677 |
+
" <td>15</td>\n",
|
| 678 |
+
" <td>18</td>\n",
|
| 679 |
+
" <td>1</td>\n",
|
| 680 |
+
" <td>68.272727</td>\n",
|
| 681 |
+
" <td>12</td>\n",
|
| 682 |
+
" <td>99</td>\n",
|
| 683 |
+
" <td>68.272727</td>\n",
|
| 684 |
+
" <td>12</td>\n",
|
| 685 |
+
" <td>99</td>\n",
|
| 686 |
+
" </tr>\n",
|
| 687 |
+
" </tbody>\n",
|
| 688 |
+
"</table>\n",
|
| 689 |
+
"</div>"
|
| 690 |
+
],
|
| 691 |
+
"text/plain": [
|
| 692 |
+
" date product SKU category price quantity \\\n",
|
| 693 |
+
"0 2022-01-01 Product_21 SKU_34 Grocery 127.347405 15 \n",
|
| 694 |
+
"1 2022-01-02 Product_32 SKU_6 Clothing 119.165077 5 \n",
|
| 695 |
+
"2 2022-01-03 Product_23 SKU_2 Electronics 104.545228 9 \n",
|
| 696 |
+
"3 2022-01-04 Product_33 SKU_13 Grocery 114.959609 5 \n",
|
| 697 |
+
"4 2022-01-05 Product_3 SKU_43 Grocery 120.102043 11 \n",
|
| 698 |
+
"\n",
|
| 699 |
+
" competitor_price discount black_friday_date views clicks favorites \\\n",
|
| 700 |
+
"0 126.257644 0 2023-11-24 57 29 6 \n",
|
| 701 |
+
"1 129.504709 5 2023-11-24 93 27 7 \n",
|
| 702 |
+
"2 98.015648 20 2023-11-24 40 16 6 \n",
|
| 703 |
+
"3 127.093423 10 2023-11-24 24 2 13 \n",
|
| 704 |
+
"4 120.733836 10 2023-11-24 77 15 18 \n",
|
| 705 |
+
"\n",
|
| 706 |
+
" buys quantity_mean quantity_min quantity_max views_mean views_min \\\n",
|
| 707 |
+
"0 7 40.250000 1 69 40.250000 1 \n",
|
| 708 |
+
"1 1 37.428571 4 95 37.428571 4 \n",
|
| 709 |
+
"2 3 46.000000 1 94 46.000000 1 \n",
|
| 710 |
+
"3 2 50.428571 3 95 50.428571 3 \n",
|
| 711 |
+
"4 1 68.272727 12 99 68.272727 12 \n",
|
| 712 |
+
"\n",
|
| 713 |
+
" views_max \n",
|
| 714 |
+
"0 69 \n",
|
| 715 |
+
"1 95 \n",
|
| 716 |
+
"2 94 \n",
|
| 717 |
+
"3 95 \n",
|
| 718 |
+
"4 99 "
|
| 719 |
+
]
|
| 720 |
+
},
|
| 721 |
+
"execution_count": 37,
|
| 722 |
+
"metadata": {},
|
| 723 |
+
"output_type": "execute_result"
|
| 724 |
+
}
|
| 725 |
+
],
|
| 726 |
+
"source": [
|
| 727 |
+
"df.head()"
|
| 728 |
+
]
|
| 729 |
+
},
|
| 730 |
+
{
|
| 731 |
+
"cell_type": "code",
|
| 732 |
+
"execution_count": 41,
|
| 733 |
+
"metadata": {},
|
| 734 |
+
"outputs": [
|
| 735 |
+
{
|
| 736 |
+
"data": {
|
| 737 |
+
"text/html": [
|
| 738 |
+
"<div>\n",
|
| 739 |
+
"<style scoped>\n",
|
| 740 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 741 |
+
" vertical-align: middle;\n",
|
| 742 |
+
" }\n",
|
| 743 |
+
"\n",
|
| 744 |
+
" .dataframe tbody tr th {\n",
|
| 745 |
+
" vertical-align: top;\n",
|
| 746 |
+
" }\n",
|
| 747 |
+
"\n",
|
| 748 |
+
" .dataframe thead th {\n",
|
| 749 |
+
" text-align: right;\n",
|
| 750 |
+
" }\n",
|
| 751 |
+
"</style>\n",
|
| 752 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 753 |
+
" <thead>\n",
|
| 754 |
+
" <tr style=\"text-align: right;\">\n",
|
| 755 |
+
" <th></th>\n",
|
| 756 |
+
" <th>date</th>\n",
|
| 757 |
+
" <th>product</th>\n",
|
| 758 |
+
" <th>SKU</th>\n",
|
| 759 |
+
" <th>category</th>\n",
|
| 760 |
+
" <th>price</th>\n",
|
| 761 |
+
" <th>quantity</th>\n",
|
| 762 |
+
" <th>competitor_price</th>\n",
|
| 763 |
+
" <th>discount</th>\n",
|
| 764 |
+
" <th>black_friday_date</th>\n",
|
| 765 |
+
" <th>views</th>\n",
|
| 766 |
+
" <th>...</th>\n",
|
| 767 |
+
" <th>quantity_max</th>\n",
|
| 768 |
+
" <th>views_mean</th>\n",
|
| 769 |
+
" <th>views_min</th>\n",
|
| 770 |
+
" <th>views_max</th>\n",
|
| 771 |
+
" <th>SKU_quantity_mean</th>\n",
|
| 772 |
+
" <th>SKU_quantity_min</th>\n",
|
| 773 |
+
" <th>SKU_quantity_max</th>\n",
|
| 774 |
+
" <th>SKU_views_mean</th>\n",
|
| 775 |
+
" <th>SKU_views_min</th>\n",
|
| 776 |
+
" <th>SKU_views_max</th>\n",
|
| 777 |
+
" </tr>\n",
|
| 778 |
+
" </thead>\n",
|
| 779 |
+
" <tbody>\n",
|
| 780 |
+
" <tr>\n",
|
| 781 |
+
" <th>0</th>\n",
|
| 782 |
+
" <td>2022-01-01</td>\n",
|
| 783 |
+
" <td>Product_21</td>\n",
|
| 784 |
+
" <td>SKU_34</td>\n",
|
| 785 |
+
" <td>Grocery</td>\n",
|
| 786 |
+
" <td>127.347405</td>\n",
|
| 787 |
+
" <td>15</td>\n",
|
| 788 |
+
" <td>126.257644</td>\n",
|
| 789 |
+
" <td>0</td>\n",
|
| 790 |
+
" <td>2023-11-24</td>\n",
|
| 791 |
+
" <td>57</td>\n",
|
| 792 |
+
" <td>...</td>\n",
|
| 793 |
+
" <td>69</td>\n",
|
| 794 |
+
" <td>40.250000</td>\n",
|
| 795 |
+
" <td>1</td>\n",
|
| 796 |
+
" <td>69</td>\n",
|
| 797 |
+
" <td>11.875000</td>\n",
|
| 798 |
+
" <td>9</td>\n",
|
| 799 |
+
" <td>17</td>\n",
|
| 800 |
+
" <td>40.250000</td>\n",
|
| 801 |
+
" <td>1</td>\n",
|
| 802 |
+
" <td>69</td>\n",
|
| 803 |
+
" </tr>\n",
|
| 804 |
+
" <tr>\n",
|
| 805 |
+
" <th>1</th>\n",
|
| 806 |
+
" <td>2022-01-02</td>\n",
|
| 807 |
+
" <td>Product_32</td>\n",
|
| 808 |
+
" <td>SKU_6</td>\n",
|
| 809 |
+
" <td>Clothing</td>\n",
|
| 810 |
+
" <td>119.165077</td>\n",
|
| 811 |
+
" <td>5</td>\n",
|
| 812 |
+
" <td>129.504709</td>\n",
|
| 813 |
+
" <td>5</td>\n",
|
| 814 |
+
" <td>2023-11-24</td>\n",
|
| 815 |
+
" <td>93</td>\n",
|
| 816 |
+
" <td>...</td>\n",
|
| 817 |
+
" <td>95</td>\n",
|
| 818 |
+
" <td>37.428571</td>\n",
|
| 819 |
+
" <td>4</td>\n",
|
| 820 |
+
" <td>95</td>\n",
|
| 821 |
+
" <td>8.357143</td>\n",
|
| 822 |
+
" <td>3</td>\n",
|
| 823 |
+
" <td>13</td>\n",
|
| 824 |
+
" <td>37.428571</td>\n",
|
| 825 |
+
" <td>4</td>\n",
|
| 826 |
+
" <td>95</td>\n",
|
| 827 |
+
" </tr>\n",
|
| 828 |
+
" <tr>\n",
|
| 829 |
+
" <th>2</th>\n",
|
| 830 |
+
" <td>2022-01-03</td>\n",
|
| 831 |
+
" <td>Product_23</td>\n",
|
| 832 |
+
" <td>SKU_2</td>\n",
|
| 833 |
+
" <td>Electronics</td>\n",
|
| 834 |
+
" <td>104.545228</td>\n",
|
| 835 |
+
" <td>9</td>\n",
|
| 836 |
+
" <td>98.015648</td>\n",
|
| 837 |
+
" <td>20</td>\n",
|
| 838 |
+
" <td>2023-11-24</td>\n",
|
| 839 |
+
" <td>40</td>\n",
|
| 840 |
+
" <td>...</td>\n",
|
| 841 |
+
" <td>94</td>\n",
|
| 842 |
+
" <td>46.000000</td>\n",
|
| 843 |
+
" <td>1</td>\n",
|
| 844 |
+
" <td>94</td>\n",
|
| 845 |
+
" <td>9.818182</td>\n",
|
| 846 |
+
" <td>5</td>\n",
|
| 847 |
+
" <td>13</td>\n",
|
| 848 |
+
" <td>46.000000</td>\n",
|
| 849 |
+
" <td>1</td>\n",
|
| 850 |
+
" <td>94</td>\n",
|
| 851 |
+
" </tr>\n",
|
| 852 |
+
" <tr>\n",
|
| 853 |
+
" <th>3</th>\n",
|
| 854 |
+
" <td>2022-01-04</td>\n",
|
| 855 |
+
" <td>Product_33</td>\n",
|
| 856 |
+
" <td>SKU_13</td>\n",
|
| 857 |
+
" <td>Grocery</td>\n",
|
| 858 |
+
" <td>114.959609</td>\n",
|
| 859 |
+
" <td>5</td>\n",
|
| 860 |
+
" <td>127.093423</td>\n",
|
| 861 |
+
" <td>10</td>\n",
|
| 862 |
+
" <td>2023-11-24</td>\n",
|
| 863 |
+
" <td>24</td>\n",
|
| 864 |
+
" <td>...</td>\n",
|
| 865 |
+
" <td>95</td>\n",
|
| 866 |
+
" <td>50.428571</td>\n",
|
| 867 |
+
" <td>3</td>\n",
|
| 868 |
+
" <td>95</td>\n",
|
| 869 |
+
" <td>10.142857</td>\n",
|
| 870 |
+
" <td>5</td>\n",
|
| 871 |
+
" <td>15</td>\n",
|
| 872 |
+
" <td>50.428571</td>\n",
|
| 873 |
+
" <td>3</td>\n",
|
| 874 |
+
" <td>95</td>\n",
|
| 875 |
+
" </tr>\n",
|
| 876 |
+
" <tr>\n",
|
| 877 |
+
" <th>4</th>\n",
|
| 878 |
+
" <td>2022-01-05</td>\n",
|
| 879 |
+
" <td>Product_3</td>\n",
|
| 880 |
+
" <td>SKU_43</td>\n",
|
| 881 |
+
" <td>Grocery</td>\n",
|
| 882 |
+
" <td>120.102043</td>\n",
|
| 883 |
+
" <td>11</td>\n",
|
| 884 |
+
" <td>120.733836</td>\n",
|
| 885 |
+
" <td>10</td>\n",
|
| 886 |
+
" <td>2023-11-24</td>\n",
|
| 887 |
+
" <td>77</td>\n",
|
| 888 |
+
" <td>...</td>\n",
|
| 889 |
+
" <td>99</td>\n",
|
| 890 |
+
" <td>68.272727</td>\n",
|
| 891 |
+
" <td>12</td>\n",
|
| 892 |
+
" <td>99</td>\n",
|
| 893 |
+
" <td>10.000000</td>\n",
|
| 894 |
+
" <td>6</td>\n",
|
| 895 |
+
" <td>14</td>\n",
|
| 896 |
+
" <td>68.272727</td>\n",
|
| 897 |
+
" <td>12</td>\n",
|
| 898 |
+
" <td>99</td>\n",
|
| 899 |
+
" </tr>\n",
|
| 900 |
+
" <tr>\n",
|
| 901 |
+
" <th>...</th>\n",
|
| 902 |
+
" <td>...</td>\n",
|
| 903 |
+
" <td>...</td>\n",
|
| 904 |
+
" <td>...</td>\n",
|
| 905 |
+
" <td>...</td>\n",
|
| 906 |
+
" <td>...</td>\n",
|
| 907 |
+
" <td>...</td>\n",
|
| 908 |
+
" <td>...</td>\n",
|
| 909 |
+
" <td>...</td>\n",
|
| 910 |
+
" <td>...</td>\n",
|
| 911 |
+
" <td>...</td>\n",
|
| 912 |
+
" <td>...</td>\n",
|
| 913 |
+
" <td>...</td>\n",
|
| 914 |
+
" <td>...</td>\n",
|
| 915 |
+
" <td>...</td>\n",
|
| 916 |
+
" <td>...</td>\n",
|
| 917 |
+
" <td>...</td>\n",
|
| 918 |
+
" <td>...</td>\n",
|
| 919 |
+
" <td>...</td>\n",
|
| 920 |
+
" <td>...</td>\n",
|
| 921 |
+
" <td>...</td>\n",
|
| 922 |
+
" <td>...</td>\n",
|
| 923 |
+
" </tr>\n",
|
| 924 |
+
" <tr>\n",
|
| 925 |
+
" <th>495</th>\n",
|
| 926 |
+
" <td>2023-05-11</td>\n",
|
| 927 |
+
" <td>Product_10</td>\n",
|
| 928 |
+
" <td>SKU_7</td>\n",
|
| 929 |
+
" <td>Grocery</td>\n",
|
| 930 |
+
" <td>107.896515</td>\n",
|
| 931 |
+
" <td>14</td>\n",
|
| 932 |
+
" <td>121.971779</td>\n",
|
| 933 |
+
" <td>20</td>\n",
|
| 934 |
+
" <td>2023-11-24</td>\n",
|
| 935 |
+
" <td>96</td>\n",
|
| 936 |
+
" <td>...</td>\n",
|
| 937 |
+
" <td>96</td>\n",
|
| 938 |
+
" <td>46.555556</td>\n",
|
| 939 |
+
" <td>12</td>\n",
|
| 940 |
+
" <td>96</td>\n",
|
| 941 |
+
" <td>12.444444</td>\n",
|
| 942 |
+
" <td>9</td>\n",
|
| 943 |
+
" <td>18</td>\n",
|
| 944 |
+
" <td>46.555556</td>\n",
|
| 945 |
+
" <td>12</td>\n",
|
| 946 |
+
" <td>96</td>\n",
|
| 947 |
+
" </tr>\n",
|
| 948 |
+
" <tr>\n",
|
| 949 |
+
" <th>496</th>\n",
|
| 950 |
+
" <td>2023-05-12</td>\n",
|
| 951 |
+
" <td>Product_17</td>\n",
|
| 952 |
+
" <td>SKU_33</td>\n",
|
| 953 |
+
" <td>Grocery</td>\n",
|
| 954 |
+
" <td>88.375297</td>\n",
|
| 955 |
+
" <td>15</td>\n",
|
| 956 |
+
" <td>84.834681</td>\n",
|
| 957 |
+
" <td>0</td>\n",
|
| 958 |
+
" <td>2023-11-24</td>\n",
|
| 959 |
+
" <td>35</td>\n",
|
| 960 |
+
" <td>...</td>\n",
|
| 961 |
+
" <td>98</td>\n",
|
| 962 |
+
" <td>48.800000</td>\n",
|
| 963 |
+
" <td>3</td>\n",
|
| 964 |
+
" <td>98</td>\n",
|
| 965 |
+
" <td>9.400000</td>\n",
|
| 966 |
+
" <td>4</td>\n",
|
| 967 |
+
" <td>15</td>\n",
|
| 968 |
+
" <td>48.800000</td>\n",
|
| 969 |
+
" <td>3</td>\n",
|
| 970 |
+
" <td>98</td>\n",
|
| 971 |
+
" </tr>\n",
|
| 972 |
+
" <tr>\n",
|
| 973 |
+
" <th>497</th>\n",
|
| 974 |
+
" <td>2023-05-13</td>\n",
|
| 975 |
+
" <td>Product_20</td>\n",
|
| 976 |
+
" <td>SKU_23</td>\n",
|
| 977 |
+
" <td>Clothing</td>\n",
|
| 978 |
+
" <td>82.089812</td>\n",
|
| 979 |
+
" <td>7</td>\n",
|
| 980 |
+
" <td>73.451166</td>\n",
|
| 981 |
+
" <td>5</td>\n",
|
| 982 |
+
" <td>2023-11-24</td>\n",
|
| 983 |
+
" <td>13</td>\n",
|
| 984 |
+
" <td>...</td>\n",
|
| 985 |
+
" <td>98</td>\n",
|
| 986 |
+
" <td>50.750000</td>\n",
|
| 987 |
+
" <td>6</td>\n",
|
| 988 |
+
" <td>98</td>\n",
|
| 989 |
+
" <td>9.416667</td>\n",
|
| 990 |
+
" <td>4</td>\n",
|
| 991 |
+
" <td>20</td>\n",
|
| 992 |
+
" <td>50.750000</td>\n",
|
| 993 |
+
" <td>6</td>\n",
|
| 994 |
+
" <td>98</td>\n",
|
| 995 |
+
" </tr>\n",
|
| 996 |
+
" <tr>\n",
|
| 997 |
+
" <th>498</th>\n",
|
| 998 |
+
" <td>2023-05-14</td>\n",
|
| 999 |
+
" <td>Product_24</td>\n",
|
| 1000 |
+
" <td>SKU_21</td>\n",
|
| 1001 |
+
" <td>Electronics</td>\n",
|
| 1002 |
+
" <td>88.664097</td>\n",
|
| 1003 |
+
" <td>8</td>\n",
|
| 1004 |
+
" <td>68.512037</td>\n",
|
| 1005 |
+
" <td>5</td>\n",
|
| 1006 |
+
" <td>2023-11-24</td>\n",
|
| 1007 |
+
" <td>77</td>\n",
|
| 1008 |
+
" <td>...</td>\n",
|
| 1009 |
+
" <td>81</td>\n",
|
| 1010 |
+
" <td>44.333333</td>\n",
|
| 1011 |
+
" <td>17</td>\n",
|
| 1012 |
+
" <td>81</td>\n",
|
| 1013 |
+
" <td>11.333333</td>\n",
|
| 1014 |
+
" <td>4</td>\n",
|
| 1015 |
+
" <td>20</td>\n",
|
| 1016 |
+
" <td>44.333333</td>\n",
|
| 1017 |
+
" <td>17</td>\n",
|
| 1018 |
+
" <td>81</td>\n",
|
| 1019 |
+
" </tr>\n",
|
| 1020 |
+
" <tr>\n",
|
| 1021 |
+
" <th>499</th>\n",
|
| 1022 |
+
" <td>2023-05-15</td>\n",
|
| 1023 |
+
" <td>Product_5</td>\n",
|
| 1024 |
+
" <td>SKU_19</td>\n",
|
| 1025 |
+
" <td>Clothing</td>\n",
|
| 1026 |
+
" <td>110.566509</td>\n",
|
| 1027 |
+
" <td>9</td>\n",
|
| 1028 |
+
" <td>98.052370</td>\n",
|
| 1029 |
+
" <td>0</td>\n",
|
| 1030 |
+
" <td>2023-11-24</td>\n",
|
| 1031 |
+
" <td>34</td>\n",
|
| 1032 |
+
" <td>...</td>\n",
|
| 1033 |
+
" <td>71</td>\n",
|
| 1034 |
+
" <td>29.500000</td>\n",
|
| 1035 |
+
" <td>11</td>\n",
|
| 1036 |
+
" <td>71</td>\n",
|
| 1037 |
+
" <td>8.250000</td>\n",
|
| 1038 |
+
" <td>4</td>\n",
|
| 1039 |
+
" <td>15</td>\n",
|
| 1040 |
+
" <td>29.500000</td>\n",
|
| 1041 |
+
" <td>11</td>\n",
|
| 1042 |
+
" <td>71</td>\n",
|
| 1043 |
+
" </tr>\n",
|
| 1044 |
+
" </tbody>\n",
|
| 1045 |
+
"</table>\n",
|
| 1046 |
+
"<p>500 rows × 25 columns</p>\n",
|
| 1047 |
+
"</div>"
|
| 1048 |
+
],
|
| 1049 |
+
"text/plain": [
|
| 1050 |
+
" date product SKU category price quantity \\\n",
|
| 1051 |
+
"0 2022-01-01 Product_21 SKU_34 Grocery 127.347405 15 \n",
|
| 1052 |
+
"1 2022-01-02 Product_32 SKU_6 Clothing 119.165077 5 \n",
|
| 1053 |
+
"2 2022-01-03 Product_23 SKU_2 Electronics 104.545228 9 \n",
|
| 1054 |
+
"3 2022-01-04 Product_33 SKU_13 Grocery 114.959609 5 \n",
|
| 1055 |
+
"4 2022-01-05 Product_3 SKU_43 Grocery 120.102043 11 \n",
|
| 1056 |
+
".. ... ... ... ... ... ... \n",
|
| 1057 |
+
"495 2023-05-11 Product_10 SKU_7 Grocery 107.896515 14 \n",
|
| 1058 |
+
"496 2023-05-12 Product_17 SKU_33 Grocery 88.375297 15 \n",
|
| 1059 |
+
"497 2023-05-13 Product_20 SKU_23 Clothing 82.089812 7 \n",
|
| 1060 |
+
"498 2023-05-14 Product_24 SKU_21 Electronics 88.664097 8 \n",
|
| 1061 |
+
"499 2023-05-15 Product_5 SKU_19 Clothing 110.566509 9 \n",
|
| 1062 |
+
"\n",
|
| 1063 |
+
" competitor_price discount black_friday_date views ... quantity_max \\\n",
|
| 1064 |
+
"0 126.257644 0 2023-11-24 57 ... 69 \n",
|
| 1065 |
+
"1 129.504709 5 2023-11-24 93 ... 95 \n",
|
| 1066 |
+
"2 98.015648 20 2023-11-24 40 ... 94 \n",
|
| 1067 |
+
"3 127.093423 10 2023-11-24 24 ... 95 \n",
|
| 1068 |
+
"4 120.733836 10 2023-11-24 77 ... 99 \n",
|
| 1069 |
+
".. ... ... ... ... ... ... \n",
|
| 1070 |
+
"495 121.971779 20 2023-11-24 96 ... 96 \n",
|
| 1071 |
+
"496 84.834681 0 2023-11-24 35 ... 98 \n",
|
| 1072 |
+
"497 73.451166 5 2023-11-24 13 ... 98 \n",
|
| 1073 |
+
"498 68.512037 5 2023-11-24 77 ... 81 \n",
|
| 1074 |
+
"499 98.052370 0 2023-11-24 34 ... 71 \n",
|
| 1075 |
+
"\n",
|
| 1076 |
+
" views_mean views_min views_max SKU_quantity_mean SKU_quantity_min \\\n",
|
| 1077 |
+
"0 40.250000 1 69 11.875000 9 \n",
|
| 1078 |
+
"1 37.428571 4 95 8.357143 3 \n",
|
| 1079 |
+
"2 46.000000 1 94 9.818182 5 \n",
|
| 1080 |
+
"3 50.428571 3 95 10.142857 5 \n",
|
| 1081 |
+
"4 68.272727 12 99 10.000000 6 \n",
|
| 1082 |
+
".. ... ... ... ... ... \n",
|
| 1083 |
+
"495 46.555556 12 96 12.444444 9 \n",
|
| 1084 |
+
"496 48.800000 3 98 9.400000 4 \n",
|
| 1085 |
+
"497 50.750000 6 98 9.416667 4 \n",
|
| 1086 |
+
"498 44.333333 17 81 11.333333 4 \n",
|
| 1087 |
+
"499 29.500000 11 71 8.250000 4 \n",
|
| 1088 |
+
"\n",
|
| 1089 |
+
" SKU_quantity_max SKU_views_mean SKU_views_min SKU_views_max \n",
|
| 1090 |
+
"0 17 40.250000 1 69 \n",
|
| 1091 |
+
"1 13 37.428571 4 95 \n",
|
| 1092 |
+
"2 13 46.000000 1 94 \n",
|
| 1093 |
+
"3 15 50.428571 3 95 \n",
|
| 1094 |
+
"4 14 68.272727 12 99 \n",
|
| 1095 |
+
".. ... ... ... ... \n",
|
| 1096 |
+
"495 18 46.555556 12 96 \n",
|
| 1097 |
+
"496 15 48.800000 3 98 \n",
|
| 1098 |
+
"497 20 50.750000 6 98 \n",
|
| 1099 |
+
"498 20 44.333333 17 81 \n",
|
| 1100 |
+
"499 15 29.500000 11 71 \n",
|
| 1101 |
+
"\n",
|
| 1102 |
+
"[500 rows x 25 columns]"
|
| 1103 |
+
]
|
| 1104 |
+
},
|
| 1105 |
+
"execution_count": 41,
|
| 1106 |
+
"metadata": {},
|
| 1107 |
+
"output_type": "execute_result"
|
| 1108 |
+
}
|
| 1109 |
+
],
|
| 1110 |
+
"source": [
|
| 1111 |
+
"feature_engineering.grouped_feature_eng(df, group_features=['SKU'], features=['quantity', 'views'])\n"
|
| 1112 |
+
]
|
| 1113 |
+
},
|
| 1114 |
+
{
|
| 1115 |
+
"cell_type": "code",
|
| 1116 |
+
"execution_count": null,
|
| 1117 |
+
"metadata": {},
|
| 1118 |
+
"outputs": [],
|
| 1119 |
+
"source": []
|
| 1120 |
+
}
|
| 1121 |
+
],
|
| 1122 |
+
"metadata": {
|
| 1123 |
+
"kernelspec": {
|
| 1124 |
+
"display_name": "relu",
|
| 1125 |
+
"language": "python",
|
| 1126 |
+
"name": "python3"
|
| 1127 |
+
},
|
| 1128 |
+
"language_info": {
|
| 1129 |
+
"codemirror_mode": {
|
| 1130 |
+
"name": "ipython",
|
| 1131 |
+
"version": 3
|
| 1132 |
+
},
|
| 1133 |
+
"file_extension": ".py",
|
| 1134 |
+
"mimetype": "text/x-python",
|
| 1135 |
+
"name": "python",
|
| 1136 |
+
"nbconvert_exporter": "python",
|
| 1137 |
+
"pygments_lexer": "ipython3",
|
| 1138 |
+
"version": "3.8.16"
|
| 1139 |
+
},
|
| 1140 |
+
"orig_nbformat": 4
|
| 1141 |
+
},
|
| 1142 |
+
"nbformat": 4,
|
| 1143 |
+
"nbformat_minor": 2
|
| 1144 |
+
}
|
notebooks/feature_engineering.log
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
2023-06-18 14:43:05,395 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 2 |
+
2023-06-18 15:59:26,750 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 3 |
+
2023-06-18 15:59:26,750 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 4 |
+
2023-06-18 16:01:45,735 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 5 |
+
2023-06-18 16:01:45,735 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 6 |
+
2023-06-18 16:02:03,527 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 7 |
+
2023-06-18 16:02:03,527 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 8 |
+
2023-06-18 18:07:21,376 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 9 |
+
2023-06-18 18:11:00,099 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 10 |
+
2023-06-18 18:11:23,047 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 11 |
+
2023-06-19 10:49:43,518 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 12 |
+
2023-06-19 10:51:31,027 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 13 |
+
2023-06-19 10:51:37,762 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 14 |
+
2023-06-19 11:01:06,754 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 15 |
+
2023-06-19 11:02:42,016 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 16 |
+
2023-06-19 11:06:12,952 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 17 |
+
2023-06-19 11:08:00,845 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 18 |
+
2023-06-19 11:08:10,547 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 19 |
+
2023-06-19 11:49:17,940 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 20 |
+
2023-06-19 11:51:27,810 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 21 |
+
2023-06-19 11:53:13,600 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 22 |
+
2023-06-19 11:54:19,984 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 23 |
+
2023-06-19 12:17:09,661 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 24 |
+
2023-06-19 12:18:52,639 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 25 |
+
2023-06-19 12:19:03,250 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 26 |
+
2023-06-19 12:22:40,395 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 27 |
+
2023-06-19 12:22:40,395 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 28 |
+
2023-06-19 12:24:53,536 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 29 |
+
2023-06-19 12:24:53,536 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 30 |
+
2023-06-19 12:24:55,935 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 31 |
+
2023-06-19 12:24:55,935 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 32 |
+
2023-06-19 13:02:25,550 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 33 |
+
2023-06-19 13:04:03,924 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 34 |
+
2023-06-19 13:04:10,711 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 35 |
+
2023-06-20 11:36:08,143 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[1, 2], v_range=[1, 2]
|
| 36 |
+
2023-07-04 16:10:00,606 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[2, 2], v_range=[2, 2]
|
| 37 |
+
2023-07-04 16:59:00,981 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 38 |
+
2023-07-05 11:07:22,622 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[2, 2], v_range=[2, 2]
|
| 39 |
+
2023-07-05 11:07:22,622 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=15, u_range=[2, 2], v_range=[2, 2]
|
| 40 |
+
2023-07-05 11:09:25,197 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 41 |
+
2023-07-05 11:09:25,197 - src.data.feature_engineering - INFO - normalize_features: N=8, long_period=15
|
| 42 |
+
2023-07-05 11:10:18,134 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 43 |
+
2023-07-05 11:10:18,134 - src.data.feature_engineering - INFO - filter_stability_periods: N=7, threshold=0.04, removal_percentage=0.98
|
| 44 |
+
2023-07-12 16:41:08,186 - src.data.feature_engineering - INFO - price_sales_correlation_features_updated: N=7, uv_pairs=[(-5.0, 1.0), (-3.0, 1.0), (-2.0, 1.0), (1.0, 1.0), (-1.0, 0.5), (-1.0, 0.33)]
|
| 45 |
+
2023-07-12 16:47:15,865 - src.data.feature_engineering - INFO - normalize_features: window_sizes=[7, 10, 15], long_period=30
|
notebooks/flagged/log.csv
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
sku,output,flag,username,timestamp
|
| 2 |
+
SET436-KR-NP-XL,/Users/servandodavidtorresgarcia/Servando/Relu/Relu/notebooks/flagged/output/tmp84kb_gvd.json,,,2023-06-23 18:53:27.326683
|
notebooks/flagged/output/tmp84kb_gvd.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"type": "plotly", "plot": "{\"data\":[{\"mode\":\"lines+markers\",\"x\":[1399.0,1259.1,1189.15,1538.9,1608.85],\"y\":[1.195112228393555,1.195259690284729,1.195259690284729,1.157756805419922,1.1232975721359253],\"type\":\"scatter\"}],\"layout\":{\"template\":{\"data\":{\"histogram2dcontour\":[{\"type\":\"histogram2dcontour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"choropleth\":[{\"type\":\"choropleth\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"histogram2d\":[{\"type\":\"histogram2d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmap\":[{\"type\":\"heatmap\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"heatmapgl\":[{\"type\":\"heatmapgl\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"contourcarpet\":[{\"type\":\"contourcarpet\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"contour\":[{\"type\":\"contour\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"surface\":[{\"type\":\"surface\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"},\"colorscale\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]]}],\"mesh3d\":[{\"type\":\"mesh3d\",\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}],\"scatter\":[{\"fillpattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2},\"type\":\"scatter\"}],\"parcoords\":[{\"type\":\"parcoords\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolargl\":[{\"type\":\"scatterpolargl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"bar\":[{\"error_x\":{\"color\":\"#2a3f5f\"},\"error_y\":{\"color\":\"#2a3f5f\"},\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"bar\"}],\"scattergeo\":[{\"type\":\"scattergeo\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterpolar\":[{\"type\":\"scatterpolar\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"histogram\":[{\"marker\":{\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"histogram\"}],\"scattergl\":[{\"type\":\"scattergl\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatter3d\":[{\"type\":\"scatter3d\",\"line\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattermapbox\":[{\"type\":\"scattermapbox\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scatterternary\":[{\"type\":\"scatterternary\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"scattercarpet\":[{\"type\":\"scattercarpet\",\"marker\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}}}],\"carpet\":[{\"aaxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"baxis\":{\"endlinecolor\":\"#2a3f5f\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"minorgridcolor\":\"white\",\"startlinecolor\":\"#2a3f5f\"},\"type\":\"carpet\"}],\"table\":[{\"cells\":{\"fill\":{\"color\":\"#EBF0F8\"},\"line\":{\"color\":\"white\"}},\"header\":{\"fill\":{\"color\":\"#C8D4E3\"},\"line\":{\"color\":\"white\"}},\"type\":\"table\"}],\"barpolar\":[{\"marker\":{\"line\":{\"color\":\"#E5ECF6\",\"width\":0.5},\"pattern\":{\"fillmode\":\"overlay\",\"size\":10,\"solidity\":0.2}},\"type\":\"barpolar\"}],\"pie\":[{\"automargin\":true,\"type\":\"pie\"}]},\"layout\":{\"autotypenumbers\":\"strict\",\"colorway\":[\"#636efa\",\"#EF553B\",\"#00cc96\",\"#ab63fa\",\"#FFA15A\",\"#19d3f3\",\"#FF6692\",\"#B6E880\",\"#FF97FF\",\"#FECB52\"],\"font\":{\"color\":\"#2a3f5f\"},\"hovermode\":\"closest\",\"hoverlabel\":{\"align\":\"left\"},\"paper_bgcolor\":\"white\",\"plot_bgcolor\":\"#E5ECF6\",\"polar\":{\"bgcolor\":\"#E5ECF6\",\"angularaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"radialaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"ternary\":{\"bgcolor\":\"#E5ECF6\",\"aaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"baxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"},\"caxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\"}},\"coloraxis\":{\"colorbar\":{\"outlinewidth\":0,\"ticks\":\"\"}},\"colorscale\":{\"sequential\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"sequentialminus\":[[0.0,\"#0d0887\"],[0.1111111111111111,\"#46039f\"],[0.2222222222222222,\"#7201a8\"],[0.3333333333333333,\"#9c179e\"],[0.4444444444444444,\"#bd3786\"],[0.5555555555555556,\"#d8576b\"],[0.6666666666666666,\"#ed7953\"],[0.7777777777777778,\"#fb9f3a\"],[0.8888888888888888,\"#fdca26\"],[1.0,\"#f0f921\"]],\"diverging\":[[0,\"#8e0152\"],[0.1,\"#c51b7d\"],[0.2,\"#de77ae\"],[0.3,\"#f1b6da\"],[0.4,\"#fde0ef\"],[0.5,\"#f7f7f7\"],[0.6,\"#e6f5d0\"],[0.7,\"#b8e186\"],[0.8,\"#7fbc41\"],[0.9,\"#4d9221\"],[1,\"#276419\"]]},\"xaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"yaxis\":{\"gridcolor\":\"white\",\"linecolor\":\"white\",\"ticks\":\"\",\"title\":{\"standoff\":15},\"zerolinecolor\":\"white\",\"automargin\":true,\"zerolinewidth\":2},\"scene\":{\"xaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"yaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2},\"zaxis\":{\"backgroundcolor\":\"#E5ECF6\",\"gridcolor\":\"white\",\"linecolor\":\"white\",\"showbackground\":true,\"ticks\":\"\",\"zerolinecolor\":\"white\",\"gridwidth\":2}},\"shapedefaults\":{\"line\":{\"color\":\"#2a3f5f\"}},\"annotationdefaults\":{\"arrowcolor\":\"#2a3f5f\",\"arrowhead\":0,\"arrowwidth\":1},\"geo\":{\"bgcolor\":\"white\",\"landcolor\":\"#E5ECF6\",\"subunitcolor\":\"white\",\"showland\":true,\"showlakes\":true,\"lakecolor\":\"white\"},\"title\":{\"x\":0.05},\"mapbox\":{\"style\":\"light\"}}},\"title\":{\"text\":\"Demand Curve for SKU SET436-KR-NP-XL\"},\"xaxis\":{\"title\":{\"text\":\"Price\"}},\"yaxis\":{\"title\":{\"text\":\"Predicted Sales\"}}}}"}
|
reports/log.txt
ADDED
|
@@ -0,0 +1,1012 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
Processing SKU: SET435-KR-NP-XXL
|
| 4 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 5 |
+
Starting grid search for SKU: SET435-KR-NP-XXL
|
| 6 |
+
|
| 7 |
+
Processing Lambda Multiplier: 3
|
| 8 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 9 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 10 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 11 |
+
|
| 12 |
+
Processing Lambda Multiplier: 4
|
| 13 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 14 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 15 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 16 |
+
|
| 17 |
+
Processing Lambda Multiplier: 5
|
| 18 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 19 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 20 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 21 |
+
|
| 22 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 23 |
+
[3.12, 4.16, 5.2]
|
| 24 |
+
Optimal Price for SKU SET435-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.0532 seconds
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
Processing SKU: SET435-KR-NP-XXL
|
| 28 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 29 |
+
Starting grid search for SKU: SET435-KR-NP-XXL
|
| 30 |
+
|
| 31 |
+
Processing Lambda Multiplier: 3
|
| 32 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 33 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 34 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 35 |
+
|
| 36 |
+
Processing Lambda Multiplier: 4
|
| 37 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 38 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 39 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 40 |
+
|
| 41 |
+
Processing Lambda Multiplier: 5
|
| 42 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 43 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 44 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 45 |
+
|
| 46 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 47 |
+
[3.12, 4.16, 5.2]
|
| 48 |
+
Optimal Price for SKU SET435-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.0573 seconds
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
Processing SKU: SET435-KR-NP-XXXL
|
| 52 |
+
Original Price: 1399.0, Predicted Sales: 1.195112228393555
|
| 53 |
+
Starting grid search for SKU: SET435-KR-NP-XXXL
|
| 54 |
+
|
| 55 |
+
Processing Lambda Multiplier: 3
|
| 56 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 57 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 58 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 59 |
+
|
| 60 |
+
Processing Lambda Multiplier: 4
|
| 61 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 62 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 63 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 64 |
+
|
| 65 |
+
Processing Lambda Multiplier: 5
|
| 66 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 67 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 68 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 69 |
+
|
| 70 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 71 |
+
[3.12, 4.16, 5.2]
|
| 72 |
+
Optimal Price for SKU SET435-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0592 seconds
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
Processing SKU: SET435-KR-NP-XXXL
|
| 76 |
+
Original Price: 1259.1, Predicted Sales: 1.195259690284729
|
| 77 |
+
Starting grid search for SKU: SET435-KR-NP-XXXL
|
| 78 |
+
|
| 79 |
+
Processing Lambda Multiplier: 3
|
| 80 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 81 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 82 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 83 |
+
|
| 84 |
+
Processing Lambda Multiplier: 4
|
| 85 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 86 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 87 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 88 |
+
|
| 89 |
+
Processing Lambda Multiplier: 5
|
| 90 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 91 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 92 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 93 |
+
|
| 94 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 95 |
+
[3.12, 4.16, 5.2]
|
| 96 |
+
Optimal Price for SKU SET435-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0555 seconds
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
Processing SKU: SET435-KR-NP-XXXL
|
| 100 |
+
Original Price: 1189.15, Predicted Sales: 1.195259690284729
|
| 101 |
+
Starting grid search for SKU: SET435-KR-NP-XXXL
|
| 102 |
+
|
| 103 |
+
Processing Lambda Multiplier: 3
|
| 104 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 105 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 106 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 107 |
+
|
| 108 |
+
Processing Lambda Multiplier: 4
|
| 109 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 110 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 111 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 112 |
+
|
| 113 |
+
Processing Lambda Multiplier: 5
|
| 114 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 115 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 116 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 117 |
+
|
| 118 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 119 |
+
[3.12, 4.16, 5.2]
|
| 120 |
+
Optimal Price for SKU SET435-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0523 seconds
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
Processing SKU: SET435-KR-NP-XXXL
|
| 124 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 125 |
+
Starting grid search for SKU: SET435-KR-NP-XXXL
|
| 126 |
+
|
| 127 |
+
Processing Lambda Multiplier: 3
|
| 128 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 129 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 130 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 131 |
+
|
| 132 |
+
Processing Lambda Multiplier: 4
|
| 133 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 134 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 135 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 136 |
+
|
| 137 |
+
Processing Lambda Multiplier: 5
|
| 138 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 139 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 140 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 141 |
+
|
| 142 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 143 |
+
[3.12, 4.16, 5.2]
|
| 144 |
+
Optimal Price for SKU SET435-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0648 seconds
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
Processing SKU: SET435-KR-NP-XXXL
|
| 148 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 149 |
+
Starting grid search for SKU: SET435-KR-NP-XXXL
|
| 150 |
+
|
| 151 |
+
Processing Lambda Multiplier: 3
|
| 152 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 153 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 154 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 155 |
+
|
| 156 |
+
Processing Lambda Multiplier: 4
|
| 157 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 158 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 159 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 160 |
+
|
| 161 |
+
Processing Lambda Multiplier: 5
|
| 162 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 163 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 164 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 165 |
+
|
| 166 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 167 |
+
[3.12, 4.16, 5.2]
|
| 168 |
+
Optimal Price for SKU SET435-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0614 seconds
|
| 169 |
+
|
| 170 |
+
|
| 171 |
+
Processing SKU: SET436-KR-NP-L
|
| 172 |
+
Original Price: 1399.0, Predicted Sales: 1.195112228393555
|
| 173 |
+
Starting grid search for SKU: SET436-KR-NP-L
|
| 174 |
+
|
| 175 |
+
Processing Lambda Multiplier: 3
|
| 176 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 177 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 178 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 179 |
+
|
| 180 |
+
Processing Lambda Multiplier: 4
|
| 181 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 182 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 183 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 184 |
+
|
| 185 |
+
Processing Lambda Multiplier: 5
|
| 186 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 187 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 188 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 189 |
+
|
| 190 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 191 |
+
[3.12, 4.16, 5.2]
|
| 192 |
+
Optimal Price for SKU SET436-KR-NP-L: 15.145631067961165, Elapsed Time: 0.0525 seconds
|
| 193 |
+
|
| 194 |
+
|
| 195 |
+
Processing SKU: SET436-KR-NP-L
|
| 196 |
+
Original Price: 1259.1, Predicted Sales: 1.195259690284729
|
| 197 |
+
Starting grid search for SKU: SET436-KR-NP-L
|
| 198 |
+
|
| 199 |
+
Processing Lambda Multiplier: 3
|
| 200 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 201 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 202 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 203 |
+
|
| 204 |
+
Processing Lambda Multiplier: 4
|
| 205 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 206 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 207 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 208 |
+
|
| 209 |
+
Processing Lambda Multiplier: 5
|
| 210 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 211 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 212 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 213 |
+
|
| 214 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 215 |
+
[3.12, 4.16, 5.2]
|
| 216 |
+
Optimal Price for SKU SET436-KR-NP-L: 15.145631067961165, Elapsed Time: 0.0550 seconds
|
| 217 |
+
|
| 218 |
+
|
| 219 |
+
Processing SKU: SET436-KR-NP-L
|
| 220 |
+
Original Price: 1189.15, Predicted Sales: 1.195259690284729
|
| 221 |
+
Starting grid search for SKU: SET436-KR-NP-L
|
| 222 |
+
|
| 223 |
+
Processing Lambda Multiplier: 3
|
| 224 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 225 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 226 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 227 |
+
|
| 228 |
+
Processing Lambda Multiplier: 4
|
| 229 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 230 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 231 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 232 |
+
|
| 233 |
+
Processing Lambda Multiplier: 5
|
| 234 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 235 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 236 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 237 |
+
|
| 238 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 239 |
+
[3.12, 4.16, 5.2]
|
| 240 |
+
Optimal Price for SKU SET436-KR-NP-L: 15.145631067961165, Elapsed Time: 0.0600 seconds
|
| 241 |
+
|
| 242 |
+
|
| 243 |
+
Processing SKU: SET436-KR-NP-L
|
| 244 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 245 |
+
Starting grid search for SKU: SET436-KR-NP-L
|
| 246 |
+
|
| 247 |
+
Processing Lambda Multiplier: 3
|
| 248 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 249 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 250 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 251 |
+
|
| 252 |
+
Processing Lambda Multiplier: 4
|
| 253 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 254 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 255 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 256 |
+
|
| 257 |
+
Processing Lambda Multiplier: 5
|
| 258 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 259 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 260 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 261 |
+
|
| 262 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 263 |
+
[3.12, 4.16, 5.2]
|
| 264 |
+
Optimal Price for SKU SET436-KR-NP-L: 15.145631067961165, Elapsed Time: 0.0633 seconds
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
Processing SKU: SET436-KR-NP-L
|
| 268 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 269 |
+
Starting grid search for SKU: SET436-KR-NP-L
|
| 270 |
+
|
| 271 |
+
Processing Lambda Multiplier: 3
|
| 272 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 273 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 274 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 275 |
+
|
| 276 |
+
Processing Lambda Multiplier: 4
|
| 277 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 278 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 279 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 280 |
+
|
| 281 |
+
Processing Lambda Multiplier: 5
|
| 282 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 283 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 284 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 285 |
+
|
| 286 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 287 |
+
[3.12, 4.16, 5.2]
|
| 288 |
+
Optimal Price for SKU SET436-KR-NP-L: 15.145631067961165, Elapsed Time: 0.0510 seconds
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
Processing SKU: SET436-KR-NP-M
|
| 292 |
+
Original Price: 1399.0, Predicted Sales: 1.566397190093994
|
| 293 |
+
Starting grid search for SKU: SET436-KR-NP-M
|
| 294 |
+
|
| 295 |
+
Processing Lambda Multiplier: 3
|
| 296 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 297 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 298 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 299 |
+
|
| 300 |
+
Processing Lambda Multiplier: 4
|
| 301 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 302 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 303 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 304 |
+
|
| 305 |
+
Processing Lambda Multiplier: 5
|
| 306 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 307 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 308 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 309 |
+
|
| 310 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 311 |
+
[3.12, 4.16, 5.2]
|
| 312 |
+
Optimal Price for SKU SET436-KR-NP-M: 15.145631067961165, Elapsed Time: 0.0534 seconds
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
Processing SKU: SET436-KR-NP-M
|
| 316 |
+
Original Price: 1259.1, Predicted Sales: 1.6105058193206787
|
| 317 |
+
Starting grid search for SKU: SET436-KR-NP-M
|
| 318 |
+
|
| 319 |
+
Processing Lambda Multiplier: 3
|
| 320 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 321 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 322 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 323 |
+
|
| 324 |
+
Processing Lambda Multiplier: 4
|
| 325 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 326 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 327 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 328 |
+
|
| 329 |
+
Processing Lambda Multiplier: 5
|
| 330 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 331 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 332 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 333 |
+
|
| 334 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 335 |
+
[3.12, 4.16, 5.2]
|
| 336 |
+
Optimal Price for SKU SET436-KR-NP-M: 15.145631067961165, Elapsed Time: 0.0608 seconds
|
| 337 |
+
|
| 338 |
+
|
| 339 |
+
Processing SKU: SET436-KR-NP-M
|
| 340 |
+
Original Price: 1189.15, Predicted Sales: 1.6105058193206787
|
| 341 |
+
Starting grid search for SKU: SET436-KR-NP-M
|
| 342 |
+
|
| 343 |
+
Processing Lambda Multiplier: 3
|
| 344 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 345 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 346 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 347 |
+
|
| 348 |
+
Processing Lambda Multiplier: 4
|
| 349 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 350 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 351 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 352 |
+
|
| 353 |
+
Processing Lambda Multiplier: 5
|
| 354 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 355 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 356 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 357 |
+
|
| 358 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 359 |
+
[3.12, 4.16, 5.2]
|
| 360 |
+
Optimal Price for SKU SET436-KR-NP-M: 15.145631067961165, Elapsed Time: 0.0753 seconds
|
| 361 |
+
|
| 362 |
+
|
| 363 |
+
Processing SKU: SET436-KR-NP-M
|
| 364 |
+
Original Price: 1538.9, Predicted Sales: 1.529041767120361
|
| 365 |
+
Starting grid search for SKU: SET436-KR-NP-M
|
| 366 |
+
|
| 367 |
+
Processing Lambda Multiplier: 3
|
| 368 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 369 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 370 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 371 |
+
|
| 372 |
+
Processing Lambda Multiplier: 4
|
| 373 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 374 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 375 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 376 |
+
|
| 377 |
+
Processing Lambda Multiplier: 5
|
| 378 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 379 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 380 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 381 |
+
|
| 382 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 383 |
+
[3.12, 4.16, 5.2]
|
| 384 |
+
Optimal Price for SKU SET436-KR-NP-M: 15.145631067961165, Elapsed Time: 0.1566 seconds
|
| 385 |
+
|
| 386 |
+
|
| 387 |
+
Processing SKU: SET436-KR-NP-M
|
| 388 |
+
Original Price: 1608.85, Predicted Sales: 1.5019981861114502
|
| 389 |
+
Starting grid search for SKU: SET436-KR-NP-M
|
| 390 |
+
|
| 391 |
+
Processing Lambda Multiplier: 3
|
| 392 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 393 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 394 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 395 |
+
|
| 396 |
+
Processing Lambda Multiplier: 4
|
| 397 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 398 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 399 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 400 |
+
|
| 401 |
+
Processing Lambda Multiplier: 5
|
| 402 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 403 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 404 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 405 |
+
|
| 406 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 407 |
+
[3.12, 4.16, 5.2]
|
| 408 |
+
Optimal Price for SKU SET436-KR-NP-M: 15.145631067961165, Elapsed Time: 0.0604 seconds
|
| 409 |
+
|
| 410 |
+
|
| 411 |
+
Processing SKU: SET436-KR-NP-S
|
| 412 |
+
Original Price: 1399.0, Predicted Sales: 1.195112228393555
|
| 413 |
+
Starting grid search for SKU: SET436-KR-NP-S
|
| 414 |
+
|
| 415 |
+
Processing Lambda Multiplier: 3
|
| 416 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 417 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 418 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 419 |
+
|
| 420 |
+
Processing Lambda Multiplier: 4
|
| 421 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 422 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 423 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 424 |
+
|
| 425 |
+
Processing Lambda Multiplier: 5
|
| 426 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 427 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 428 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 429 |
+
|
| 430 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 431 |
+
[3.12, 4.16, 5.2]
|
| 432 |
+
Optimal Price for SKU SET436-KR-NP-S: 15.145631067961165, Elapsed Time: 0.0633 seconds
|
| 433 |
+
|
| 434 |
+
|
| 435 |
+
Processing SKU: SET436-KR-NP-S
|
| 436 |
+
Original Price: 1259.1, Predicted Sales: 1.195259690284729
|
| 437 |
+
Starting grid search for SKU: SET436-KR-NP-S
|
| 438 |
+
|
| 439 |
+
Processing Lambda Multiplier: 3
|
| 440 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 441 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 442 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 443 |
+
|
| 444 |
+
Processing Lambda Multiplier: 4
|
| 445 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 446 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 447 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 448 |
+
|
| 449 |
+
Processing Lambda Multiplier: 5
|
| 450 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 451 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 452 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 453 |
+
|
| 454 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 455 |
+
[3.12, 4.16, 5.2]
|
| 456 |
+
Optimal Price for SKU SET436-KR-NP-S: 15.145631067961165, Elapsed Time: 0.0613 seconds
|
| 457 |
+
|
| 458 |
+
|
| 459 |
+
Processing SKU: SET436-KR-NP-S
|
| 460 |
+
Original Price: 1189.15, Predicted Sales: 1.195259690284729
|
| 461 |
+
Starting grid search for SKU: SET436-KR-NP-S
|
| 462 |
+
|
| 463 |
+
Processing Lambda Multiplier: 3
|
| 464 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 465 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 466 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 467 |
+
|
| 468 |
+
Processing Lambda Multiplier: 4
|
| 469 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 470 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 471 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 472 |
+
|
| 473 |
+
Processing Lambda Multiplier: 5
|
| 474 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 475 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 476 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 477 |
+
|
| 478 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 479 |
+
[3.12, 4.16, 5.2]
|
| 480 |
+
Optimal Price for SKU SET436-KR-NP-S: 15.145631067961165, Elapsed Time: 0.0515 seconds
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
Processing SKU: SET436-KR-NP-S
|
| 484 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 485 |
+
Starting grid search for SKU: SET436-KR-NP-S
|
| 486 |
+
|
| 487 |
+
Processing Lambda Multiplier: 3
|
| 488 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 489 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 490 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 491 |
+
|
| 492 |
+
Processing Lambda Multiplier: 4
|
| 493 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 494 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 495 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 496 |
+
|
| 497 |
+
Processing Lambda Multiplier: 5
|
| 498 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 499 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 500 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 501 |
+
|
| 502 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 503 |
+
[3.12, 4.16, 5.2]
|
| 504 |
+
Optimal Price for SKU SET436-KR-NP-S: 15.145631067961165, Elapsed Time: 0.0540 seconds
|
| 505 |
+
|
| 506 |
+
|
| 507 |
+
Processing SKU: SET436-KR-NP-S
|
| 508 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 509 |
+
Starting grid search for SKU: SET436-KR-NP-S
|
| 510 |
+
|
| 511 |
+
Processing Lambda Multiplier: 3
|
| 512 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 513 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 514 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 515 |
+
|
| 516 |
+
Processing Lambda Multiplier: 4
|
| 517 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 518 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 519 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 520 |
+
|
| 521 |
+
Processing Lambda Multiplier: 5
|
| 522 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 523 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 524 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 525 |
+
|
| 526 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 527 |
+
[3.12, 4.16, 5.2]
|
| 528 |
+
Optimal Price for SKU SET436-KR-NP-S: 15.145631067961165, Elapsed Time: 0.0619 seconds
|
| 529 |
+
|
| 530 |
+
|
| 531 |
+
Processing SKU: SET436-KR-NP-XL
|
| 532 |
+
Original Price: 1399.0, Predicted Sales: 1.195112228393555
|
| 533 |
+
Starting grid search for SKU: SET436-KR-NP-XL
|
| 534 |
+
|
| 535 |
+
Processing Lambda Multiplier: 3
|
| 536 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 537 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 538 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 539 |
+
|
| 540 |
+
Processing Lambda Multiplier: 4
|
| 541 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 542 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 543 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 544 |
+
|
| 545 |
+
Processing Lambda Multiplier: 5
|
| 546 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 547 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 548 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 549 |
+
|
| 550 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 551 |
+
[3.12, 4.16, 5.2]
|
| 552 |
+
Optimal Price for SKU SET436-KR-NP-XL: 15.145631067961165, Elapsed Time: 0.0607 seconds
|
| 553 |
+
|
| 554 |
+
|
| 555 |
+
Processing SKU: SET436-KR-NP-XL
|
| 556 |
+
Original Price: 1259.1, Predicted Sales: 1.195259690284729
|
| 557 |
+
Starting grid search for SKU: SET436-KR-NP-XL
|
| 558 |
+
|
| 559 |
+
Processing Lambda Multiplier: 3
|
| 560 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 561 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 562 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 563 |
+
|
| 564 |
+
Processing Lambda Multiplier: 4
|
| 565 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 566 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 567 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 568 |
+
|
| 569 |
+
Processing Lambda Multiplier: 5
|
| 570 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 571 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 572 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 573 |
+
|
| 574 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 575 |
+
[3.12, 4.16, 5.2]
|
| 576 |
+
Optimal Price for SKU SET436-KR-NP-XL: 15.145631067961165, Elapsed Time: 0.0591 seconds
|
| 577 |
+
|
| 578 |
+
|
| 579 |
+
Processing SKU: SET436-KR-NP-XL
|
| 580 |
+
Original Price: 1189.15, Predicted Sales: 1.195259690284729
|
| 581 |
+
Starting grid search for SKU: SET436-KR-NP-XL
|
| 582 |
+
|
| 583 |
+
Processing Lambda Multiplier: 3
|
| 584 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 585 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 586 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 587 |
+
|
| 588 |
+
Processing Lambda Multiplier: 4
|
| 589 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 590 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 591 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 592 |
+
|
| 593 |
+
Processing Lambda Multiplier: 5
|
| 594 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 595 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 596 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 597 |
+
|
| 598 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 599 |
+
[3.12, 4.16, 5.2]
|
| 600 |
+
Optimal Price for SKU SET436-KR-NP-XL: 15.145631067961165, Elapsed Time: 0.0530 seconds
|
| 601 |
+
|
| 602 |
+
|
| 603 |
+
Processing SKU: SET436-KR-NP-XL
|
| 604 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 605 |
+
Starting grid search for SKU: SET436-KR-NP-XL
|
| 606 |
+
|
| 607 |
+
Processing Lambda Multiplier: 3
|
| 608 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 609 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 610 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 611 |
+
|
| 612 |
+
Processing Lambda Multiplier: 4
|
| 613 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 614 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 615 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 616 |
+
|
| 617 |
+
Processing Lambda Multiplier: 5
|
| 618 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 619 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 620 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 621 |
+
|
| 622 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 623 |
+
[3.12, 4.16, 5.2]
|
| 624 |
+
Optimal Price for SKU SET436-KR-NP-XL: 15.145631067961165, Elapsed Time: 0.0623 seconds
|
| 625 |
+
|
| 626 |
+
|
| 627 |
+
Processing SKU: SET436-KR-NP-XL
|
| 628 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 629 |
+
Starting grid search for SKU: SET436-KR-NP-XL
|
| 630 |
+
|
| 631 |
+
Processing Lambda Multiplier: 3
|
| 632 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 633 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 634 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 635 |
+
|
| 636 |
+
Processing Lambda Multiplier: 4
|
| 637 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 638 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 639 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 640 |
+
|
| 641 |
+
Processing Lambda Multiplier: 5
|
| 642 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 643 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 644 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 645 |
+
|
| 646 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 647 |
+
[3.12, 4.16, 5.2]
|
| 648 |
+
Optimal Price for SKU SET436-KR-NP-XL: 15.145631067961165, Elapsed Time: 0.0640 seconds
|
| 649 |
+
|
| 650 |
+
|
| 651 |
+
Processing SKU: SET436-KR-NP-XS
|
| 652 |
+
Original Price: 1399.0, Predicted Sales: 1.195112228393555
|
| 653 |
+
Starting grid search for SKU: SET436-KR-NP-XS
|
| 654 |
+
|
| 655 |
+
Processing Lambda Multiplier: 3
|
| 656 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 657 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 658 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 659 |
+
|
| 660 |
+
Processing Lambda Multiplier: 4
|
| 661 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 662 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 663 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 664 |
+
|
| 665 |
+
Processing Lambda Multiplier: 5
|
| 666 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 667 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 668 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 669 |
+
|
| 670 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 671 |
+
[3.12, 4.16, 5.2]
|
| 672 |
+
Optimal Price for SKU SET436-KR-NP-XS: 15.145631067961165, Elapsed Time: 0.0524 seconds
|
| 673 |
+
|
| 674 |
+
|
| 675 |
+
Processing SKU: SET436-KR-NP-XS
|
| 676 |
+
Original Price: 1259.1, Predicted Sales: 1.195259690284729
|
| 677 |
+
Starting grid search for SKU: SET436-KR-NP-XS
|
| 678 |
+
|
| 679 |
+
Processing Lambda Multiplier: 3
|
| 680 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 681 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 682 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 683 |
+
|
| 684 |
+
Processing Lambda Multiplier: 4
|
| 685 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 686 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 687 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 688 |
+
|
| 689 |
+
Processing Lambda Multiplier: 5
|
| 690 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 691 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 692 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 693 |
+
|
| 694 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 695 |
+
[3.12, 4.16, 5.2]
|
| 696 |
+
Optimal Price for SKU SET436-KR-NP-XS: 15.145631067961165, Elapsed Time: 0.0542 seconds
|
| 697 |
+
|
| 698 |
+
|
| 699 |
+
Processing SKU: SET436-KR-NP-XS
|
| 700 |
+
Original Price: 1189.15, Predicted Sales: 1.195259690284729
|
| 701 |
+
Starting grid search for SKU: SET436-KR-NP-XS
|
| 702 |
+
|
| 703 |
+
Processing Lambda Multiplier: 3
|
| 704 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 705 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 706 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 707 |
+
|
| 708 |
+
Processing Lambda Multiplier: 4
|
| 709 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 710 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 711 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 712 |
+
|
| 713 |
+
Processing Lambda Multiplier: 5
|
| 714 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 715 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 716 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 717 |
+
|
| 718 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 719 |
+
[3.12, 4.16, 5.2]
|
| 720 |
+
Optimal Price for SKU SET436-KR-NP-XS: 15.145631067961165, Elapsed Time: 0.0516 seconds
|
| 721 |
+
|
| 722 |
+
|
| 723 |
+
Processing SKU: SET436-KR-NP-XS
|
| 724 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 725 |
+
Starting grid search for SKU: SET436-KR-NP-XS
|
| 726 |
+
|
| 727 |
+
Processing Lambda Multiplier: 3
|
| 728 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 729 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 730 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 731 |
+
|
| 732 |
+
Processing Lambda Multiplier: 4
|
| 733 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 734 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 735 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 736 |
+
|
| 737 |
+
Processing Lambda Multiplier: 5
|
| 738 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 739 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 740 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 741 |
+
|
| 742 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 743 |
+
[3.12, 4.16, 5.2]
|
| 744 |
+
Optimal Price for SKU SET436-KR-NP-XS: 15.145631067961165, Elapsed Time: 0.0563 seconds
|
| 745 |
+
|
| 746 |
+
|
| 747 |
+
Processing SKU: SET436-KR-NP-XS
|
| 748 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 749 |
+
Starting grid search for SKU: SET436-KR-NP-XS
|
| 750 |
+
|
| 751 |
+
Processing Lambda Multiplier: 3
|
| 752 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 753 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 754 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 755 |
+
|
| 756 |
+
Processing Lambda Multiplier: 4
|
| 757 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 758 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 759 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 760 |
+
|
| 761 |
+
Processing Lambda Multiplier: 5
|
| 762 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 763 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 764 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 765 |
+
|
| 766 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 767 |
+
[3.12, 4.16, 5.2]
|
| 768 |
+
Optimal Price for SKU SET436-KR-NP-XS: 15.145631067961165, Elapsed Time: 0.0518 seconds
|
| 769 |
+
|
| 770 |
+
|
| 771 |
+
Processing SKU: SET436-KR-NP-XXL
|
| 772 |
+
Original Price: 1399.0, Predicted Sales: 1.195112228393555
|
| 773 |
+
Starting grid search for SKU: SET436-KR-NP-XXL
|
| 774 |
+
|
| 775 |
+
Processing Lambda Multiplier: 3
|
| 776 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 777 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 778 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 779 |
+
|
| 780 |
+
Processing Lambda Multiplier: 4
|
| 781 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 782 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 783 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 784 |
+
|
| 785 |
+
Processing Lambda Multiplier: 5
|
| 786 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 787 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 788 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 789 |
+
|
| 790 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 791 |
+
[3.12, 4.16, 5.2]
|
| 792 |
+
Optimal Price for SKU SET436-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.0545 seconds
|
| 793 |
+
|
| 794 |
+
|
| 795 |
+
Processing SKU: SET436-KR-NP-XXL
|
| 796 |
+
Original Price: 1259.1, Predicted Sales: 1.195259690284729
|
| 797 |
+
Starting grid search for SKU: SET436-KR-NP-XXL
|
| 798 |
+
|
| 799 |
+
Processing Lambda Multiplier: 3
|
| 800 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 801 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 802 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 803 |
+
|
| 804 |
+
Processing Lambda Multiplier: 4
|
| 805 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 806 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 807 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 808 |
+
|
| 809 |
+
Processing Lambda Multiplier: 5
|
| 810 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 811 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 812 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 813 |
+
|
| 814 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 815 |
+
[3.12, 4.16, 5.2]
|
| 816 |
+
Optimal Price for SKU SET436-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.1169 seconds
|
| 817 |
+
|
| 818 |
+
|
| 819 |
+
Processing SKU: SET436-KR-NP-XXL
|
| 820 |
+
Original Price: 1189.15, Predicted Sales: 1.195259690284729
|
| 821 |
+
Starting grid search for SKU: SET436-KR-NP-XXL
|
| 822 |
+
|
| 823 |
+
Processing Lambda Multiplier: 3
|
| 824 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 825 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 826 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 827 |
+
|
| 828 |
+
Processing Lambda Multiplier: 4
|
| 829 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 830 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 831 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 832 |
+
|
| 833 |
+
Processing Lambda Multiplier: 5
|
| 834 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 835 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 836 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 837 |
+
|
| 838 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 839 |
+
[3.12, 4.16, 5.2]
|
| 840 |
+
Optimal Price for SKU SET436-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.0785 seconds
|
| 841 |
+
|
| 842 |
+
|
| 843 |
+
Processing SKU: SET436-KR-NP-XXL
|
| 844 |
+
Original Price: 1538.9, Predicted Sales: 1.157756805419922
|
| 845 |
+
Starting grid search for SKU: SET436-KR-NP-XXL
|
| 846 |
+
|
| 847 |
+
Processing Lambda Multiplier: 3
|
| 848 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 849 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 850 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 851 |
+
|
| 852 |
+
Processing Lambda Multiplier: 4
|
| 853 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 854 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 855 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 856 |
+
|
| 857 |
+
Processing Lambda Multiplier: 5
|
| 858 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 859 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 860 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 861 |
+
|
| 862 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 863 |
+
[3.12, 4.16, 5.2]
|
| 864 |
+
Optimal Price for SKU SET436-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.0609 seconds
|
| 865 |
+
|
| 866 |
+
|
| 867 |
+
Processing SKU: SET436-KR-NP-XXL
|
| 868 |
+
Original Price: 1608.85, Predicted Sales: 1.1232975721359253
|
| 869 |
+
Starting grid search for SKU: SET436-KR-NP-XXL
|
| 870 |
+
|
| 871 |
+
Processing Lambda Multiplier: 3
|
| 872 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 873 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 874 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 875 |
+
|
| 876 |
+
Processing Lambda Multiplier: 4
|
| 877 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 878 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 879 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 880 |
+
|
| 881 |
+
Processing Lambda Multiplier: 5
|
| 882 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 883 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 884 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 885 |
+
|
| 886 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 887 |
+
[3.12, 4.16, 5.2]
|
| 888 |
+
Optimal Price for SKU SET436-KR-NP-XXL: 15.145631067961165, Elapsed Time: 0.0545 seconds
|
| 889 |
+
|
| 890 |
+
|
| 891 |
+
Processing SKU: SET436-KR-NP-XXXL
|
| 892 |
+
Original Price: 1399.0, Predicted Sales: 1.1201153993606567
|
| 893 |
+
Starting grid search for SKU: SET436-KR-NP-XXXL
|
| 894 |
+
|
| 895 |
+
Processing Lambda Multiplier: 3
|
| 896 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 897 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 898 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 899 |
+
|
| 900 |
+
Processing Lambda Multiplier: 4
|
| 901 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 902 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 903 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 904 |
+
|
| 905 |
+
Processing Lambda Multiplier: 5
|
| 906 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 907 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 908 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 909 |
+
|
| 910 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 911 |
+
[3.12, 4.16, 5.2]
|
| 912 |
+
Optimal Price for SKU SET436-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0565 seconds
|
| 913 |
+
|
| 914 |
+
|
| 915 |
+
Processing SKU: SET436-KR-NP-XXXL
|
| 916 |
+
Original Price: 1259.1, Predicted Sales: 1.1642240285873413
|
| 917 |
+
Starting grid search for SKU: SET436-KR-NP-XXXL
|
| 918 |
+
|
| 919 |
+
Processing Lambda Multiplier: 3
|
| 920 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 921 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 922 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 923 |
+
|
| 924 |
+
Processing Lambda Multiplier: 4
|
| 925 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 926 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 927 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 928 |
+
|
| 929 |
+
Processing Lambda Multiplier: 5
|
| 930 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 931 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 932 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 933 |
+
|
| 934 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 935 |
+
[3.12, 4.16, 5.2]
|
| 936 |
+
Optimal Price for SKU SET436-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0537 seconds
|
| 937 |
+
|
| 938 |
+
|
| 939 |
+
Processing SKU: SET436-KR-NP-XXXL
|
| 940 |
+
Original Price: 1189.15, Predicted Sales: 1.1642240285873413
|
| 941 |
+
Starting grid search for SKU: SET436-KR-NP-XXXL
|
| 942 |
+
|
| 943 |
+
Processing Lambda Multiplier: 3
|
| 944 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 945 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 946 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 947 |
+
|
| 948 |
+
Processing Lambda Multiplier: 4
|
| 949 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 950 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 951 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 952 |
+
|
| 953 |
+
Processing Lambda Multiplier: 5
|
| 954 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 955 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 956 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 957 |
+
|
| 958 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 959 |
+
[3.12, 4.16, 5.2]
|
| 960 |
+
Optimal Price for SKU SET436-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0765 seconds
|
| 961 |
+
|
| 962 |
+
|
| 963 |
+
Processing SKU: SET436-KR-NP-XXXL
|
| 964 |
+
Original Price: 1538.9, Predicted Sales: 1.082759976387024
|
| 965 |
+
Starting grid search for SKU: SET436-KR-NP-XXXL
|
| 966 |
+
|
| 967 |
+
Processing Lambda Multiplier: 3
|
| 968 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 969 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 970 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 971 |
+
|
| 972 |
+
Processing Lambda Multiplier: 4
|
| 973 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 974 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 975 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 976 |
+
|
| 977 |
+
Processing Lambda Multiplier: 5
|
| 978 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 979 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 980 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 981 |
+
|
| 982 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 983 |
+
[3.12, 4.16, 5.2]
|
| 984 |
+
Optimal Price for SKU SET436-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0598 seconds
|
| 985 |
+
|
| 986 |
+
|
| 987 |
+
Processing SKU: SET436-KR-NP-XXXL
|
| 988 |
+
Original Price: 1608.85, Predicted Sales: 1.0557163953781128
|
| 989 |
+
Starting grid search for SKU: SET436-KR-NP-XXXL
|
| 990 |
+
|
| 991 |
+
Processing Lambda Multiplier: 3
|
| 992 |
+
Final Optimal Price: 15.145631067961165, Final Lambda Value: 3.12
|
| 993 |
+
Optimal Price for Lambda Multiplier 3: 15.145631067961165
|
| 994 |
+
Optimal Lambda Value for Lambda Multiplier 3: 3.12
|
| 995 |
+
|
| 996 |
+
Processing Lambda Multiplier: 4
|
| 997 |
+
Final Optimal Price: 16.124031007751938, Final Lambda Value: 4.16
|
| 998 |
+
Optimal Price for Lambda Multiplier 4: 16.124031007751938
|
| 999 |
+
Optimal Lambda Value for Lambda Multiplier 4: 4.16
|
| 1000 |
+
|
| 1001 |
+
Processing Lambda Multiplier: 5
|
| 1002 |
+
Final Optimal Price: 16.774193548387096, Final Lambda Value: 5.2
|
| 1003 |
+
Optimal Price for Lambda Multiplier 5: 16.774193548387096
|
| 1004 |
+
Optimal Lambda Value for Lambda Multiplier 5: 5.2
|
| 1005 |
+
|
| 1006 |
+
Final Results - Best Prices: [15.145631067961165, 16.124031007751938, 16.774193548387096], Best Lambda Values:
|
| 1007 |
+
[3.12, 4.16, 5.2]
|
| 1008 |
+
Optimal Price for SKU SET436-KR-NP-XXXL: 15.145631067961165, Elapsed Time: 0.0520 seconds
|
| 1009 |
+
|
| 1010 |
+
Total Elapsed Time for find_optimal_price: 1479.3095 seconds
|
| 1011 |
+
✓ App completed.
|
| 1012 |
+
(relu) servandodavidtorresgarcia@MacBook-Pro-de-Servando train %
|