Skip to content

Commit b1647c7

Browse files
committed
Update complete_poc_to_production_exercise_set.ipynb
1 parent 58818b1 commit b1647c7

File tree

1 file changed

+57
-17
lines changed

1 file changed

+57
-17
lines changed

optimization301/PoC_to_Production_Exercise/complete_poc_to_production_exercise_set.ipynb

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,46 @@
5757
"import plotly.graph_objects as go"
5858
]
5959
},
60+
{
61+
"cell_type": "markdown",
62+
"id": "3c038388",
63+
"metadata": {},
64+
"source": [
65+
"## Set a path to the data used\n",
66+
"**If you downloaded the notebook/data and are running this locally**, make sure the data is in the same directory as the notebook and run the cell below, or update it to the correct path."
67+
]
68+
},
69+
{
70+
"cell_type": "code",
71+
"execution_count": null,
72+
"id": "7a89d263",
73+
"metadata": {},
74+
"outputs": [],
75+
"source": [
76+
"# Run this cell if you're working locally on your machine.\n",
77+
"# Change the path if needed.\n",
78+
"path = ''"
79+
]
80+
},
81+
{
82+
"cell_type": "markdown",
83+
"id": "f31bd577",
84+
"metadata": {},
85+
"source": [
86+
"**If you are running this in Colab** run this cell below to set the path to read the data from the GitHub repository."
87+
]
88+
},
89+
{
90+
"cell_type": "code",
91+
"execution_count": null,
92+
"id": "f0fd6095",
93+
"metadata": {},
94+
"outputs": [],
95+
"source": [
96+
"# Run this cell if you are using Colab.\n",
97+
"path = 'https://raw.githubusercontent.com/Gurobi/modeling-examples/refs/heads/master/optimization301/PoC_to_Production_Exercise/ex1_orders.csv'"
98+
]
99+
},
60100
{
61101
"cell_type": "markdown",
62102
"id": "9b1d2eb8-8875-4eec-8fca-001285136186",
@@ -70,15 +110,15 @@
70110
},
71111
{
72112
"cell_type": "code",
73-
"execution_count": 2,
113+
"execution_count": null,
74114
"id": "96e1ee44-cd58-4593-bbe9-539cefbefb40",
75115
"metadata": {},
76116
"outputs": [],
77117
"source": [
78118
"def ex1():\n",
79119
" # Load the data\n",
80-
" orders = pd.read_csv('ex1_orders.csv')\n",
81-
" vehicles = pd.read_csv('ex1_vehicles.csv')\n",
120+
" orders = pd.read_csv(path+'ex1_orders.csv')\n",
121+
" vehicles = pd.read_csv(path+'ex1_vehicles.csv')\n",
82122
" num_orders = len(orders)\n",
83123
" num_vehicles = len(vehicles)\n",
84124
" # Build the model\n",
@@ -173,15 +213,15 @@
173213
},
174214
{
175215
"cell_type": "code",
176-
"execution_count": 5,
216+
"execution_count": null,
177217
"id": "2e2c281e-3c4d-4d73-a8f6-38945522163a",
178218
"metadata": {},
179219
"outputs": [],
180220
"source": [
181221
"def ex2():\n",
182-
" dcs_df = pd.read_csv('ex2_dcs.csv')\n",
183-
" cust_df = pd.read_csv('ex2_customers.csv')\n",
184-
" lanes_df = pd.read_csv('ex2_lanes.csv')\n",
222+
" dcs_df = pd.read_csv(path+'ex2_dcs.csv')\n",
223+
" cust_df = pd.read_csv(path+'ex2_customers.csv')\n",
224+
" lanes_df = pd.read_csv(path+'ex2_lanes.csv')\n",
185225
" # Built some objects for convenience and speed\n",
186226
" dc = dcs_df['dc_id'].tolist()\n",
187227
" cust = cust_df['cust_id'].tolist()\n",
@@ -245,7 +285,7 @@
245285
},
246286
{
247287
"cell_type": "code",
248-
"execution_count": 7,
288+
"execution_count": null,
249289
"id": "3feef743-1f31-4fe5-a6fc-d6e75cb1d6a7",
250290
"metadata": {
251291
"editable": true,
@@ -257,8 +297,8 @@
257297
"outputs": [],
258298
"source": [
259299
"def plot_ex2():\n",
260-
" dcs = pd.read_csv('ex2_dcs.csv')\n",
261-
" customers = pd.read_csv('ex2_customers.csv')\n",
300+
" dcs = pd.read_csv(path+'ex2_dcs.csv')\n",
301+
" customers = pd.read_csv(path+'ex2_customers.csv')\n",
262302
" fig = go.Figure()\n",
263303
" # Customers\n",
264304
" fig.add_trace(go.Scattermap(\n",
@@ -1514,15 +1554,15 @@
15141554
},
15151555
{
15161556
"cell_type": "code",
1517-
"execution_count": 10,
1557+
"execution_count": null,
15181558
"id": "704e66ff-cab2-439e-869a-63fcf76e4c19",
15191559
"metadata": {},
15201560
"outputs": [],
15211561
"source": [
15221562
"def ex5():\n",
1523-
" dcs_df = pd.read_csv('ex2_dcs.csv')\n",
1524-
" cust_df = pd.read_csv('ex2_customers.csv')\n",
1525-
" lanes_df = pd.read_csv('ex2_lanes.csv')\n",
1563+
" dcs_df = pd.read_csv(path+'ex2_dcs.csv')\n",
1564+
" cust_df = pd.read_csv(path+'ex2_customers.csv')\n",
1565+
" lanes_df = pd.read_csv(path+'ex2_lanes.csv')\n",
15261566
"\n",
15271567
" # Built some objects for convenience and speed\n",
15281568
" dc = dcs_df['dc_id'].tolist()\n",
@@ -1845,9 +1885,9 @@
18451885
],
18461886
"metadata": {
18471887
"kernelspec": {
1848-
"display_name": "opti",
1888+
"display_name": "Python 3",
18491889
"language": "python",
1850-
"name": "opti"
1890+
"name": "python3"
18511891
},
18521892
"language_info": {
18531893
"codemirror_mode": {
@@ -1859,7 +1899,7 @@
18591899
"name": "python",
18601900
"nbconvert_exporter": "python",
18611901
"pygments_lexer": "ipython3",
1862-
"version": "3.11.13"
1902+
"version": "3.13.5"
18631903
}
18641904
},
18651905
"nbformat": 4,

0 commit comments

Comments
 (0)