Spaces:
Sleeping
Sleeping
Krishna Kumar S commited on
Commit ·
0115091
1
Parent(s): 53016cb
commit
Browse files- Generate_Data.py +5 -5
- Read_Data +0 -0
- Read_Data.py +21 -0
- histogram_ranges.png +0 -0
Generate_Data.py
CHANGED
|
@@ -84,7 +84,7 @@ def generate_intelligent_sourcing_excel(
|
|
| 84 |
with pd.ExcelWriter(output_filename, engine='xlsxwriter') as writer:
|
| 85 |
weightage_df.to_excel(writer, sheet_name='Weightage', index=False)
|
| 86 |
priority_df.to_excel(writer, sheet_name='Priority Data', index=False)
|
| 87 |
-
warehouse_df.to_excel(writer, sheet_name='
|
| 88 |
order_df.to_excel(writer, sheet_name='Order Data', index=False)
|
| 89 |
cost_df.to_excel(writer, sheet_name='Cost Data', index=False)
|
| 90 |
distance_df.to_excel(writer, sheet_name='Distance Data', index=False)
|
|
@@ -102,7 +102,7 @@ def plot_histograms(excel_filename):
|
|
| 102 |
|
| 103 |
data_sheets = {
|
| 104 |
"Priority": pd.read_excel(xls, "Priority Data")["Priority"],
|
| 105 |
-
"Product Stock": pd.read_excel(xls, "
|
| 106 |
"Order Quantity": pd.read_excel(xls, "Order Data").iloc[:, 1:].values.flatten(),
|
| 107 |
"Cost": pd.read_excel(xls, "Cost Data")["Cost"],
|
| 108 |
"Distance": pd.read_excel(xls, "Distance Data")["Distance"],
|
|
@@ -128,9 +128,9 @@ def plot_histograms(excel_filename):
|
|
| 128 |
if __name__ == "__main__":
|
| 129 |
# Define parameters for execution
|
| 130 |
output_filename = "Intelligent_Sourcing.xlsx"
|
| 131 |
-
num_of_warehouses =
|
| 132 |
-
num_of_products =
|
| 133 |
-
num_of_orders =
|
| 134 |
weightage_Cost = 1
|
| 135 |
weightage_Priority = 0.8
|
| 136 |
weightage_distance = 0.6
|
|
|
|
| 84 |
with pd.ExcelWriter(output_filename, engine='xlsxwriter') as writer:
|
| 85 |
weightage_df.to_excel(writer, sheet_name='Weightage', index=False)
|
| 86 |
priority_df.to_excel(writer, sheet_name='Priority Data', index=False)
|
| 87 |
+
warehouse_df.to_excel(writer, sheet_name='Warehouse Data', index=False)
|
| 88 |
order_df.to_excel(writer, sheet_name='Order Data', index=False)
|
| 89 |
cost_df.to_excel(writer, sheet_name='Cost Data', index=False)
|
| 90 |
distance_df.to_excel(writer, sheet_name='Distance Data', index=False)
|
|
|
|
| 102 |
|
| 103 |
data_sheets = {
|
| 104 |
"Priority": pd.read_excel(xls, "Priority Data")["Priority"],
|
| 105 |
+
"Product Stock": pd.read_excel(xls, "Warehouse Data").iloc[:, 1:].values.flatten(),
|
| 106 |
"Order Quantity": pd.read_excel(xls, "Order Data").iloc[:, 1:].values.flatten(),
|
| 107 |
"Cost": pd.read_excel(xls, "Cost Data")["Cost"],
|
| 108 |
"Distance": pd.read_excel(xls, "Distance Data")["Distance"],
|
|
|
|
| 128 |
if __name__ == "__main__":
|
| 129 |
# Define parameters for execution
|
| 130 |
output_filename = "Intelligent_Sourcing.xlsx"
|
| 131 |
+
num_of_warehouses = 4
|
| 132 |
+
num_of_products = 10
|
| 133 |
+
num_of_orders = 2
|
| 134 |
weightage_Cost = 1
|
| 135 |
weightage_Priority = 0.8
|
| 136 |
weightage_distance = 0.6
|
Read_Data
DELETED
|
File without changes
|
Read_Data.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pulp import *
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import numpy as np
|
| 4 |
+
import xlsxwriter
|
| 5 |
+
|
| 6 |
+
filepath = 'Intelligent_Sourcing.xlsx'
|
| 7 |
+
|
| 8 |
+
#print(excel_file.sheet_names)
|
| 9 |
+
sheets = ['Weightage', 'Priority Data', 'Warehouse Data', 'Order Data', 'Cost Data', 'Distance Data', 'Days Data']
|
| 10 |
+
|
| 11 |
+
weightage_df = pd.read_excel(filepath, sheet_name='Weightage')
|
| 12 |
+
weightage_dict = dict(zip(weightage_df['Variable'], weightage_df['Weightage']))
|
| 13 |
+
Weightage_Cost = weightage_dict["Cost"]
|
| 14 |
+
Weightage_Priority = weightage_dict["Priority"]
|
| 15 |
+
Weightage_distance = weightage_dict["Distance"]
|
| 16 |
+
Weightage_days = weightage_dict["Days"]
|
| 17 |
+
|
| 18 |
+
priority_df = pd.read_excel(filepath, sheet_name='Priority Data')
|
| 19 |
+
warehouse_df = pd.read_excel(filepath, sheet_name='Warehouse Data')
|
| 20 |
+
|
| 21 |
+
print(warehouse_df)
|
histogram_ranges.png
CHANGED
|
|