Skip to content

Commit 340d18a

Browse files
committed
fix: dates
1 parent a1b61fa commit 340d18a

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

notebooks/sn03_aggregate_data.ipynb

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 63,
5+
"execution_count": 74,
66
"id": "d69d493a-0716-47e7-bc80-0ef36753fdf8",
77
"metadata": {},
88
"outputs": [],
@@ -54,7 +54,7 @@
5454
},
5555
{
5656
"cell_type": "code",
57-
"execution_count": 64,
57+
"execution_count": 75,
5858
"id": "7302bac8-3643-4701-a1af-ea028dc8af38",
5959
"metadata": {},
6060
"outputs": [],
@@ -80,7 +80,7 @@
8080
},
8181
{
8282
"cell_type": "code",
83-
"execution_count": 65,
83+
"execution_count": 76,
8484
"id": "d93c4011-0731-4992-9863-c198d570e18e",
8585
"metadata": {},
8686
"outputs": [
@@ -302,7 +302,7 @@
302302
},
303303
{
304304
"cell_type": "code",
305-
"execution_count": 66,
305+
"execution_count": 77,
306306
"id": "5ed00545-9d1e-4521-9d44-c6da89d5e4e5",
307307
"metadata": {},
308308
"outputs": [
@@ -544,7 +544,7 @@
544544
},
545545
{
546546
"cell_type": "code",
547-
"execution_count": 67,
547+
"execution_count": 78,
548548
"id": "9c93b32b-443e-4321-80fa-3d46fa8a0b1d",
549549
"metadata": {},
550550
"outputs": [
@@ -570,7 +570,7 @@
570570
" <tr style=\"text-align: right;\">\n",
571571
" <th></th>\n",
572572
" <th></th>\n",
573-
" <th>Date</th>\n",
573+
" <th></th>\n",
574574
" <th>Item</th>\n",
575575
" <th>Brand</th>\n",
576576
" <th>Price</th>\n",
@@ -580,7 +580,7 @@
580580
" <tr>\n",
581581
" <th>OrderNo</th>\n",
582582
" <th>Empno</th>\n",
583-
" <th></th>\n",
583+
" <th>Date</th>\n",
584584
" <th></th>\n",
585585
" <th></th>\n",
586586
" <th></th>\n",
@@ -592,7 +592,7 @@
592592
" <tr>\n",
593593
" <th>4626232</th>\n",
594594
" <th>9003</th>\n",
595-
" <td>2021-08-042021-08-04</td>\n",
595+
" <th>2021-08-04</th>\n",
596596
" <td>SocksJeans</td>\n",
597597
" <td>VansQuiksilver</td>\n",
598598
" <td>97.0</td>\n",
@@ -602,7 +602,7 @@
602602
" <tr>\n",
603603
" <th>4626377</th>\n",
604604
" <th>9003</th>\n",
605-
" <td>2021-08-052021-08-05</td>\n",
605+
" <th>2021-08-05</th>\n",
606606
" <td>HoodyCargo Shorts</td>\n",
607607
" <td>AnimalAnimal</td>\n",
608608
" <td>82.0</td>\n",
@@ -612,7 +612,7 @@
612612
" <tr>\n",
613613
" <th>4626412</th>\n",
614614
" <th>9004</th>\n",
615-
" <td>2021-08-05</td>\n",
615+
" <th>2021-08-05</th>\n",
616616
" <td>Shirt</td>\n",
617617
" <td>Volcom</td>\n",
618618
" <td>78.0</td>\n",
@@ -622,7 +622,7 @@
622622
" <tr>\n",
623623
" <th>4626490</th>\n",
624624
" <th>9004</th>\n",
625-
" <td>2021-08-062021-08-06</td>\n",
625+
" <th>2021-08-06</th>\n",
626626
" <td>Cargo ShortsSweater</td>\n",
627627
" <td>BillabongDickies</td>\n",
628628
" <td>110.0</td>\n",
@@ -632,7 +632,7 @@
632632
" <tr>\n",
633633
" <th>9423517</th>\n",
634634
" <th>9001</th>\n",
635-
" <td>2021-08-042021-08-04</td>\n",
635+
" <th>2021-08-04</th>\n",
636636
" <td>JeansJacket</td>\n",
637637
" <td>Rip CurlThe North Face</td>\n",
638638
" <td>199.0</td>\n",
@@ -642,7 +642,7 @@
642642
" <tr>\n",
643643
" <th>9423534</th>\n",
644644
" <th>9001</th>\n",
645-
" <td>2021-08-042021-08-04</td>\n",
645+
" <th>2021-08-04</th>\n",
646646
" <td>SocksSocks</td>\n",
647647
" <td>DCQuiksilver</td>\n",
648648
" <td>22.0</td>\n",
@@ -652,7 +652,7 @@
652652
" <tr>\n",
653653
" <th>9423679</th>\n",
654654
" <th>9002</th>\n",
655-
" <td>2021-08-05</td>\n",
655+
" <th>2021-08-05</th>\n",
656656
" <td>T-shirt</td>\n",
657657
" <td>Patagonia</td>\n",
658658
" <td>35.0</td>\n",
@@ -662,7 +662,7 @@
662662
" <tr>\n",
663663
" <th>9423783</th>\n",
664664
" <th>9002</th>\n",
665-
" <td>2021-08-062021-08-06</td>\n",
665+
" <th>2021-08-06</th>\n",
666666
" <td>Boxer ShortsShorts</td>\n",
667667
" <td>SuperdryGlobe</td>\n",
668668
" <td>56.0</td>\n",
@@ -674,27 +674,27 @@
674674
"</div>"
675675
],
676676
"text/plain": [
677-
" Date Item \\\n",
678-
"OrderNo Empno \n",
679-
"4626232 9003 2021-08-042021-08-04 SocksJeans \n",
680-
"4626377 9003 2021-08-052021-08-05 HoodyCargo Shorts \n",
681-
"4626412 9004 2021-08-05 Shirt \n",
682-
"4626490 9004 2021-08-062021-08-06 Cargo ShortsSweater \n",
683-
"9423517 9001 2021-08-042021-08-04 JeansJacket \n",
684-
"9423534 9001 2021-08-042021-08-04 SocksSocks \n",
685-
"9423679 9002 2021-08-05 T-shirt \n",
686-
"9423783 9002 2021-08-062021-08-06 Boxer ShortsShorts \n",
677+
" Item Brand Price \\\n",
678+
"OrderNo Empno Date \n",
679+
"4626232 9003 2021-08-04 SocksJeans VansQuiksilver 97.0 \n",
680+
"4626377 9003 2021-08-05 HoodyCargo Shorts AnimalAnimal 82.0 \n",
681+
"4626412 9004 2021-08-05 Shirt Volcom 78.0 \n",
682+
"4626490 9004 2021-08-06 Cargo ShortsSweater BillabongDickies 110.0 \n",
683+
"9423517 9001 2021-08-04 JeansJacket Rip CurlThe North Face 199.0 \n",
684+
"9423534 9001 2021-08-04 SocksSocks DCQuiksilver 22.0 \n",
685+
"9423679 9002 2021-08-05 T-shirt Patagonia 35.0 \n",
686+
"9423783 9002 2021-08-06 Boxer ShortsShorts SuperdryGlobe 56.0 \n",
687687
"\n",
688-
" Brand Price Quantity Total \n",
689-
"OrderNo Empno \n",
690-
"4626232 9003 VansQuiksilver 97.0 2 97.0 \n",
691-
"4626377 9003 AnimalAnimal 82.0 2 82.0 \n",
692-
"4626412 9004 Volcom 78.0 1 78.0 \n",
693-
"4626490 9004 BillabongDickies 110.0 2 110.0 \n",
694-
"9423517 9001 Rip CurlThe North Face 199.0 2 199.0 \n",
695-
"9423534 9001 DCQuiksilver 22.0 4 44.0 \n",
696-
"9423679 9002 Patagonia 35.0 1 35.0 \n",
697-
"9423783 9002 SuperdryGlobe 56.0 3 86.0 "
688+
" Quantity Total \n",
689+
"OrderNo Empno Date \n",
690+
"4626232 9003 2021-08-04 2 97.0 \n",
691+
"4626377 9003 2021-08-05 2 82.0 \n",
692+
"4626412 9004 2021-08-05 1 78.0 \n",
693+
"4626490 9004 2021-08-06 2 110.0 \n",
694+
"9423517 9001 2021-08-04 2 199.0 \n",
695+
"9423534 9001 2021-08-04 4 44.0 \n",
696+
"9423679 9002 2021-08-05 1 35.0 \n",
697+
"9423783 9002 2021-08-06 3 86.0 "
698698
]
699699
},
700700
"metadata": {},
@@ -704,7 +704,7 @@
704704
"source": [
705705
"# A new DataFrame grouping by Order can be created to sum the total for each order using `groupby`\n",
706706
"\n",
707-
"df_order_totals = df_sales.groupby(['OrderNo', 'Empno']).sum()\n",
707+
"df_order_totals = df_sales.groupby(['OrderNo', 'Empno', 'Date']).sum()\n",
708708
"\n",
709709
"display(df_order_totals)"
710710
]

0 commit comments

Comments
 (0)