Skip to content

Commit

Permalink
few updates of dependencies and changed code where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
sepro committed Jan 9, 2025
1 parent 686672c commit 88c1e00
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 53 deletions.
2 changes: 1 addition & 1 deletion data/orders_by_country.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Malta,32.0,4,12.86,1
Netherlands,186.55,25,36.25,9
Poland,30.6,25,7.27,3
Portugal,1.5,6,2.53,1
Spain,101.38,43,22.13,9
Spain,103.58,48,25.209999999999997,10
Sweden,4.6,9,7.59,3
United Kingdom,56.0,2,15.389999999999999,2
1 change: 1 addition & 0 deletions data/orders_by_location.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lng,lat,card_value,card_count,shipping,order_count,zip,city,country
-0.1077723,51.6369319,49.0,1,12.86,1,N21 1LN,London,United Kingdom
0.511695,43.76052199999999,3.5,1,2.53,1,32360,Lavardens,France
1.6979398,41.3461265,20.9,5,2.21,1,08720,Vilafranca Del Penedes,Spain
2.2285864,41.45476379999999,2.2,5,3.08,1,08917,Badalona,Spain
2.381153,48.85799300000001,2.4,1,2.53,1,75011,Paris,France
2.566932,49.647007,9.2,4,2.53,1,80500,Montdidier,France
2.7630471,41.6528561,3.6,4,2.53,1,08380,Malgrat de Mar,Spain
Expand Down
56 changes: 28 additions & 28 deletions data/orders_by_location_cluster.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@ lng,lat,city,card_value,card_count,shipping,order_count,country,locations
4.5900372,51.048512366666664,"Burcht, Antwerp, Mechelen, Rotselaar, Kessel-Lo, Aarschot",145.5,19,11.69,6,Belgium,6
5.37187325,52.385556949999994,"Amsterdam, Amsterdam, Lelystad, Deventer",60.55,20,12.329999999999998,5,Netherlands,4
3.9067499333333333,50.82941056666667,"Gent, Lede, HavrA(c)",96.3,16,13.06,5,Belgium,3
10.061879350000002,53.4504261,"Norderstedt, Salzhausen",17.1,4,4.74,2,Germany,2
2.229857766666667,41.484582133333326,"Vilafranca Del Penedes, Badalona, Malgrat de Mar",26.7,14,7.82,3,Spain,3
4.3779134,51.962655899999994,"Spijkenisse, Leidschendam",12.5,3,4.42,2,Netherlands,2
2.4740425,49.252500000000005,"Paris, Montdidier",11.6,5,5.06,2,France,2
13.736462450000001,50.7766262,"Altenberg, Altenberg",37.5,18,4.74,2,Germany,2
14.34435195,40.7813868,"Napoli, Castellammare Di Stabia (NA)",7.4,10,5.06,2,Italy,2
10.061879350000002,53.4504261,"Norderstedt, Salzhausen",17.1,4,4.74,2,Germany,2
10.1071214,52.3559349,"Wietze, Salzgitter",73.9,4,14.43,2,Germany,2
8.4890426,49.1854975,"Graben-Neudorf, Waghausel",51.1,9,15.79,3,Germany,2
6.35904665,53.2055967,"Kollum, Eelde",113.5,2,19.5,2,Netherlands,2
5.475830899999999,50.75591024999999,"Hasselt, Embourg",0.9,58,1.4,2,Belgium,2
4.3779134,51.962655899999994,"Spijkenisse, Leidschendam",12.5,3,4.42,2,Netherlands,2
2.23049345,41.4994913,"Vilafranca Del Penedes, Malgrat de Mar",24.5,9,4.74,2,Spain,2
17.66665,49.2380088,Zlin,15.35,5,2.21,1,Czech Republic,1
12.5179439,55.681845,Frederiksberg,2.36,6,2.53,1,Denmark,1
18.0077781,59.3179883,Stockholm,1.2,1,2.53,1,Sweden,1
19.1851996,50.3000762,Sosnowiec,3.3,6,2.53,1,Poland,1
20.2299725,63.8299073,Umea,2.4,4,2.53,1,Sweden,1
16.8498282,46.8379252,Zalaegerszeg,4.0,5,2.21,1,Hungary,1
22.0025444,50.0400986,Rzeszow,18.3,17,2.21,1,Poland,1
16.3541243,48.1857835,Wien,3.5,1,2.53,1,Austria,1
23.4711986,51.1431232,Chelm,9.0,2,2.53,1,Poland,1
14.7890198,55.1136597,Ronne,5.5,1,2.53,1,Denmark,1
14.4945303,50.0558866,Praha 10,6.75,3,2.53,1,Czech Republic,1
14.4694186,35.9191182,Swieqi,32.0,4,12.86,1,Malta,1
24.6485052,60.2043994,Espoo,1.8,8,3.08,1,Finland,1
26.7084346,58.3511805,Tartu,5.5,1,2.21,1,Estonia,1
13.4035426,52.33435799999999,Blankenfelde OT Dahlewitz,9.2,6,2.21,1,Germany,1
14.34435195,40.7813868,"Napoli, Castellammare Di Stabia (NA)",7.4,10,5.06,2,Italy,2
-13.6073332,28.9937063,Las Palmas de Gran Canaria,7.78,2,2.53,1,Spain,1
11.9836846,57.6817979,GAPteborg,1.0,4,2.53,1,Sweden,1
-1.8391485,39.0019158,Albacete,5.4,3,2.21,1,Spain,1
-1.2070113,37.9287007,Sangonera la Verde (Murcia),17.7,7,2.53,1,Spain,1
-0.1077723,51.6369319,London,49.0,1,12.86,1,United Kingdom,1
0.511695,43.76052199999999,Lavardens,3.5,1,2.53,1,France,1
-8.665559199999999,43.2275012,Carballo,36.0,3,5.06,2,Spain,1
-5.935878199999999,54.62485299999999,Belfast,7.0,1,2.53,1,United Kingdom,1
-4.474826,36.6819541,Malaga,2.0,2,2.53,1,Spain,1
-2.9238378,43.2571974,Bilbao,8.0,17,2.53,1,Spain,1
-1.8391485,39.0019158,Albacete,5.4,3,2.21,1,Spain,1
-1.2070113,37.9287007,Sangonera la Verde (Murcia),17.7,7,2.53,1,Spain,1
0.511695,43.76052199999999,Lavardens,3.5,1,2.53,1,France,1
11.4842864,48.1892389,Munchen,16.2,2,2.53,1,Germany,1
6.1737197,48.6896459,Nancy,15.0,3,2.21,1,France,1
9.0286944,54.7906442,Achtrup,4.5,4,2.21,1,Germany,1
9.8889002,57.0384773,Aalborg,2.0,9,2.53,1,Denmark,1
-9.1567364,38.7825557,Lisboa,1.5,6,2.53,1,Portugal,1
10.0226511,45.133249,Cremona,18.0,8,2.21,1,Italy,1
9.8889002,57.0384773,Aalborg,2.0,9,2.53,1,Denmark,1
9.0286944,54.7906442,Achtrup,4.5,4,2.21,1,Germany,1
10.4003284,43.7309683,Pisa,8.4,4,2.53,1,Italy,1
11.4842864,48.1892389,Munchen,16.2,2,2.53,1,Germany,1
11.9836846,57.6817979,GAPteborg,1.0,4,2.53,1,Sweden,1
10.0226511,45.133249,Cremona,18.0,8,2.21,1,Italy,1
6.1737197,48.6896459,Nancy,15.0,3,2.21,1,France,1
13.4035426,52.33435799999999,Blankenfelde OT Dahlewitz,9.2,6,2.21,1,Germany,1
12.5179439,55.681845,Frederiksberg,2.36,6,2.53,1,Denmark,1
14.4694186,35.9191182,Swieqi,32.0,4,12.86,1,Malta,1
14.4945303,50.0558866,Praha 10,6.75,3,2.53,1,Czech Republic,1
14.7890198,55.1136597,Ronne,5.5,1,2.53,1,Denmark,1
16.3541243,48.1857835,Wien,3.5,1,2.53,1,Austria,1
16.8498282,46.8379252,Zalaegerszeg,4.0,5,2.21,1,Hungary,1
17.66665,49.2380088,Zlin,15.35,5,2.21,1,Czech Republic,1
18.0077781,59.3179883,Stockholm,1.2,1,2.53,1,Sweden,1
19.1851996,50.3000762,Sosnowiec,3.3,6,2.53,1,Poland,1
20.2299725,63.8299073,Umea,2.4,4,2.53,1,Sweden,1
22.0025444,50.0400986,Rzeszow,18.3,17,2.21,1,Poland,1
23.4711986,51.1431232,Chelm,9.0,2,2.53,1,Poland,1
24.6485052,60.2043994,Espoo,1.8,8,3.08,1,Finland,1
26.7084346,58.3511805,Tartu,5.5,1,2.21,1,Estonia,1
27.6791386,62.9541405,Kuopio,2.0,2,2.95,1,Finland,1
8 changes: 4 additions & 4 deletions data/orders_summary.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
,total
card_value,977.49
card_count,326.0
shipping,221.72999999999996
order_count,71.0
card_value,979.6899999999999
card_count,331.0
shipping,224.80999999999997
order_count,72.0
1 change: 1 addition & 0 deletions data/shipped_orders.csv
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ shipment_id,zip,city,country,card_value,card_count,shipping,order_date,lng,lat
1114456426,9000,Gent,Belgium,2.1,3,1.69,"Tue, 23 May 2023 15:07:48 +0000",3.7290914,51.06783069999999
1167148303,76676,Graben-Neudorf,Germany,2.25,3,3.08,"Fri, 26 Jul 2024 08:40:58 +0000",8.4644509,49.1465388
1169660043,02770,Espoo,Finland,1.8,8,3.08,"Tue, 13 Aug 2024 18:08:48 +0000",24.6485052,60.2043994
1186802423,08917,Badalona,Spain,2.2,5,3.08,"Thu, 19 Dec 2024 04:12:52 +0000",2.2285864,41.45476379999999
4 changes: 2 additions & 2 deletions docs/index.html

Large diffs are not rendered by default.

Binary file added environment.yml
Binary file not shown.
2 changes: 1 addition & 1 deletion mtg_map.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions operations/grouping.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ def groupby_country(df: pd.DataFrame):
return (
df.groupby(["country"])
.agg(
card_value=pd.NamedAgg("card_value", sum),
card_count=pd.NamedAgg("card_count", sum),
shipping=pd.NamedAgg("shipping", sum),
card_value=pd.NamedAgg("card_value", "sum"),
card_count=pd.NamedAgg("card_count", "sum"),
shipping=pd.NamedAgg("shipping", "sum"),
order_count=pd.NamedAgg("shipping", "count"),
)
.reset_index()
Expand All @@ -26,9 +26,9 @@ def groupby_location(df: pd.DataFrame):
return (
df.groupby(["lng", "lat"])
.agg(
card_value=pd.NamedAgg("card_value", sum),
card_count=pd.NamedAgg("card_count", sum),
shipping=pd.NamedAgg("shipping", sum),
card_value=pd.NamedAgg("card_value", "sum"),
card_count=pd.NamedAgg("card_count", "sum"),
shipping=pd.NamedAgg("shipping", "sum"),
order_count=pd.NamedAgg("shipping", "count"),
zip=pd.NamedAgg("zip", "first"),
city=pd.NamedAgg("city", "first"),
Expand Down
11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

0 comments on commit 88c1e00

Please sign in to comment.