{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "f5cc0f6b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Brand-NameAudience scorePriceTrail terrainShock absorptionEnergy returnTractionArch supportWeight lab Weight brandLightweight...Heel stack lab Heel stack brandForefoot lab Forefoot brandWidths availableFor heavy runnersSeasonRemovable insoleOrthotic friendlyWaterproofingRankingPopularity
0Adidas Terrex Agravic Speed Ultra90 Great!$220LightModerateHigh-Neutral9.1 oz / 259g 9.5 oz / 270g0.0...30.6 mm 38.0 mm30.3 mm 30.0 mmNormal0.0All seasons11-#76 Top 21%#177 Top 47%
1Adidas Terrex Speed Ultra90 Great!3559500 RpLight---Neutral9.1 oz / 258g 9 oz / 255g0.0...32.8 mm 26.0 mm24.6 mm 18.0 mmNormal0.0-11-#49 Top 13%#298 Bottom 21%
2Altra Experience Wild88 Great!2966250 RpLight ModerateModerateLow-Neutral10.1 oz / 285g 9.6 oz / 273g0.0...34.5 mm 34.0 mm30.2 mm 30.0 mmNormal0.0All seasons11-#263 Top 40%#326 Top 49%
3Altra Experience Wild 284 Good!2966250 RpLightModerateLowHighNeutral9.4 oz / 266g 10.3 oz / 293g0.0...32.3 mm 32.0 mm26.2 mm 28.0 mmNormal0.0All seasons11-#245 Bottom 35%#154 Top 41%
4Altra Lone Peak 5.091 Superb!$130Light Moderate---Neutral10.7 oz / 302g 10.6 oz / 301g0.0...24.5 mm 25.0 mm24.3 mm 25.0 mmNormal0.0-11-#68 Top 11%#55 Top 9%
\n", "

5 rows × 36 columns

\n", "
" ], "text/plain": [ " Brand-Name Audience score Price \\\n", "0 Adidas Terrex Agravic Speed Ultra 90 Great! $220 \n", "1 Adidas Terrex Speed Ultra 90 Great! 3559500 Rp \n", "2 Altra Experience Wild 88 Great! 2966250 Rp \n", "3 Altra Experience Wild 2 84 Good! 2966250 Rp \n", "4 Altra Lone Peak 5.0 91 Superb! $130 \n", "\n", " Trail terrain Shock absorption Energy return Traction Arch support \\\n", "0 Light Moderate High - Neutral \n", "1 Light - - - Neutral \n", "2 Light Moderate Moderate Low - Neutral \n", "3 Light Moderate Low High Neutral \n", "4 Light Moderate - - - Neutral \n", "\n", " Weight lab Weight brand Lightweight ... \\\n", "0 9.1 oz / 259g 9.5 oz / 270g 0.0 ... \n", "1 9.1 oz / 258g 9 oz / 255g 0.0 ... \n", "2 10.1 oz / 285g 9.6 oz / 273g 0.0 ... \n", "3 9.4 oz / 266g 10.3 oz / 293g 0.0 ... \n", "4 10.7 oz / 302g 10.6 oz / 301g 0.0 ... \n", "\n", " Heel stack lab Heel stack brand Forefoot lab Forefoot brand \\\n", "0 30.6 mm 38.0 mm 30.3 mm 30.0 mm \n", "1 32.8 mm 26.0 mm 24.6 mm 18.0 mm \n", "2 34.5 mm 34.0 mm 30.2 mm 30.0 mm \n", "3 32.3 mm 32.0 mm 26.2 mm 28.0 mm \n", "4 24.5 mm 25.0 mm 24.3 mm 25.0 mm \n", "\n", " Widths available For heavy runners Season Removable insole \\\n", "0 Normal 0.0 All seasons 1 \n", "1 Normal 0.0 - 1 \n", "2 Normal 0.0 All seasons 1 \n", "3 Normal 0.0 All seasons 1 \n", "4 Normal 0.0 - 1 \n", "\n", " Orthotic friendly Waterproofing Ranking Popularity \n", "0 1 - #76 Top 21% #177 Top 47% \n", "1 1 - #49 Top 13% #298 Bottom 21% \n", "2 1 - #263 Top 40% #326 Top 49% \n", "3 1 - #245 Bottom 35% #154 Top 41% \n", "4 1 - #68 Top 11% #55 Top 9% \n", "\n", "[5 rows x 36 columns]" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "\n", "df_ori = pd.read_csv('../../data/SONIX utilities - Trail.csv')\n", "df_ori.head()" ] }, { "cell_type": "markdown", "id": "ccddc8ad", "metadata": {}, "source": [ "# Separate Brand-Name" ] }, { "cell_type": "code", "execution_count": 2, "id": "20d5e4a3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Brand-NameAudience scorePriceTrail terrainShock absorptionEnergy returnTractionArch supportWeight lab Weight brandLightweight...Heel stack lab Heel stack brandForefoot lab Forefoot brandWidths availableFor heavy runnersSeasonRemovable insoleOrthotic friendlyWaterproofingRankingPopularity
0adidas terrex agravic speed ultra90 Great!$220LightModerateHigh-Neutral9.1 oz / 259g 9.5 oz / 270g0.0...30.6 mm 38.0 mm30.3 mm 30.0 mmNormal0.0All seasons11-#76 Top 21%#177 Top 47%
1adidas terrex speed ultra90 Great!3559500 RpLight---Neutral9.1 oz / 258g 9 oz / 255g0.0...32.8 mm 26.0 mm24.6 mm 18.0 mmNormal0.0-11-#49 Top 13%#298 Bottom 21%
2altra experience wild88 Great!2966250 RpLight ModerateModerateLow-Neutral10.1 oz / 285g 9.6 oz / 273g0.0...34.5 mm 34.0 mm30.2 mm 30.0 mmNormal0.0All seasons11-#263 Top 40%#326 Top 49%
3altra experience wild 284 Good!2966250 RpLightModerateLowHighNeutral9.4 oz / 266g 10.3 oz / 293g0.0...32.3 mm 32.0 mm26.2 mm 28.0 mmNormal0.0All seasons11-#245 Bottom 35%#154 Top 41%
4altra lone peak 5.091 Superb!$130Light Moderate---Neutral10.7 oz / 302g 10.6 oz / 301g0.0...24.5 mm 25.0 mm24.3 mm 25.0 mmNormal0.0-11-#68 Top 11%#55 Top 9%
5altra lone peak 689 Great!$140Moderate Technical---Neutral9.8 oz / 278g 9.7 oz / 275g0.0...25.1 mm 25.0 mm24.5 mm 25.0 mmNormal Wide0.0-00-#147 Top 22%#341 Bottom 49%
6altra lone peak 786 Good!3164000 RpModerate---Neutral10.4 oz / 294g 11 oz / 312g0.0...23.3 mm 25.0 mm23.1 mm 25.0 mmNormal Wide0.0All seasons11-#403 Bottom 40%#273 Top 41%
7altra lone peak 881 Good!$140Light Moderate---Neutral10.2 oz / 288g 10.7 oz / 303g0.0...22.7 mm 25.0 mm21.3 mm 25.0 mmNormal Wide0.0All seasons11-#567 Bottom 15%#177 Top 27%
8altra lone peak 991 Superb!$140Light ModerateLowModerate-Neutral10.9 oz / 309g 10.4 oz / 295g0.0...23.3 mm 25.0 mm23.3 mm 25.0 mmNormal Wide0.0All seasons11-#25 Top 7%#41 Top 11%
9altra mont blanc79 Good!$180Light Moderate---Neutral9.6 oz / 272g 9.9 oz / 280g0.0...33.8 mm 30.0 mm33.8 mmNormal Wide0.0-00-#332 Bottom 12%#241 Bottom 36%
10altra mont blanc carbon86 Good!4943750 RpModerate---Neutral8.9 oz / 251g 9.3 oz / 264g0.0...27.2 mm 29.0 mm26.9 mm 29.0 mmNormal0.0All seasons11-#189 Top 50%#273 Bottom 27%
11altra olympus 27582 Good!3856130 RpLightModerateLowHighNeutral10.7 oz / 303g 10.8 oz / 305g0.0...30.8 mm 33.0 mm30.5 mm 33.0 mmNormal0.0All seasons11-#298 Bottom 21%#240 Bottom 36%
12altra olympus 583 Good!3558800 RpLight Moderate---Neutral11.5 oz / 325g 12.3 oz / 350g0.0...33.0 mm 33.0 mm31.0 mm 33.0 mmNormal0.0All seasons11-#526 Bottom 21%#302 Top 45%
13altra olympus 683 Good!$175Light ModerateModerateModerate-Neutral12.6 oz / 357g 12.5 oz / 354g0.0...32.2 mm 35.0 mm31.5 mm 35.0 mmNormal1.0Summer All seasons11-#273 Bottom 27%#116 Top 31%
14altra outroad81 Good!2966250 RpLight---Neutral10.1 oz / 287g 10.7 oz / 303g0.0...25.1 mm 27.0 mm25.0 mm 27.0 mmNormal0.0All seasons11-#578 Bottom 14%#527 Bottom 21%
15altra outroad 279 Good!2570750 RpLight---Neutral10.3 oz / 291g 10.1 oz / 286g0.0...26.9 mm 27.5 mm25.5 mm 27.5 mmNormal0.0All seasons11-#610 Bottom 9%#564 Bottom 16%
16altra outroad 381 Good!2570750 RpLight---Neutral9.2 oz / 261g 10.7 oz / 303g0.0...23.8 mm 27.0 mm23.2 mm 27.0 mmNormal0.0All seasons11-#313 Bottom 17%#283 Bottom 25%
17altra superior 678 Decent!$130Light Moderate---Neutral9.6 oz / 272g 9.1 oz / 258g0.0...22.1 mm 20.5 mm22.0 mm 20.5 mmNormal0.0Summer All seasons11-#631 Bottom 6%#524 Bottom 22%
18altra superior 782 Good!2373000 RpLightLowLowHighNeutral8.3 oz / 235g 9.3 oz / 263g1.0...20.6 mm 21.0 mm20.0 mm 21.0 mmNormal0.0All seasons11-#293 Bottom 22%#271 Bottom 28%
19altra timp 478 Decent!3164000 RpLight Moderate---Neutral11.1 oz / 316g 10.6 oz / 300g0.0...29.0 mm 30.0 mm28.9 mm 30.0 mmNormal0.0All seasons11-#626 Bottom 6%#523 Bottom 22%
\n", "

20 rows × 36 columns

\n", "
" ], "text/plain": [ " Brand-Name Audience score Price \\\n", "0 adidas terrex agravic speed ultra 90 Great! $220 \n", "1 adidas terrex speed ultra 90 Great! 3559500 Rp \n", "2 altra experience wild 88 Great! 2966250 Rp \n", "3 altra experience wild 2 84 Good! 2966250 Rp \n", "4 altra lone peak 5.0 91 Superb! $130 \n", "5 altra lone peak 6 89 Great! $140 \n", "6 altra lone peak 7 86 Good! 3164000 Rp \n", "7 altra lone peak 8 81 Good! $140 \n", "8 altra lone peak 9 91 Superb! $140 \n", "9 altra mont blanc 79 Good! $180 \n", "10 altra mont blanc carbon 86 Good! 4943750 Rp \n", "11 altra olympus 275 82 Good! 3856130 Rp \n", "12 altra olympus 5 83 Good! 3558800 Rp \n", "13 altra olympus 6 83 Good! $175 \n", "14 altra outroad 81 Good! 2966250 Rp \n", "15 altra outroad 2 79 Good! 2570750 Rp \n", "16 altra outroad 3 81 Good! 2570750 Rp \n", "17 altra superior 6 78 Decent! $130 \n", "18 altra superior 7 82 Good! 2373000 Rp \n", "19 altra timp 4 78 Decent! 3164000 Rp \n", "\n", " Trail terrain Shock absorption Energy return Traction Arch support \\\n", "0 Light Moderate High - Neutral \n", "1 Light - - - Neutral \n", "2 Light Moderate Moderate Low - Neutral \n", "3 Light Moderate Low High Neutral \n", "4 Light Moderate - - - Neutral \n", "5 Moderate Technical - - - Neutral \n", "6 Moderate - - - Neutral \n", "7 Light Moderate - - - Neutral \n", "8 Light Moderate Low Moderate - Neutral \n", "9 Light Moderate - - - Neutral \n", "10 Moderate - - - Neutral \n", "11 Light Moderate Low High Neutral \n", "12 Light Moderate - - - Neutral \n", "13 Light Moderate Moderate Moderate - Neutral \n", "14 Light - - - Neutral \n", "15 Light - - - Neutral \n", "16 Light - - - Neutral \n", "17 Light Moderate - - - Neutral \n", "18 Light Low Low High Neutral \n", "19 Light Moderate - - - Neutral \n", "\n", " Weight lab Weight brand Lightweight ... \\\n", "0 9.1 oz / 259g 9.5 oz / 270g 0.0 ... \n", "1 9.1 oz / 258g 9 oz / 255g 0.0 ... \n", "2 10.1 oz / 285g 9.6 oz / 273g 0.0 ... \n", "3 9.4 oz / 266g 10.3 oz / 293g 0.0 ... \n", "4 10.7 oz / 302g 10.6 oz / 301g 0.0 ... \n", "5 9.8 oz / 278g 9.7 oz / 275g 0.0 ... \n", "6 10.4 oz / 294g 11 oz / 312g 0.0 ... \n", "7 10.2 oz / 288g 10.7 oz / 303g 0.0 ... \n", "8 10.9 oz / 309g 10.4 oz / 295g 0.0 ... \n", "9 9.6 oz / 272g 9.9 oz / 280g 0.0 ... \n", "10 8.9 oz / 251g 9.3 oz / 264g 0.0 ... \n", "11 10.7 oz / 303g 10.8 oz / 305g 0.0 ... \n", "12 11.5 oz / 325g 12.3 oz / 350g 0.0 ... \n", "13 12.6 oz / 357g 12.5 oz / 354g 0.0 ... \n", "14 10.1 oz / 287g 10.7 oz / 303g 0.0 ... \n", "15 10.3 oz / 291g 10.1 oz / 286g 0.0 ... \n", "16 9.2 oz / 261g 10.7 oz / 303g 0.0 ... \n", "17 9.6 oz / 272g 9.1 oz / 258g 0.0 ... \n", "18 8.3 oz / 235g 9.3 oz / 263g 1.0 ... \n", "19 11.1 oz / 316g 10.6 oz / 300g 0.0 ... \n", "\n", " Heel stack lab Heel stack brand Forefoot lab Forefoot brand \\\n", "0 30.6 mm 38.0 mm 30.3 mm 30.0 mm \n", "1 32.8 mm 26.0 mm 24.6 mm 18.0 mm \n", "2 34.5 mm 34.0 mm 30.2 mm 30.0 mm \n", "3 32.3 mm 32.0 mm 26.2 mm 28.0 mm \n", "4 24.5 mm 25.0 mm 24.3 mm 25.0 mm \n", "5 25.1 mm 25.0 mm 24.5 mm 25.0 mm \n", "6 23.3 mm 25.0 mm 23.1 mm 25.0 mm \n", "7 22.7 mm 25.0 mm 21.3 mm 25.0 mm \n", "8 23.3 mm 25.0 mm 23.3 mm 25.0 mm \n", "9 33.8 mm 30.0 mm 33.8 mm \n", "10 27.2 mm 29.0 mm 26.9 mm 29.0 mm \n", "11 30.8 mm 33.0 mm 30.5 mm 33.0 mm \n", "12 33.0 mm 33.0 mm 31.0 mm 33.0 mm \n", "13 32.2 mm 35.0 mm 31.5 mm 35.0 mm \n", "14 25.1 mm 27.0 mm 25.0 mm 27.0 mm \n", "15 26.9 mm 27.5 mm 25.5 mm 27.5 mm \n", "16 23.8 mm 27.0 mm 23.2 mm 27.0 mm \n", "17 22.1 mm 20.5 mm 22.0 mm 20.5 mm \n", "18 20.6 mm 21.0 mm 20.0 mm 21.0 mm \n", "19 29.0 mm 30.0 mm 28.9 mm 30.0 mm \n", "\n", " Widths available For heavy runners Season Removable insole \\\n", "0 Normal 0.0 All seasons 1 \n", "1 Normal 0.0 - 1 \n", "2 Normal 0.0 All seasons 1 \n", "3 Normal 0.0 All seasons 1 \n", "4 Normal 0.0 - 1 \n", "5 Normal Wide 0.0 - 0 \n", "6 Normal Wide 0.0 All seasons 1 \n", "7 Normal Wide 0.0 All seasons 1 \n", "8 Normal Wide 0.0 All seasons 1 \n", "9 Normal Wide 0.0 - 0 \n", "10 Normal 0.0 All seasons 1 \n", "11 Normal 0.0 All seasons 1 \n", "12 Normal 0.0 All seasons 1 \n", "13 Normal 1.0 Summer All seasons 1 \n", "14 Normal 0.0 All seasons 1 \n", "15 Normal 0.0 All seasons 1 \n", "16 Normal 0.0 All seasons 1 \n", "17 Normal 0.0 Summer All seasons 1 \n", "18 Normal 0.0 All seasons 1 \n", "19 Normal 0.0 All seasons 1 \n", "\n", " Orthotic friendly Waterproofing Ranking Popularity \n", "0 1 - #76 Top 21% #177 Top 47% \n", "1 1 - #49 Top 13% #298 Bottom 21% \n", "2 1 - #263 Top 40% #326 Top 49% \n", "3 1 - #245 Bottom 35% #154 Top 41% \n", "4 1 - #68 Top 11% #55 Top 9% \n", "5 0 - #147 Top 22% #341 Bottom 49% \n", "6 1 - #403 Bottom 40% #273 Top 41% \n", "7 1 - #567 Bottom 15% #177 Top 27% \n", "8 1 - #25 Top 7% #41 Top 11% \n", "9 0 - #332 Bottom 12% #241 Bottom 36% \n", "10 1 - #189 Top 50% #273 Bottom 27% \n", "11 1 - #298 Bottom 21% #240 Bottom 36% \n", "12 1 - #526 Bottom 21% #302 Top 45% \n", "13 1 - #273 Bottom 27% #116 Top 31% \n", "14 1 - #578 Bottom 14% #527 Bottom 21% \n", "15 1 - #610 Bottom 9% #564 Bottom 16% \n", "16 1 - #313 Bottom 17% #283 Bottom 25% \n", "17 1 - #631 Bottom 6% #524 Bottom 22% \n", "18 1 - #293 Bottom 22% #271 Bottom 28% \n", "19 1 - #626 Bottom 6% #523 Bottom 22% \n", "\n", "[20 rows x 36 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Ubah jadi lowercase biar memudahkan searching dsb\n", "df_ori['Brand-Name'] = df_ori['Brand-Name'].str.lower()\n", "df_ori.head(20)" ] }, { "cell_type": "code", "execution_count": 3, "id": "0bebd201", "metadata": {}, "outputs": [], "source": [ "''' \n", "Running shoes for trail brand in our dataset include:\n", " Adidas\n", " Altra\n", " ASICS\n", " Brooks\n", " HOKA\n", " Icebug\n", " Inov8\n", " Kailas\n", " KEEN\n", " La Sportiva\n", " Merrell\n", " New Balance\n", " Nike\n", " NNormal\n", " On\n", " Salomon\n", " Saucony\n", " Topo\n", " Xero\n", " Scarpa\n", " The North Face\n", "'''\n", "\n", "brands_list = [\n", " \"Adidas\", \"Altra\", \"ASICS\", \"Brooks\", \"HOKA\", \"Icebug\", \"Inov8\", \n", " \"Kailas\", \"KEEN\", \"La Sportiva\", \"Merrell\", \"New Balance\", \"Nike\", \n", " \"NNormal\", \"On\", \"Salomon\", \"Saucony\", \"Topo\", \"Xero\", \"Scarpa\", \n", " \"The North Face\"\n", "]\n", "brands = [b.lower() for b in brands_list]\n", "brands.sort(key=len, reverse=True)" ] }, { "cell_type": "code", "execution_count": 4, "id": "3a304c3d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BrandNameAudience scorePriceTrail terrainShock absorptionEnergy returnTractionArch supportWeight lab Weight brand...Heel stack lab Heel stack brandForefoot lab Forefoot brandWidths availableFor heavy runnersSeasonRemovable insoleOrthotic friendlyWaterproofingRankingPopularity
0adidasterrex agravic speed ultra90 Great!$220LightModerateHigh-Neutral9.1 oz / 259g 9.5 oz / 270g...30.6 mm 38.0 mm30.3 mm 30.0 mmNormal0.0All seasons11-#76 Top 21%#177 Top 47%
1adidasterrex speed ultra90 Great!3559500 RpLight---Neutral9.1 oz / 258g 9 oz / 255g...32.8 mm 26.0 mm24.6 mm 18.0 mmNormal0.0-11-#49 Top 13%#298 Bottom 21%
2altraexperience wild88 Great!2966250 RpLight ModerateModerateLow-Neutral10.1 oz / 285g 9.6 oz / 273g...34.5 mm 34.0 mm30.2 mm 30.0 mmNormal0.0All seasons11-#263 Top 40%#326 Top 49%
3altraexperience wild 284 Good!2966250 RpLightModerateLowHighNeutral9.4 oz / 266g 10.3 oz / 293g...32.3 mm 32.0 mm26.2 mm 28.0 mmNormal0.0All seasons11-#245 Bottom 35%#154 Top 41%
4altralone peak 5.091 Superb!$130Light Moderate---Neutral10.7 oz / 302g 10.6 oz / 301g...24.5 mm 25.0 mm24.3 mm 25.0 mmNormal0.0-11-#68 Top 11%#55 Top 9%
\n", "

5 rows × 37 columns

\n", "
" ], "text/plain": [ " Brand Name Audience score Price \\\n", "0 adidas terrex agravic speed ultra 90 Great! $220 \n", "1 adidas terrex speed ultra 90 Great! 3559500 Rp \n", "2 altra experience wild 88 Great! 2966250 Rp \n", "3 altra experience wild 2 84 Good! 2966250 Rp \n", "4 altra lone peak 5.0 91 Superb! $130 \n", "\n", " Trail terrain Shock absorption Energy return Traction Arch support \\\n", "0 Light Moderate High - Neutral \n", "1 Light - - - Neutral \n", "2 Light Moderate Moderate Low - Neutral \n", "3 Light Moderate Low High Neutral \n", "4 Light Moderate - - - Neutral \n", "\n", " Weight lab Weight brand ... Heel stack lab Heel stack brand \\\n", "0 9.1 oz / 259g 9.5 oz / 270g ... 30.6 mm 38.0 mm \n", "1 9.1 oz / 258g 9 oz / 255g ... 32.8 mm 26.0 mm \n", "2 10.1 oz / 285g 9.6 oz / 273g ... 34.5 mm 34.0 mm \n", "3 9.4 oz / 266g 10.3 oz / 293g ... 32.3 mm 32.0 mm \n", "4 10.7 oz / 302g 10.6 oz / 301g ... 24.5 mm 25.0 mm \n", "\n", " Forefoot lab Forefoot brand Widths available For heavy runners Season \\\n", "0 30.3 mm 30.0 mm Normal 0.0 All seasons \n", "1 24.6 mm 18.0 mm Normal 0.0 - \n", "2 30.2 mm 30.0 mm Normal 0.0 All seasons \n", "3 26.2 mm 28.0 mm Normal 0.0 All seasons \n", "4 24.3 mm 25.0 mm Normal 0.0 - \n", "\n", " Removable insole Orthotic friendly Waterproofing Ranking \\\n", "0 1 1 - #76 Top 21% \n", "1 1 1 - #49 Top 13% \n", "2 1 1 - #263 Top 40% \n", "3 1 1 - #245 Bottom 35% \n", "4 1 1 - #68 Top 11% \n", "\n", " Popularity \n", "0 #177 Top 47% \n", "1 #298 Bottom 21% \n", "2 #326 Top 49% \n", "3 #154 Top 41% \n", "4 #55 Top 9% \n", "\n", "[5 rows x 37 columns]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def split_brand_name(full_text):\n", " for brand in brands:\n", " if full_text.startswith(brand):\n", " # Sisa dari brand dijadiin name semua\n", " name = full_text[len(brand):].strip()\n", " return brand, name\n", " return \"Unknown\", full_text \n", "\n", "\n", "df_ori[['Brand', 'Name']] = df_ori['Brand-Name'].apply(lambda x: pd.Series(split_brand_name(x)))\n", "\n", "# Atur urutan kolom agar Brand dan Name ada di depan\n", "cols = ['Brand', 'Name'] + [c for c in df_ori.columns if c not in ['Brand', 'Name', 'Brand-Name']]\n", "df_ori = df_ori[cols]\n", "\n", "df_ori.head()" ] }, { "cell_type": "code", "execution_count": 5, "id": "d7d61ef1", "metadata": {}, "outputs": [], "source": [ "# df_ori.head(40)" ] }, { "cell_type": "markdown", "id": "209d339d", "metadata": {}, "source": [ "# Remove Duplicates" ] }, { "cell_type": "code", "execution_count": 6, "id": "498021b3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "183\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BrandName
52hokamafate x
66inov8trailfly
83la sportivaprodigio
84la sportivaprodigio
124niketerra kiger 9
137oncloudsurfer trail 2
141oncloudvista 2
180topoultraventure 4
\n", "
" ], "text/plain": [ " Brand Name\n", "52 hoka mafate x\n", "66 inov8 trailfly\n", "83 la sportiva prodigio\n", "84 la sportiva prodigio\n", "124 nike terra kiger 9\n", "137 on cloudsurfer trail 2\n", "141 on cloudvista 2\n", "180 topo ultraventure 4" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dup_mask = df_ori.duplicated(subset=[\"Brand\", \"Name\"], keep=\"first\")\n", "print(len(dup_mask))\n", "df_ori.loc[dup_mask, [\"Brand\", \"Name\"]].head(100)" ] }, { "cell_type": "code", "execution_count": 7, "id": "0f107030", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Before: 183\n", "After : 175\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BrandNameAudience scorePriceTrail terrainShock absorptionEnergy returnTractionArch supportWeight lab Weight brand...Heel stack lab Heel stack brandForefoot lab Forefoot brandWidths availableFor heavy runnersSeasonRemovable insoleOrthotic friendlyWaterproofingRankingPopularity
0adidasterrex agravic speed ultra90 Great!$220LightModerateHigh-Neutral9.1 oz / 259g 9.5 oz / 270g...30.6 mm 38.0 mm30.3 mm 30.0 mmNormal0.0All seasons11-#76 Top 21%#177 Top 47%
1adidasterrex speed ultra90 Great!3559500 RpLight---Neutral9.1 oz / 258g 9 oz / 255g...32.8 mm 26.0 mm24.6 mm 18.0 mmNormal0.0-11-#49 Top 13%#298 Bottom 21%
2altraexperience wild88 Great!2966250 RpLight ModerateModerateLow-Neutral10.1 oz / 285g 9.6 oz / 273g...34.5 mm 34.0 mm30.2 mm 30.0 mmNormal0.0All seasons11-#263 Top 40%#326 Top 49%
3altraexperience wild 284 Good!2966250 RpLightModerateLowHighNeutral9.4 oz / 266g 10.3 oz / 293g...32.3 mm 32.0 mm26.2 mm 28.0 mmNormal0.0All seasons11-#245 Bottom 35%#154 Top 41%
4altralone peak 5.091 Superb!$130Light Moderate---Neutral10.7 oz / 302g 10.6 oz / 301g...24.5 mm 25.0 mm24.3 mm 25.0 mmNormal0.0-11-#68 Top 11%#55 Top 9%
5altralone peak 689 Great!$140Moderate Technical---Neutral9.8 oz / 278g 9.7 oz / 275g...25.1 mm 25.0 mm24.5 mm 25.0 mmNormal Wide0.0-00-#147 Top 22%#341 Bottom 49%
6altralone peak 786 Good!3164000 RpModerate---Neutral10.4 oz / 294g 11 oz / 312g...23.3 mm 25.0 mm23.1 mm 25.0 mmNormal Wide0.0All seasons11-#403 Bottom 40%#273 Top 41%
7altralone peak 881 Good!$140Light Moderate---Neutral10.2 oz / 288g 10.7 oz / 303g...22.7 mm 25.0 mm21.3 mm 25.0 mmNormal Wide0.0All seasons11-#567 Bottom 15%#177 Top 27%
8altralone peak 991 Superb!$140Light ModerateLowModerate-Neutral10.9 oz / 309g 10.4 oz / 295g...23.3 mm 25.0 mm23.3 mm 25.0 mmNormal Wide0.0All seasons11-#25 Top 7%#41 Top 11%
9altramont blanc79 Good!$180Light Moderate---Neutral9.6 oz / 272g 9.9 oz / 280g...33.8 mm 30.0 mm33.8 mmNormal Wide0.0-00-#332 Bottom 12%#241 Bottom 36%
10altramont blanc carbon86 Good!4943750 RpModerate---Neutral8.9 oz / 251g 9.3 oz / 264g...27.2 mm 29.0 mm26.9 mm 29.0 mmNormal0.0All seasons11-#189 Top 50%#273 Bottom 27%
11altraolympus 27582 Good!3856130 RpLightModerateLowHighNeutral10.7 oz / 303g 10.8 oz / 305g...30.8 mm 33.0 mm30.5 mm 33.0 mmNormal0.0All seasons11-#298 Bottom 21%#240 Bottom 36%
12altraolympus 583 Good!3558800 RpLight Moderate---Neutral11.5 oz / 325g 12.3 oz / 350g...33.0 mm 33.0 mm31.0 mm 33.0 mmNormal0.0All seasons11-#526 Bottom 21%#302 Top 45%
13altraolympus 683 Good!$175Light ModerateModerateModerate-Neutral12.6 oz / 357g 12.5 oz / 354g...32.2 mm 35.0 mm31.5 mm 35.0 mmNormal1.0Summer All seasons11-#273 Bottom 27%#116 Top 31%
14altraoutroad81 Good!2966250 RpLight---Neutral10.1 oz / 287g 10.7 oz / 303g...25.1 mm 27.0 mm25.0 mm 27.0 mmNormal0.0All seasons11-#578 Bottom 14%#527 Bottom 21%
15altraoutroad 279 Good!2570750 RpLight---Neutral10.3 oz / 291g 10.1 oz / 286g...26.9 mm 27.5 mm25.5 mm 27.5 mmNormal0.0All seasons11-#610 Bottom 9%#564 Bottom 16%
16altraoutroad 381 Good!2570750 RpLight---Neutral9.2 oz / 261g 10.7 oz / 303g...23.8 mm 27.0 mm23.2 mm 27.0 mmNormal0.0All seasons11-#313 Bottom 17%#283 Bottom 25%
17altrasuperior 678 Decent!$130Light Moderate---Neutral9.6 oz / 272g 9.1 oz / 258g...22.1 mm 20.5 mm22.0 mm 20.5 mmNormal0.0Summer All seasons11-#631 Bottom 6%#524 Bottom 22%
18altrasuperior 782 Good!2373000 RpLightLowLowHighNeutral8.3 oz / 235g 9.3 oz / 263g...20.6 mm 21.0 mm20.0 mm 21.0 mmNormal0.0All seasons11-#293 Bottom 22%#271 Bottom 28%
19altratimp 478 Decent!3164000 RpLight Moderate---Neutral11.1 oz / 316g 10.6 oz / 300g...29.0 mm 30.0 mm28.9 mm 30.0 mmNormal0.0All seasons11-#626 Bottom 6%#523 Bottom 22%
\n", "

20 rows × 37 columns

\n", "
" ], "text/plain": [ " Brand Name Audience score Price \\\n", "0 adidas terrex agravic speed ultra 90 Great! $220 \n", "1 adidas terrex speed ultra 90 Great! 3559500 Rp \n", "2 altra experience wild 88 Great! 2966250 Rp \n", "3 altra experience wild 2 84 Good! 2966250 Rp \n", "4 altra lone peak 5.0 91 Superb! $130 \n", "5 altra lone peak 6 89 Great! $140 \n", "6 altra lone peak 7 86 Good! 3164000 Rp \n", "7 altra lone peak 8 81 Good! $140 \n", "8 altra lone peak 9 91 Superb! $140 \n", "9 altra mont blanc 79 Good! $180 \n", "10 altra mont blanc carbon 86 Good! 4943750 Rp \n", "11 altra olympus 275 82 Good! 3856130 Rp \n", "12 altra olympus 5 83 Good! 3558800 Rp \n", "13 altra olympus 6 83 Good! $175 \n", "14 altra outroad 81 Good! 2966250 Rp \n", "15 altra outroad 2 79 Good! 2570750 Rp \n", "16 altra outroad 3 81 Good! 2570750 Rp \n", "17 altra superior 6 78 Decent! $130 \n", "18 altra superior 7 82 Good! 2373000 Rp \n", "19 altra timp 4 78 Decent! 3164000 Rp \n", "\n", " Trail terrain Shock absorption Energy return Traction Arch support \\\n", "0 Light Moderate High - Neutral \n", "1 Light - - - Neutral \n", "2 Light Moderate Moderate Low - Neutral \n", "3 Light Moderate Low High Neutral \n", "4 Light Moderate - - - Neutral \n", "5 Moderate Technical - - - Neutral \n", "6 Moderate - - - Neutral \n", "7 Light Moderate - - - Neutral \n", "8 Light Moderate Low Moderate - Neutral \n", "9 Light Moderate - - - Neutral \n", "10 Moderate - - - Neutral \n", "11 Light Moderate Low High Neutral \n", "12 Light Moderate - - - Neutral \n", "13 Light Moderate Moderate Moderate - Neutral \n", "14 Light - - - Neutral \n", "15 Light - - - Neutral \n", "16 Light - - - Neutral \n", "17 Light Moderate - - - Neutral \n", "18 Light Low Low High Neutral \n", "19 Light Moderate - - - Neutral \n", "\n", " Weight lab Weight brand ... Heel stack lab Heel stack brand \\\n", "0 9.1 oz / 259g 9.5 oz / 270g ... 30.6 mm 38.0 mm \n", "1 9.1 oz / 258g 9 oz / 255g ... 32.8 mm 26.0 mm \n", "2 10.1 oz / 285g 9.6 oz / 273g ... 34.5 mm 34.0 mm \n", "3 9.4 oz / 266g 10.3 oz / 293g ... 32.3 mm 32.0 mm \n", "4 10.7 oz / 302g 10.6 oz / 301g ... 24.5 mm 25.0 mm \n", "5 9.8 oz / 278g 9.7 oz / 275g ... 25.1 mm 25.0 mm \n", "6 10.4 oz / 294g 11 oz / 312g ... 23.3 mm 25.0 mm \n", "7 10.2 oz / 288g 10.7 oz / 303g ... 22.7 mm 25.0 mm \n", "8 10.9 oz / 309g 10.4 oz / 295g ... 23.3 mm 25.0 mm \n", "9 9.6 oz / 272g 9.9 oz / 280g ... 33.8 mm 30.0 mm \n", "10 8.9 oz / 251g 9.3 oz / 264g ... 27.2 mm 29.0 mm \n", "11 10.7 oz / 303g 10.8 oz / 305g ... 30.8 mm 33.0 mm \n", "12 11.5 oz / 325g 12.3 oz / 350g ... 33.0 mm 33.0 mm \n", "13 12.6 oz / 357g 12.5 oz / 354g ... 32.2 mm 35.0 mm \n", "14 10.1 oz / 287g 10.7 oz / 303g ... 25.1 mm 27.0 mm \n", "15 10.3 oz / 291g 10.1 oz / 286g ... 26.9 mm 27.5 mm \n", "16 9.2 oz / 261g 10.7 oz / 303g ... 23.8 mm 27.0 mm \n", "17 9.6 oz / 272g 9.1 oz / 258g ... 22.1 mm 20.5 mm \n", "18 8.3 oz / 235g 9.3 oz / 263g ... 20.6 mm 21.0 mm \n", "19 11.1 oz / 316g 10.6 oz / 300g ... 29.0 mm 30.0 mm \n", "\n", " Forefoot lab Forefoot brand Widths available For heavy runners \\\n", "0 30.3 mm 30.0 mm Normal 0.0 \n", "1 24.6 mm 18.0 mm Normal 0.0 \n", "2 30.2 mm 30.0 mm Normal 0.0 \n", "3 26.2 mm 28.0 mm Normal 0.0 \n", "4 24.3 mm 25.0 mm Normal 0.0 \n", "5 24.5 mm 25.0 mm Normal Wide 0.0 \n", "6 23.1 mm 25.0 mm Normal Wide 0.0 \n", "7 21.3 mm 25.0 mm Normal Wide 0.0 \n", "8 23.3 mm 25.0 mm Normal Wide 0.0 \n", "9 33.8 mm Normal Wide 0.0 \n", "10 26.9 mm 29.0 mm Normal 0.0 \n", "11 30.5 mm 33.0 mm Normal 0.0 \n", "12 31.0 mm 33.0 mm Normal 0.0 \n", "13 31.5 mm 35.0 mm Normal 1.0 \n", "14 25.0 mm 27.0 mm Normal 0.0 \n", "15 25.5 mm 27.5 mm Normal 0.0 \n", "16 23.2 mm 27.0 mm Normal 0.0 \n", "17 22.0 mm 20.5 mm Normal 0.0 \n", "18 20.0 mm 21.0 mm Normal 0.0 \n", "19 28.9 mm 30.0 mm Normal 0.0 \n", "\n", " Season Removable insole Orthotic friendly Waterproofing \\\n", "0 All seasons 1 1 - \n", "1 - 1 1 - \n", "2 All seasons 1 1 - \n", "3 All seasons 1 1 - \n", "4 - 1 1 - \n", "5 - 0 0 - \n", "6 All seasons 1 1 - \n", "7 All seasons 1 1 - \n", "8 All seasons 1 1 - \n", "9 - 0 0 - \n", "10 All seasons 1 1 - \n", "11 All seasons 1 1 - \n", "12 All seasons 1 1 - \n", "13 Summer All seasons 1 1 - \n", "14 All seasons 1 1 - \n", "15 All seasons 1 1 - \n", "16 All seasons 1 1 - \n", "17 Summer All seasons 1 1 - \n", "18 All seasons 1 1 - \n", "19 All seasons 1 1 - \n", "\n", " Ranking Popularity \n", "0 #76 Top 21% #177 Top 47% \n", "1 #49 Top 13% #298 Bottom 21% \n", "2 #263 Top 40% #326 Top 49% \n", "3 #245 Bottom 35% #154 Top 41% \n", "4 #68 Top 11% #55 Top 9% \n", "5 #147 Top 22% #341 Bottom 49% \n", "6 #403 Bottom 40% #273 Top 41% \n", "7 #567 Bottom 15% #177 Top 27% \n", "8 #25 Top 7% #41 Top 11% \n", "9 #332 Bottom 12% #241 Bottom 36% \n", "10 #189 Top 50% #273 Bottom 27% \n", "11 #298 Bottom 21% #240 Bottom 36% \n", "12 #526 Bottom 21% #302 Top 45% \n", "13 #273 Bottom 27% #116 Top 31% \n", "14 #578 Bottom 14% #527 Bottom 21% \n", "15 #610 Bottom 9% #564 Bottom 16% \n", "16 #313 Bottom 17% #283 Bottom 25% \n", "17 #631 Bottom 6% #524 Bottom 22% \n", "18 #293 Bottom 22% #271 Bottom 28% \n", "19 #626 Bottom 6% #523 Bottom 22% \n", "\n", "[20 rows x 37 columns]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# sebelum hapus\n", "print(\"Before:\", len(df_ori))\n", "\n", "#hapus\n", "df_ori = df_ori.drop_duplicates(subset=[\"Brand\", \"Name\"], keep=\"first\").reset_index(drop=True)\n", "\n", "print(\"After :\", len(df_ori))\n", "df_ori.head(20)" ] }, { "cell_type": "code", "execution_count": 8, "id": "8f770d4b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 175 entries, 0 to 174\n", "Data columns (total 37 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 175 non-null str \n", " 1 Name 175 non-null str \n", " 2 Audience score 174 non-null str \n", " 3 Price 175 non-null str \n", " 4 Trail terrain 175 non-null str \n", " 5 Shock absorption 175 non-null str \n", " 6 Energy return 175 non-null str \n", " 7 Traction 170 non-null str \n", " 8 Arch support 175 non-null str \n", " 9 Weight lab Weight brand 175 non-null str \n", " 10 Lightweight 168 non-null float64\n", " 11 Drop lab Drop brand 175 non-null str \n", " 12 Strike pattern 175 non-null str \n", " 13 Size 175 non-null str \n", " 14 Midsole softness 175 non-null str \n", " 15 Difference in midsole softness in cold 175 non-null str \n", " 16 Plate 175 non-null str \n", " 17 Toebox durability 175 non-null str \n", " 18 Heel padding durability 175 non-null str \n", " 19 Outsole durability 175 non-null str \n", " 20 Breathability 175 non-null str \n", " 21 Width / fit 175 non-null str \n", " 22 Toebox width 175 non-null str \n", " 23 Stiffness 175 non-null str \n", " 24 Torsional rigidity 175 non-null str \n", " 25 Heel counter stiffness 175 non-null str \n", " 26 Lug depth 175 non-null str \n", " 27 Heel stack lab Heel stack brand 175 non-null str \n", " 28 Forefoot lab Forefoot brand 175 non-null str \n", " 29 Widths available 175 non-null str \n", " 30 For heavy runners 171 non-null float64\n", " 31 Season 175 non-null str \n", " 32 Removable insole 175 non-null int64 \n", " 33 Orthotic friendly 175 non-null int64 \n", " 34 Waterproofing 169 non-null str \n", " 35 Ranking 175 non-null str \n", " 36 Popularity 175 non-null str \n", "dtypes: float64(2), int64(2), str(33)\n", "memory usage: 50.7 KB\n" ] } ], "source": [ "df_ori.info()" ] }, { "cell_type": "markdown", "id": "d7f529a0", "metadata": {}, "source": [ "# Removing unused column\n", "\n", "ini df-nya full buat machine learning aja jadi aku hapus semua. Brand Name dihapus terakhir" ] }, { "cell_type": "code", "execution_count": 9, "id": "86901d21", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BrandNameAudience scorePriceTrail terrainShock absorptionEnergy returnTractionArch supportWeight lab Weight brand...Heel stack lab Heel stack brandForefoot lab Forefoot brandWidths availableFor heavy runnersSeasonRemovable insoleOrthotic friendlyWaterproofingRankingPopularity
0adidasterrex agravic speed ultra90 Great!$220LightModerateHigh-Neutral9.1 oz / 259g 9.5 oz / 270g...30.6 mm 38.0 mm30.3 mm 30.0 mmNormal0.0All seasons11-#76 Top 21%#177 Top 47%
1adidasterrex speed ultra90 Great!3559500 RpLight---Neutral9.1 oz / 258g 9 oz / 255g...32.8 mm 26.0 mm24.6 mm 18.0 mmNormal0.0-11-#49 Top 13%#298 Bottom 21%
2altraexperience wild88 Great!2966250 RpLight ModerateModerateLow-Neutral10.1 oz / 285g 9.6 oz / 273g...34.5 mm 34.0 mm30.2 mm 30.0 mmNormal0.0All seasons11-#263 Top 40%#326 Top 49%
3altraexperience wild 284 Good!2966250 RpLightModerateLowHighNeutral9.4 oz / 266g 10.3 oz / 293g...32.3 mm 32.0 mm26.2 mm 28.0 mmNormal0.0All seasons11-#245 Bottom 35%#154 Top 41%
4altralone peak 5.091 Superb!$130Light Moderate---Neutral10.7 oz / 302g 10.6 oz / 301g...24.5 mm 25.0 mm24.3 mm 25.0 mmNormal0.0-11-#68 Top 11%#55 Top 9%
\n", "

5 rows × 37 columns

\n", "
" ], "text/plain": [ " Brand Name Audience score Price \\\n", "0 adidas terrex agravic speed ultra 90 Great! $220 \n", "1 adidas terrex speed ultra 90 Great! 3559500 Rp \n", "2 altra experience wild 88 Great! 2966250 Rp \n", "3 altra experience wild 2 84 Good! 2966250 Rp \n", "4 altra lone peak 5.0 91 Superb! $130 \n", "\n", " Trail terrain Shock absorption Energy return Traction Arch support \\\n", "0 Light Moderate High - Neutral \n", "1 Light - - - Neutral \n", "2 Light Moderate Moderate Low - Neutral \n", "3 Light Moderate Low High Neutral \n", "4 Light Moderate - - - Neutral \n", "\n", " Weight lab Weight brand ... Heel stack lab Heel stack brand \\\n", "0 9.1 oz / 259g 9.5 oz / 270g ... 30.6 mm 38.0 mm \n", "1 9.1 oz / 258g 9 oz / 255g ... 32.8 mm 26.0 mm \n", "2 10.1 oz / 285g 9.6 oz / 273g ... 34.5 mm 34.0 mm \n", "3 9.4 oz / 266g 10.3 oz / 293g ... 32.3 mm 32.0 mm \n", "4 10.7 oz / 302g 10.6 oz / 301g ... 24.5 mm 25.0 mm \n", "\n", " Forefoot lab Forefoot brand Widths available For heavy runners Season \\\n", "0 30.3 mm 30.0 mm Normal 0.0 All seasons \n", "1 24.6 mm 18.0 mm Normal 0.0 - \n", "2 30.2 mm 30.0 mm Normal 0.0 All seasons \n", "3 26.2 mm 28.0 mm Normal 0.0 All seasons \n", "4 24.3 mm 25.0 mm Normal 0.0 - \n", "\n", " Removable insole Orthotic friendly Waterproofing Ranking \\\n", "0 1 1 - #76 Top 21% \n", "1 1 1 - #49 Top 13% \n", "2 1 1 - #263 Top 40% \n", "3 1 1 - #245 Bottom 35% \n", "4 1 1 - #68 Top 11% \n", "\n", " Popularity \n", "0 #177 Top 47% \n", "1 #298 Bottom 21% \n", "2 #326 Top 49% \n", "3 #154 Top 41% \n", "4 #55 Top 9% \n", "\n", "[5 rows x 37 columns]" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = df_ori.copy()\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 10, "id": "8457eba5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 175 entries, 0 to 174\n", "Data columns (total 37 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 175 non-null str \n", " 1 Name 175 non-null str \n", " 2 Audience score 174 non-null str \n", " 3 Price 175 non-null str \n", " 4 Trail terrain 175 non-null str \n", " 5 Shock absorption 175 non-null str \n", " 6 Energy return 175 non-null str \n", " 7 Traction 170 non-null str \n", " 8 Arch support 175 non-null str \n", " 9 Weight lab Weight brand 175 non-null str \n", " 10 Lightweight 168 non-null float64\n", " 11 Drop lab Drop brand 175 non-null str \n", " 12 Strike pattern 175 non-null str \n", " 13 Size 175 non-null str \n", " 14 Midsole softness 175 non-null str \n", " 15 Difference in midsole softness in cold 175 non-null str \n", " 16 Plate 175 non-null str \n", " 17 Toebox durability 175 non-null str \n", " 18 Heel padding durability 175 non-null str \n", " 19 Outsole durability 175 non-null str \n", " 20 Breathability 175 non-null str \n", " 21 Width / fit 175 non-null str \n", " 22 Toebox width 175 non-null str \n", " 23 Stiffness 175 non-null str \n", " 24 Torsional rigidity 175 non-null str \n", " 25 Heel counter stiffness 175 non-null str \n", " 26 Lug depth 175 non-null str \n", " 27 Heel stack lab Heel stack brand 175 non-null str \n", " 28 Forefoot lab Forefoot brand 175 non-null str \n", " 29 Widths available 175 non-null str \n", " 30 For heavy runners 171 non-null float64\n", " 31 Season 175 non-null str \n", " 32 Removable insole 175 non-null int64 \n", " 33 Orthotic friendly 175 non-null int64 \n", " 34 Waterproofing 169 non-null str \n", " 35 Ranking 175 non-null str \n", " 36 Popularity 175 non-null str \n", "dtypes: float64(2), int64(2), str(33)\n", "memory usage: 50.7 KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "code", "execution_count": 11, "id": "2ae0eae6", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BrandNameTrail terrainShock absorptionEnergy returnTractionArch supportWeight lab Weight brandLightweightDrop lab Drop brand...Torsional rigidityHeel counter stiffnessLug depthHeel stack lab Heel stack brandForefoot lab Forefoot brandFor heavy runnersSeasonRemovable insoleOrthotic friendlyWaterproofing
0adidasterrex agravic speed ultraLightModerateHigh-Neutral9.1 oz / 259g 9.5 oz / 270g0.00.3 mm 8.0 mm...StiffFlexible2.5 mm30.6 mm 38.0 mm30.3 mm 30.0 mm0.0All seasons11-
1adidasterrex speed ultraLight---Neutral9.1 oz / 258g 9 oz / 255g0.08.2 mm 8.0 mm...FlexibleFlexible2.6 mm32.8 mm 26.0 mm24.6 mm 18.0 mm0.0-11-
2altraexperience wildLight ModerateModerateLow-Neutral10.1 oz / 285g 9.6 oz / 273g0.04.3 mm 4.0 mm...StiffModerate3.6 mm34.5 mm 34.0 mm30.2 mm 30.0 mm0.0All seasons11-
3altraexperience wild 2LightModerateLowHighNeutral9.4 oz / 266g 10.3 oz / 293g0.06.1 mm 4.0 mm...ModerateFlexible3.5 mm32.3 mm 32.0 mm26.2 mm 28.0 mm0.0All seasons11-
4altralone peak 5.0Light Moderate---Neutral10.7 oz / 302g 10.6 oz / 301g0.00.2 mm 0.0 mm...Flexible-3.7 mm24.5 mm 25.0 mm24.3 mm 25.0 mm0.0-11-
\n", "

5 rows × 30 columns

\n", "
" ], "text/plain": [ " Brand Name Trail terrain Shock absorption \\\n", "0 adidas terrex agravic speed ultra Light Moderate \n", "1 adidas terrex speed ultra Light - \n", "2 altra experience wild Light Moderate Moderate \n", "3 altra experience wild 2 Light Moderate \n", "4 altra lone peak 5.0 Light Moderate - \n", "\n", " Energy return Traction Arch support Weight lab Weight brand \\\n", "0 High - Neutral 9.1 oz / 259g 9.5 oz / 270g \n", "1 - - Neutral 9.1 oz / 258g 9 oz / 255g \n", "2 Low - Neutral 10.1 oz / 285g 9.6 oz / 273g \n", "3 Low High Neutral 9.4 oz / 266g 10.3 oz / 293g \n", "4 - - Neutral 10.7 oz / 302g 10.6 oz / 301g \n", "\n", " Lightweight Drop lab Drop brand ... Torsional rigidity \\\n", "0 0.0 0.3 mm 8.0 mm ... Stiff \n", "1 0.0 8.2 mm 8.0 mm ... Flexible \n", "2 0.0 4.3 mm 4.0 mm ... Stiff \n", "3 0.0 6.1 mm 4.0 mm ... Moderate \n", "4 0.0 0.2 mm 0.0 mm ... Flexible \n", "\n", " Heel counter stiffness Lug depth Heel stack lab Heel stack brand \\\n", "0 Flexible 2.5 mm 30.6 mm 38.0 mm \n", "1 Flexible 2.6 mm 32.8 mm 26.0 mm \n", "2 Moderate 3.6 mm 34.5 mm 34.0 mm \n", "3 Flexible 3.5 mm 32.3 mm 32.0 mm \n", "4 - 3.7 mm 24.5 mm 25.0 mm \n", "\n", " Forefoot lab Forefoot brand For heavy runners Season Removable insole \\\n", "0 30.3 mm 30.0 mm 0.0 All seasons 1 \n", "1 24.6 mm 18.0 mm 0.0 - 1 \n", "2 30.2 mm 30.0 mm 0.0 All seasons 1 \n", "3 26.2 mm 28.0 mm 0.0 All seasons 1 \n", "4 24.3 mm 25.0 mm 0.0 - 1 \n", "\n", " Orthotic friendly Waterproofing \n", "0 1 - \n", "1 1 - \n", "2 1 - \n", "3 1 - \n", "4 1 - \n", "\n", "[5 rows x 30 columns]" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.drop(columns=['Audience score', 'Price', 'Size', \n", " 'Difference in midsole softness in cold',\n", " 'Widths available', 'Ranking', 'Popularity'], inplace=True)\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 12, "id": "8f2cacd8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 175 entries, 0 to 174\n", "Data columns (total 30 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 175 non-null str \n", " 1 Name 175 non-null str \n", " 2 Trail terrain 175 non-null str \n", " 3 Shock absorption 175 non-null str \n", " 4 Energy return 175 non-null str \n", " 5 Traction 170 non-null str \n", " 6 Arch support 175 non-null str \n", " 7 Weight lab Weight brand 175 non-null str \n", " 8 Lightweight 168 non-null float64\n", " 9 Drop lab Drop brand 175 non-null str \n", " 10 Strike pattern 175 non-null str \n", " 11 Midsole softness 175 non-null str \n", " 12 Plate 175 non-null str \n", " 13 Toebox durability 175 non-null str \n", " 14 Heel padding durability 175 non-null str \n", " 15 Outsole durability 175 non-null str \n", " 16 Breathability 175 non-null str \n", " 17 Width / fit 175 non-null str \n", " 18 Toebox width 175 non-null str \n", " 19 Stiffness 175 non-null str \n", " 20 Torsional rigidity 175 non-null str \n", " 21 Heel counter stiffness 175 non-null str \n", " 22 Lug depth 175 non-null str \n", " 23 Heel stack lab Heel stack brand 175 non-null str \n", " 24 Forefoot lab Forefoot brand 175 non-null str \n", " 25 For heavy runners 171 non-null float64\n", " 26 Season 175 non-null str \n", " 27 Removable insole 175 non-null int64 \n", " 28 Orthotic friendly 175 non-null int64 \n", " 29 Waterproofing 169 non-null str \n", "dtypes: float64(2), int64(2), str(26)\n", "memory usage: 41.1 KB\n" ] } ], "source": [ "df.info()" ] }, { "cell_type": "markdown", "id": "c5729690", "metadata": {}, "source": [ "# Trail terrain" ] }, { "cell_type": "code", "execution_count": 13, "id": "351d019a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Trail terrain\n", "Light Moderate 54\n", "Light 48\n", "Moderate Technical 21\n", "Moderate 19\n", "- 17\n", "Technical 11\n", "LightModerate 3\n", "ModerateTechnical 2\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Trail terrain'].value_counts())" ] }, { "cell_type": "code", "execution_count": 14, "id": "1370c40c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Trail terrain\n", "Light Moderate 54\n", "Light 48\n", "Moderate Technical 21\n", "Moderate 19\n", "Technical 11\n", "LightModerate 3\n", "ModerateTechnical 2\n", "Name: count, dtype: int64\n" ] } ], "source": [ "df = df[df['Trail terrain'] != \"-\"].reset_index(drop=True)\n", "print(df['Trail terrain'].value_counts())" ] }, { "cell_type": "code", "execution_count": 15, "id": "d67f4175", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows after cleaning: 158\n", "\n", "Unique Values in original column (before drop):\n", "\n", "[ 'light', 'light moderate', 'moderate technical',\n", " 'moderate', 'moderatetechnical', 'technical',\n", " 'lightmoderate']\n", "Length: 7, dtype: str\n", "\n", "Sample Comparison (Multi-value Mapping):\n", " Trail terrain terrain_light terrain_moderate terrain_technical\n", "0 light 1 0 0\n", "1 light 1 0 0\n", "2 light moderate 1 1 0\n", "3 light 1 0 0\n", "4 light moderate 1 1 0\n", "5 moderate technical 0 1 1\n", "6 moderate 0 1 0\n", "7 light moderate 1 1 0\n", "8 light moderate 1 1 0\n", "9 light moderate 1 1 0\n" ] } ], "source": [ "# Naming convention: all lowercase\n", "df['Trail terrain'] = df['Trail terrain'].astype(str).str.lower()\n", "base_terrains = ['light', 'moderate', 'technical']\n", "\n", "for terrain in base_terrains:\n", " column_name = f\"terrain_{terrain}\"\n", " df[column_name] = df['Trail terrain'].str.contains(terrain).astype(int)\n", "\n", "print(\"Rows after cleaning:\", len(df))\n", "\n", "print(\"\\nUnique Values in original column (before drop):\")\n", "print(df[\"Trail terrain\"].unique())\n", "\n", "print(\"\\nSample Comparison (Multi-value Mapping):\")\n", "check_cols = [\"Trail terrain\"] + [f\"terrain_{t}\" for t in base_terrains]\n", "print(df[check_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 16, "id": "66775876", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Trail terrain\n", "light moderate 54\n", "light 48\n", "moderate technical 21\n", "moderate 19\n", "technical 11\n", "lightmoderate 3\n", "moderatetechnical 2\n", "Name: count, dtype: int64\n", "\n", "Sum of each terrain type:\n", "terrain_light sum: 105\n", "terrain_moderate sum: 99\n", "terrain_technical sum: 34\n", "\n", " Trail terrain terrain_light terrain_moderate terrain_technical\n", "0 light 1 0 0\n", "1 light 1 0 0\n", "2 light moderate 1 1 0\n", "3 light 1 0 0\n", "4 light moderate 1 1 0\n" ] } ], "source": [ "print(df['Trail terrain'].value_counts())\n", "\n", "print(\"\\nSum of each terrain type:\")\n", "for terrain in base_terrains:\n", " col = f\"terrain_{terrain}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[['Trail terrain', 'terrain_light', 'terrain_moderate', 'terrain_technical']].head())" ] }, { "cell_type": "code", "execution_count": 17, "id": "8b78d616", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 32 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Shock absorption 158 non-null str \n", " 3 Energy return 158 non-null str \n", " 4 Traction 153 non-null str \n", " 5 Arch support 158 non-null str \n", " 6 Weight lab Weight brand 158 non-null str \n", " 7 Lightweight 152 non-null float64\n", " 8 Drop lab Drop brand 158 non-null str \n", " 9 Strike pattern 158 non-null str \n", " 10 Midsole softness 158 non-null str \n", " 11 Plate 158 non-null str \n", " 12 Toebox durability 158 non-null str \n", " 13 Heel padding durability 158 non-null str \n", " 14 Outsole durability 158 non-null str \n", " 15 Breathability 158 non-null str \n", " 16 Width / fit 158 non-null str \n", " 17 Toebox width 158 non-null str \n", " 18 Stiffness 158 non-null str \n", " 19 Torsional rigidity 158 non-null str \n", " 20 Heel counter stiffness 158 non-null str \n", " 21 Lug depth 158 non-null str \n", " 22 Heel stack lab Heel stack brand 158 non-null str \n", " 23 Forefoot lab Forefoot brand 158 non-null str \n", " 24 For heavy runners 154 non-null float64\n", " 25 Season 158 non-null str \n", " 26 Removable insole 158 non-null int64 \n", " 27 Orthotic friendly 158 non-null int64 \n", " 28 Waterproofing 156 non-null str \n", " 29 terrain_light 158 non-null int64 \n", " 30 terrain_moderate 158 non-null int64 \n", " 31 terrain_technical 158 non-null int64 \n", "dtypes: float64(2), int64(5), str(25)\n", "memory usage: 39.6 KB\n" ] } ], "source": [ "df.drop('Trail terrain', axis=1, inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "ee89a11f", "metadata": {}, "source": [ "# Shock absorption" ] }, { "cell_type": "code", "execution_count": 18, "id": "abd73756", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Shock absorption\n", "- 81\n", "Moderate 45\n", "High 20\n", "Low 12\n", "Name: count, dtype: int64\n" ] } ], "source": [ "# Checking null values first\n", "print(df['Shock absorption'].value_counts())" ] }, { "cell_type": "code", "execution_count": 19, "id": "7b6b0356", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "Baris dengan semua OHE 0: 81\n", "\n", "Sample Comparison (Baris '-' akan jadi 0 semua):\n", " Shock absorption shock_low shock_moderate shock_high\n", "0 moderate 0 1 0\n", "1 - 0 0 0\n", "2 moderate 0 1 0\n", "3 moderate 0 1 0\n", "4 - 0 0 0\n", "5 - 0 0 0\n", "6 - 0 0 0\n", "7 - 0 0 0\n", "8 low 1 0 0\n", "9 - 0 0 0\n" ] } ], "source": [ "df['Shock absorption'] = df['Shock absorption'].astype(str).str.lower()\n", "base_shocks = ['low', 'moderate', 'high']\n", "\n", "\n", "for shock in base_shocks:\n", " column_name = f\"shock_{shock}\"\n", " df[column_name] = df['Shock absorption'].str.contains(shock, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "\n", "# Verify all 0s\n", "all_zero = df[(df[f\"shock_{base_shocks[0]}\"] == 0) & \n", " (df[f\"shock_{base_shocks[1]}\"] == 0) & \n", " (df[f\"shock_{base_shocks[2]}\"] == 0)]\n", "\n", "print(f\"Baris dengan semua OHE 0: {len(all_zero)}\")\n", "\n", "\n", "print(\"\\nSample Comparison (Baris '-' akan jadi 0 semua):\")\n", "check_cols = [\"Shock absorption\"] + [f\"shock_{s}\" for s in base_shocks]\n", "# Tampilkan beberapa baris pertama termasuk yang ada dash-nya jika ada\n", "print(df[check_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 20, "id": "3fadd289", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Shock absorption\n", "- 81\n", "moderate 45\n", "high 20\n", "low 12\n", "Name: count, dtype: int64\n", "shock_low sum: 12\n", "shock_moderate sum: 45\n", "shock_high sum: 20\n", "\n", " Shock absorption shock_low shock_moderate shock_high\n", "0 moderate 0 1 0\n", "1 - 0 0 0\n", "2 moderate 0 1 0\n", "3 moderate 0 1 0\n", "4 - 0 0 0\n" ] } ], "source": [ "print(df['Shock absorption'].value_counts())\n", "\n", "for shock in base_shocks:\n", " col = f\"shock_{shock}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Shock absorption\"] + [f\"shock_{s}\" for s in base_shocks]].head())" ] }, { "cell_type": "code", "execution_count": 21, "id": "396242dd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 34 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Energy return 158 non-null str \n", " 3 Traction 153 non-null str \n", " 4 Arch support 158 non-null str \n", " 5 Weight lab Weight brand 158 non-null str \n", " 6 Lightweight 152 non-null float64\n", " 7 Drop lab Drop brand 158 non-null str \n", " 8 Strike pattern 158 non-null str \n", " 9 Midsole softness 158 non-null str \n", " 10 Plate 158 non-null str \n", " 11 Toebox durability 158 non-null str \n", " 12 Heel padding durability 158 non-null str \n", " 13 Outsole durability 158 non-null str \n", " 14 Breathability 158 non-null str \n", " 15 Width / fit 158 non-null str \n", " 16 Toebox width 158 non-null str \n", " 17 Stiffness 158 non-null str \n", " 18 Torsional rigidity 158 non-null str \n", " 19 Heel counter stiffness 158 non-null str \n", " 20 Lug depth 158 non-null str \n", " 21 Heel stack lab Heel stack brand 158 non-null str \n", " 22 Forefoot lab Forefoot brand 158 non-null str \n", " 23 For heavy runners 154 non-null float64\n", " 24 Season 158 non-null str \n", " 25 Removable insole 158 non-null int64 \n", " 26 Orthotic friendly 158 non-null int64 \n", " 27 Waterproofing 156 non-null str \n", " 28 terrain_light 158 non-null int64 \n", " 29 terrain_moderate 158 non-null int64 \n", " 30 terrain_technical 158 non-null int64 \n", " 31 shock_low 158 non-null int64 \n", " 32 shock_moderate 158 non-null int64 \n", " 33 shock_high 158 non-null int64 \n", "dtypes: float64(2), int64(8), str(24)\n", "memory usage: 42.1 KB\n" ] } ], "source": [ "df.drop('Shock absorption', axis=1, inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "0dfe6ab4", "metadata": {}, "source": [ "# Energy return" ] }, { "cell_type": "code", "execution_count": 22, "id": "e1583547", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Energy return\n", "- 81\n", "Low 36\n", "Moderate 36\n", "High 5\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Energy return\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 23, "id": "74393e16", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "Baris dengan semua OHE 0 (termasuk '-'): 81\n", "\n", "Sample Comparison:\n", " Energy return energy_low energy_moderate energy_high\n", "0 high 0 0 1\n", "1 - 0 0 0\n", "2 low 1 0 0\n", "3 low 1 0 0\n", "4 - 0 0 0\n", "5 - 0 0 0\n", "6 - 0 0 0\n", "7 - 0 0 0\n", "8 moderate 0 1 0\n", "9 - 0 0 0\n" ] } ], "source": [ "df['Energy return'] = df['Energy return'].astype(str).str.lower()\n", "base_energy = ['low', 'moderate', 'high']\n", "\n", "\n", "for level in base_energy:\n", " column_name = f\"energy_{level}\"\n", " df[column_name] = df['Energy return'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "energy_cols = [f\"energy_{l}\" for l in base_energy]\n", "zero_vector_count = (df[energy_cols].sum(axis=1) == 0).sum()\n", "print(f\"Baris dengan semua OHE 0 (termasuk '-'): {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Energy return\"] + energy_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 24, "id": "d64613b2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Energy return\n", "- 81\n", "low 36\n", "moderate 36\n", "high 5\n", "Name: count, dtype: int64\n", "\n", "energy_low sum: 36\n", "energy_moderate sum: 36\n", "energy_high sum: 5\n", "\n", " Energy return energy_low energy_moderate energy_high\n", "0 high 0 0 1\n", "1 - 0 0 0\n", "2 low 1 0 0\n", "3 low 1 0 0\n", "4 - 0 0 0\n" ] } ], "source": [ "print(df[\"Energy return\"].value_counts())\n", "\n", "print()\n", "for level in base_energy:\n", " col = f\"energy_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Energy return\"] + energy_cols].head())" ] }, { "cell_type": "code", "execution_count": 25, "id": "8b60e596", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 36 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Traction 153 non-null str \n", " 3 Arch support 158 non-null str \n", " 4 Weight lab Weight brand 158 non-null str \n", " 5 Lightweight 152 non-null float64\n", " 6 Drop lab Drop brand 158 non-null str \n", " 7 Strike pattern 158 non-null str \n", " 8 Midsole softness 158 non-null str \n", " 9 Plate 158 non-null str \n", " 10 Toebox durability 158 non-null str \n", " 11 Heel padding durability 158 non-null str \n", " 12 Outsole durability 158 non-null str \n", " 13 Breathability 158 non-null str \n", " 14 Width / fit 158 non-null str \n", " 15 Toebox width 158 non-null str \n", " 16 Stiffness 158 non-null str \n", " 17 Torsional rigidity 158 non-null str \n", " 18 Heel counter stiffness 158 non-null str \n", " 19 Lug depth 158 non-null str \n", " 20 Heel stack lab Heel stack brand 158 non-null str \n", " 21 Forefoot lab Forefoot brand 158 non-null str \n", " 22 For heavy runners 154 non-null float64\n", " 23 Season 158 non-null str \n", " 24 Removable insole 158 non-null int64 \n", " 25 Orthotic friendly 158 non-null int64 \n", " 26 Waterproofing 156 non-null str \n", " 27 terrain_light 158 non-null int64 \n", " 28 terrain_moderate 158 non-null int64 \n", " 29 terrain_technical 158 non-null int64 \n", " 30 shock_low 158 non-null int64 \n", " 31 shock_moderate 158 non-null int64 \n", " 32 shock_high 158 non-null int64 \n", " 33 energy_low 158 non-null int64 \n", " 34 energy_moderate 158 non-null int64 \n", " 35 energy_high 158 non-null int64 \n", "dtypes: float64(2), int64(11), str(23)\n", "memory usage: 44.6 KB\n" ] } ], "source": [ "df.drop('Energy return', axis=1, inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "050f4527", "metadata": {}, "source": [ "# Traction" ] }, { "cell_type": "code", "execution_count": 26, "id": "6a938fe9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Traction\n", "- 127\n", "High 25\n", "Moderate 1\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Traction\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 27, "id": "7fd8d46f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "Baris dengan semua OHE 0 (termasuk '-'): 132\n", "\n", "Sample Comparison:\n", " Traction traction_moderate traction_high\n", "0 - 0 0\n", "1 - 0 0\n", "2 - 0 0\n", "3 high 0 1\n", "4 - 0 0\n", "5 - 0 0\n", "6 - 0 0\n", "7 - 0 0\n", "8 - 0 0\n", "9 - 0 0\n" ] } ], "source": [ "df['Traction'] = df['Traction'].astype(str).str.lower()\n", "base_traction = ['moderate', 'high']\n", "\n", "for level in base_traction:\n", " column_name = f\"traction_{level}\"\n", " df[column_name] = df['Traction'].str.contains(level, na=False).astype(int)\n", "print(\"Rows:\", len(df))\n", "\n", "traction_cols = [f\"traction_{l}\" for l in base_traction]\n", "zero_vector_count = (df[traction_cols].sum(axis=1) == 0).sum()\n", "print(f\"Baris dengan semua OHE 0 (termasuk '-'): {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Traction\"] + traction_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 28, "id": "3a83c57d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Traction\n", "- 127\n", "high 25\n", "moderate 1\n", "Name: count, dtype: int64\n", "\n", "traction_moderate sum: 1\n", "traction_high sum: 25\n", "\n", " Traction traction_moderate traction_high\n", "0 - 0 0\n", "1 - 0 0\n", "2 - 0 0\n", "3 high 0 1\n", "4 - 0 0\n" ] } ], "source": [ "print(df[\"Traction\"].value_counts())\n", "\n", "print()\n", "for level in base_traction:\n", " col = f\"traction_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Traction\"] + traction_cols].head())" ] }, { "cell_type": "code", "execution_count": 29, "id": "65ce998a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 37 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Arch support 158 non-null str \n", " 3 Weight lab Weight brand 158 non-null str \n", " 4 Lightweight 152 non-null float64\n", " 5 Drop lab Drop brand 158 non-null str \n", " 6 Strike pattern 158 non-null str \n", " 7 Midsole softness 158 non-null str \n", " 8 Plate 158 non-null str \n", " 9 Toebox durability 158 non-null str \n", " 10 Heel padding durability 158 non-null str \n", " 11 Outsole durability 158 non-null str \n", " 12 Breathability 158 non-null str \n", " 13 Width / fit 158 non-null str \n", " 14 Toebox width 158 non-null str \n", " 15 Stiffness 158 non-null str \n", " 16 Torsional rigidity 158 non-null str \n", " 17 Heel counter stiffness 158 non-null str \n", " 18 Lug depth 158 non-null str \n", " 19 Heel stack lab Heel stack brand 158 non-null str \n", " 20 Forefoot lab Forefoot brand 158 non-null str \n", " 21 For heavy runners 154 non-null float64\n", " 22 Season 158 non-null str \n", " 23 Removable insole 158 non-null int64 \n", " 24 Orthotic friendly 158 non-null int64 \n", " 25 Waterproofing 156 non-null str \n", " 26 terrain_light 158 non-null int64 \n", " 27 terrain_moderate 158 non-null int64 \n", " 28 terrain_technical 158 non-null int64 \n", " 29 shock_low 158 non-null int64 \n", " 30 shock_moderate 158 non-null int64 \n", " 31 shock_high 158 non-null int64 \n", " 32 energy_low 158 non-null int64 \n", " 33 energy_moderate 158 non-null int64 \n", " 34 energy_high 158 non-null int64 \n", " 35 traction_moderate 158 non-null int64 \n", " 36 traction_high 158 non-null int64 \n", "dtypes: float64(2), int64(13), str(22)\n", "memory usage: 45.8 KB\n" ] } ], "source": [ "df.drop(columns=['Traction'], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "d283f13a", "metadata": {}, "source": [ "# Arch support" ] }, { "cell_type": "code", "execution_count": 30, "id": "1d055a43", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Arch support\n", "Neutral 154\n", "Stability 4\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Arch support\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 31, "id": "8ee15f86", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 0\n", "\n", "Sample Comparison:\n", " Arch support arch_neutral arch_stability\n", "0 neutral 1 0\n", "1 neutral 1 0\n", "2 neutral 1 0\n", "3 neutral 1 0\n", "4 neutral 1 0\n", "5 neutral 1 0\n", "6 neutral 1 0\n", "7 neutral 1 0\n", "8 neutral 1 0\n", "9 neutral 1 0\n" ] } ], "source": [ "df['Arch support'] = df['Arch support'].astype(str).str.lower()\n", "base_arch = ['neutral', 'stability']\n", "\n", "\n", "for level in base_arch:\n", " column_name = f\"arch_{level}\"\n", " df[column_name] = df['Arch support'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "\n", "arch_cols = [f\"arch_{l}\" for l in base_arch]\n", "zero_vector_count = (df[arch_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Arch support\"] + arch_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 32, "id": "bddc5889", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Arch support\n", "neutral 154\n", "stability 4\n", "Name: count, dtype: int64\n", "\n", "arch_neutral sum: 154\n", "arch_stability sum: 4\n", "\n", " Arch support arch_neutral arch_stability\n", "0 neutral 1 0\n", "1 neutral 1 0\n", "2 neutral 1 0\n", "3 neutral 1 0\n", "4 neutral 1 0\n" ] } ], "source": [ "print(df[\"Arch support\"].value_counts())\n", "\n", "print()\n", "for level in base_arch:\n", " col = f\"arch_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Arch support\"] + arch_cols].head())" ] }, { "cell_type": "code", "execution_count": 33, "id": "d8b2e073", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 38 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Weight lab Weight brand 158 non-null str \n", " 3 Lightweight 152 non-null float64\n", " 4 Drop lab Drop brand 158 non-null str \n", " 5 Strike pattern 158 non-null str \n", " 6 Midsole softness 158 non-null str \n", " 7 Plate 158 non-null str \n", " 8 Toebox durability 158 non-null str \n", " 9 Heel padding durability 158 non-null str \n", " 10 Outsole durability 158 non-null str \n", " 11 Breathability 158 non-null str \n", " 12 Width / fit 158 non-null str \n", " 13 Toebox width 158 non-null str \n", " 14 Stiffness 158 non-null str \n", " 15 Torsional rigidity 158 non-null str \n", " 16 Heel counter stiffness 158 non-null str \n", " 17 Lug depth 158 non-null str \n", " 18 Heel stack lab Heel stack brand 158 non-null str \n", " 19 Forefoot lab Forefoot brand 158 non-null str \n", " 20 For heavy runners 154 non-null float64\n", " 21 Season 158 non-null str \n", " 22 Removable insole 158 non-null int64 \n", " 23 Orthotic friendly 158 non-null int64 \n", " 24 Waterproofing 156 non-null str \n", " 25 terrain_light 158 non-null int64 \n", " 26 terrain_moderate 158 non-null int64 \n", " 27 terrain_technical 158 non-null int64 \n", " 28 shock_low 158 non-null int64 \n", " 29 shock_moderate 158 non-null int64 \n", " 30 shock_high 158 non-null int64 \n", " 31 energy_low 158 non-null int64 \n", " 32 energy_moderate 158 non-null int64 \n", " 33 energy_high 158 non-null int64 \n", " 34 traction_moderate 158 non-null int64 \n", " 35 traction_high 158 non-null int64 \n", " 36 arch_neutral 158 non-null int64 \n", " 37 arch_stability 158 non-null int64 \n", "dtypes: float64(2), int64(15), str(21)\n", "memory usage: 47.0 KB\n" ] } ], "source": [ "df.drop(columns=['Arch support'], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "eba72c42", "metadata": {}, "source": [ "# Split Weight lab Weight brand" ] }, { "cell_type": "code", "execution_count": 34, "id": "4027e6f8", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "np.int64(0)" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mask_missing = (\n", " df[\"Weight lab Weight brand\"].isna() |\n", " (df[\"Weight lab Weight brand\"].astype(str).str.strip() == \"-\")\n", ")\n", "mask_missing.sum()" ] }, { "cell_type": "code", "execution_count": 35, "id": "dd34c04a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Weight lab Weight brand weight_lab_oz weight_lab_g \\\n", "0 9.1 oz / 259g 9.5 oz / 270g 9.1 259 \n", "1 9.1 oz / 258g 9 oz / 255g 9.1 258 \n", "2 10.1 oz / 285g 9.6 oz / 273g 10.1 285 \n", "3 9.4 oz / 266g 10.3 oz / 293g 9.4 266 \n", "4 10.7 oz / 302g 10.6 oz / 301g 10.7 302 \n", "\n", " weight_brand_oz weight_brand_g \n", "0 9.5 270.0 \n", "1 9.0 255.0 \n", "2 9.6 273.0 \n", "3 10.3 293.0 \n", "4 10.6 301.0 \n" ] } ], "source": [ "weight = df[\"Weight lab Weight brand\"].str.findall(r\"[\\d.]+\")\n", "df[[\"weight_lab_oz\", \"weight_lab_g\", \"weight_brand_oz\", \"weight_brand_g\"]] = (\n", " pd.DataFrame(weight.tolist(), index=df.index)\n", ")\n", "\n", "for col in [\"weight_lab_oz\", \"weight_lab_g\", \"weight_brand_oz\", \"weight_brand_g\"]:\n", " df[col] = pd.to_numeric(df[col], errors=\"coerce\")\n", "\n", "print(df[[\"Weight lab Weight brand\", \"weight_lab_oz\", \"weight_lab_g\", \"weight_brand_oz\", \"weight_brand_g\"]].head())" ] }, { "cell_type": "code", "execution_count": 36, "id": "4ad81586", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 41 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Drop lab Drop brand 158 non-null str \n", " 4 Strike pattern 158 non-null str \n", " 5 Midsole softness 158 non-null str \n", " 6 Plate 158 non-null str \n", " 7 Toebox durability 158 non-null str \n", " 8 Heel padding durability 158 non-null str \n", " 9 Outsole durability 158 non-null str \n", " 10 Breathability 158 non-null str \n", " 11 Width / fit 158 non-null str \n", " 12 Toebox width 158 non-null str \n", " 13 Stiffness 158 non-null str \n", " 14 Torsional rigidity 158 non-null str \n", " 15 Heel counter stiffness 158 non-null str \n", " 16 Lug depth 158 non-null str \n", " 17 Heel stack lab Heel stack brand 158 non-null str \n", " 18 Forefoot lab Forefoot brand 158 non-null str \n", " 19 For heavy runners 154 non-null float64\n", " 20 Season 158 non-null str \n", " 21 Removable insole 158 non-null int64 \n", " 22 Orthotic friendly 158 non-null int64 \n", " 23 Waterproofing 156 non-null str \n", " 24 terrain_light 158 non-null int64 \n", " 25 terrain_moderate 158 non-null int64 \n", " 26 terrain_technical 158 non-null int64 \n", " 27 shock_low 158 non-null int64 \n", " 28 shock_moderate 158 non-null int64 \n", " 29 shock_high 158 non-null int64 \n", " 30 energy_low 158 non-null int64 \n", " 31 energy_moderate 158 non-null int64 \n", " 32 energy_high 158 non-null int64 \n", " 33 traction_moderate 158 non-null int64 \n", " 34 traction_high 158 non-null int64 \n", " 35 arch_neutral 158 non-null int64 \n", " 36 arch_stability 158 non-null int64 \n", " 37 weight_lab_oz 158 non-null float64\n", " 38 weight_lab_g 158 non-null int64 \n", " 39 weight_brand_oz 155 non-null float64\n", " 40 weight_brand_g 155 non-null float64\n", "dtypes: float64(5), int64(16), str(20)\n", "memory usage: 50.7 KB\n" ] } ], "source": [ "df.drop(columns=[\"Weight lab Weight brand\",], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "7f8f3114", "metadata": {}, "source": [ "# Split Drop lab Drop brand" ] }, { "cell_type": "code", "execution_count": 37, "id": "d96d69ca", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "np.int64(0)" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mask_missing = (\n", " df[\"Drop lab Drop brand\"].isna() |\n", " (df[\"Drop lab Drop brand\"].astype(str).str.strip() == \"-\")\n", ")\n", "mask_missing.sum()" ] }, { "cell_type": "code", "execution_count": 38, "id": "33f141ae", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Drop lab Drop brand drop_lab_mm drop_brand_mm\n", "0 0.3 mm 8.0 mm 0.3 8.0\n", "1 8.2 mm 8.0 mm 8.2 8.0\n", "2 4.3 mm 4.0 mm 4.3 4.0\n", "3 6.1 mm 4.0 mm 6.1 4.0\n", "4 0.2 mm 0.0 mm 0.2 0.0\n" ] } ], "source": [ "drop = df[\"Drop lab Drop brand\"].str.findall(r\"[\\d.]+\")\n", "\n", "df[[\"drop_lab_mm\", \"drop_brand_mm\"]] = (\n", " pd.DataFrame(drop.tolist(), index=df.index)\n", ")\n", "\n", "for col in [\"drop_lab_mm\", \"drop_brand_mm\"]:\n", " df[col] = pd.to_numeric(df[col], errors=\"coerce\")\n", "\n", "print(df[[\"Drop lab Drop brand\", \"drop_lab_mm\", \"drop_brand_mm\"]].head())" ] }, { "cell_type": "code", "execution_count": 39, "id": "1d1c4eac", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 42 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Strike pattern 158 non-null str \n", " 4 Midsole softness 158 non-null str \n", " 5 Plate 158 non-null str \n", " 6 Toebox durability 158 non-null str \n", " 7 Heel padding durability 158 non-null str \n", " 8 Outsole durability 158 non-null str \n", " 9 Breathability 158 non-null str \n", " 10 Width / fit 158 non-null str \n", " 11 Toebox width 158 non-null str \n", " 12 Stiffness 158 non-null str \n", " 13 Torsional rigidity 158 non-null str \n", " 14 Heel counter stiffness 158 non-null str \n", " 15 Lug depth 158 non-null str \n", " 16 Heel stack lab Heel stack brand 158 non-null str \n", " 17 Forefoot lab Forefoot brand 158 non-null str \n", " 18 For heavy runners 154 non-null float64\n", " 19 Season 158 non-null str \n", " 20 Removable insole 158 non-null int64 \n", " 21 Orthotic friendly 158 non-null int64 \n", " 22 Waterproofing 156 non-null str \n", " 23 terrain_light 158 non-null int64 \n", " 24 terrain_moderate 158 non-null int64 \n", " 25 terrain_technical 158 non-null int64 \n", " 26 shock_low 158 non-null int64 \n", " 27 shock_moderate 158 non-null int64 \n", " 28 shock_high 158 non-null int64 \n", " 29 energy_low 158 non-null int64 \n", " 30 energy_moderate 158 non-null int64 \n", " 31 energy_high 158 non-null int64 \n", " 32 traction_moderate 158 non-null int64 \n", " 33 traction_high 158 non-null int64 \n", " 34 arch_neutral 158 non-null int64 \n", " 35 arch_stability 158 non-null int64 \n", " 36 weight_lab_oz 158 non-null float64\n", " 37 weight_lab_g 158 non-null int64 \n", " 38 weight_brand_oz 155 non-null float64\n", " 39 weight_brand_g 155 non-null float64\n", " 40 drop_lab_mm 158 non-null float64\n", " 41 drop_brand_mm 152 non-null float64\n", "dtypes: float64(7), int64(16), str(19)\n", "memory usage: 52.0 KB\n" ] } ], "source": [ "df.drop(columns=[\"Drop lab Drop brand\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "a60c8a59", "metadata": {}, "source": [ "# Strike pattern" ] }, { "cell_type": "code", "execution_count": 40, "id": "53e91a22", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Strike pattern\n", "Mid/forefoot 83\n", "Heel 48\n", "Heel Mid/forefoot 25\n", "HeelMid/forefoot 2\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Strike pattern\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 41, "id": "8f141a55", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "\n", "Unique Values in original column:\n", "\n", "['mid/forefoot', 'heel mid/forefoot', 'heel', 'heelmid/forefoot']\n", "Length: 4, dtype: str\n", "\n", "Sample Comparison (Multi-label Mapping):\n", " Strike pattern strike_heel strike_mid strike_forefoot\n", "0 mid/forefoot 0 1 1\n", "1 heel mid/forefoot 1 1 1\n", "2 mid/forefoot 0 1 1\n", "3 mid/forefoot 0 1 1\n", "4 mid/forefoot 0 1 1\n", "5 mid/forefoot 0 1 1\n", "6 mid/forefoot 0 1 1\n", "7 mid/forefoot 0 1 1\n", "8 mid/forefoot 0 1 1\n", "9 mid/forefoot 0 1 1\n" ] } ], "source": [ "df['Strike pattern'] = df['Strike pattern'].astype(str).str.lower()\n", "base_strikes = ['heel', 'mid', 'forefoot']\n", "\n", "for strike in base_strikes:\n", " column_name = f\"strike_{strike}\"\n", " df[column_name] = df['Strike pattern'].str.contains(strike, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "print(\"\\nUnique Values in original column:\")\n", "print(df[\"Strike pattern\"].unique())\n", "\n", "print(\"\\nSample Comparison (Multi-label Mapping):\")\n", "strike_cols = [f\"strike_{s}\" for s in base_strikes]\n", "print(df[[\"Strike pattern\"] + strike_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 42, "id": "1b1de021", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Strike pattern\n", "mid/forefoot 83\n", "heel 48\n", "heel mid/forefoot 25\n", "heelmid/forefoot 2\n", "Name: count, dtype: int64\n", "\n", "strike_heel sum: 75\n", "strike_mid sum: 110\n", "strike_forefoot sum: 110\n", "\n", " Strike pattern strike_heel strike_mid strike_forefoot\n", "0 mid/forefoot 0 1 1\n", "1 heel mid/forefoot 1 1 1\n", "2 mid/forefoot 0 1 1\n", "3 mid/forefoot 0 1 1\n", "4 mid/forefoot 0 1 1\n" ] } ], "source": [ "print(df[\"Strike pattern\"].value_counts())\n", "\n", "print()\n", "for strike in base_strikes:\n", " col = f\"strike_{strike}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Strike pattern\"] + strike_cols].head())" ] }, { "cell_type": "code", "execution_count": 43, "id": "767fe00e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 44 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Midsole softness 158 non-null str \n", " 4 Plate 158 non-null str \n", " 5 Toebox durability 158 non-null str \n", " 6 Heel padding durability 158 non-null str \n", " 7 Outsole durability 158 non-null str \n", " 8 Breathability 158 non-null str \n", " 9 Width / fit 158 non-null str \n", " 10 Toebox width 158 non-null str \n", " 11 Stiffness 158 non-null str \n", " 12 Torsional rigidity 158 non-null str \n", " 13 Heel counter stiffness 158 non-null str \n", " 14 Lug depth 158 non-null str \n", " 15 Heel stack lab Heel stack brand 158 non-null str \n", " 16 Forefoot lab Forefoot brand 158 non-null str \n", " 17 For heavy runners 154 non-null float64\n", " 18 Season 158 non-null str \n", " 19 Removable insole 158 non-null int64 \n", " 20 Orthotic friendly 158 non-null int64 \n", " 21 Waterproofing 156 non-null str \n", " 22 terrain_light 158 non-null int64 \n", " 23 terrain_moderate 158 non-null int64 \n", " 24 terrain_technical 158 non-null int64 \n", " 25 shock_low 158 non-null int64 \n", " 26 shock_moderate 158 non-null int64 \n", " 27 shock_high 158 non-null int64 \n", " 28 energy_low 158 non-null int64 \n", " 29 energy_moderate 158 non-null int64 \n", " 30 energy_high 158 non-null int64 \n", " 31 traction_moderate 158 non-null int64 \n", " 32 traction_high 158 non-null int64 \n", " 33 arch_neutral 158 non-null int64 \n", " 34 arch_stability 158 non-null int64 \n", " 35 weight_lab_oz 158 non-null float64\n", " 36 weight_lab_g 158 non-null int64 \n", " 37 weight_brand_oz 155 non-null float64\n", " 38 weight_brand_g 155 non-null float64\n", " 39 drop_lab_mm 158 non-null float64\n", " 40 drop_brand_mm 152 non-null float64\n", " 41 strike_heel 158 non-null int64 \n", " 42 strike_mid 158 non-null int64 \n", " 43 strike_forefoot 158 non-null int64 \n", "dtypes: float64(7), int64(19), str(18)\n", "memory usage: 54.4 KB\n" ] } ], "source": [ "df.drop(columns=['Strike pattern'], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "d9e9ece2", "metadata": {}, "source": [ "# Midsole softness" ] }, { "cell_type": "code", "execution_count": 44, "id": "b524c2a4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Midsole softness\n", "Balanced 72\n", "Soft 54\n", "- 19\n", "Firm 13\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Midsole softness\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 45, "id": "f61696ae", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "Baris dengan semua OHE 0 (termasuk '-'): 19\n", "\n", "Sample Comparison:\n", " Midsole softness softness_soft softness_balanced softness_firm\n", "0 balanced 0 1 0\n", "1 - 0 0 0\n", "2 soft 1 0 0\n", "3 balanced 0 1 0\n", "4 - 0 0 0\n", "5 - 0 0 0\n", "6 balanced 0 1 0\n", "7 balanced 0 1 0\n", "8 balanced 0 1 0\n", "9 - 0 0 0\n" ] } ], "source": [ "df['Midsole softness'] = df['Midsole softness'].astype(str).str.lower()\n", "base_softness = ['soft', 'balanced', 'firm']\n", "\n", "\n", "for level in base_softness:\n", " column_name = f\"softness_{level}\"\n", " df[column_name] = df['Midsole softness'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "softness_cols = [f\"softness_{l}\" for l in base_softness]\n", "zero_vector_count = (df[softness_cols].sum(axis=1) == 0).sum()\n", "print(f\"Baris dengan semua OHE 0 (termasuk '-'): {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Midsole softness\"] + softness_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 46, "id": "bf43f93c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Midsole softness\n", "balanced 72\n", "soft 54\n", "- 19\n", "firm 13\n", "Name: count, dtype: int64\n", "\n", "softness_soft sum: 54\n", "softness_balanced sum: 72\n", "softness_firm sum: 13\n", "\n", " Midsole softness softness_soft softness_balanced softness_firm\n", "0 balanced 0 1 0\n", "1 - 0 0 0\n", "2 soft 1 0 0\n", "3 balanced 0 1 0\n", "4 - 0 0 0\n" ] } ], "source": [ "print(df[\"Midsole softness\"].value_counts())\n", "\n", "print()\n", "for level in base_softness:\n", " col = f\"softness_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Midsole softness\"] + softness_cols].head())" ] }, { "cell_type": "code", "execution_count": 47, "id": "c361b27d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 46 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Plate 158 non-null str \n", " 4 Toebox durability 158 non-null str \n", " 5 Heel padding durability 158 non-null str \n", " 6 Outsole durability 158 non-null str \n", " 7 Breathability 158 non-null str \n", " 8 Width / fit 158 non-null str \n", " 9 Toebox width 158 non-null str \n", " 10 Stiffness 158 non-null str \n", " 11 Torsional rigidity 158 non-null str \n", " 12 Heel counter stiffness 158 non-null str \n", " 13 Lug depth 158 non-null str \n", " 14 Heel stack lab Heel stack brand 158 non-null str \n", " 15 Forefoot lab Forefoot brand 158 non-null str \n", " 16 For heavy runners 154 non-null float64\n", " 17 Season 158 non-null str \n", " 18 Removable insole 158 non-null int64 \n", " 19 Orthotic friendly 158 non-null int64 \n", " 20 Waterproofing 156 non-null str \n", " 21 terrain_light 158 non-null int64 \n", " 22 terrain_moderate 158 non-null int64 \n", " 23 terrain_technical 158 non-null int64 \n", " 24 shock_low 158 non-null int64 \n", " 25 shock_moderate 158 non-null int64 \n", " 26 shock_high 158 non-null int64 \n", " 27 energy_low 158 non-null int64 \n", " 28 energy_moderate 158 non-null int64 \n", " 29 energy_high 158 non-null int64 \n", " 30 traction_moderate 158 non-null int64 \n", " 31 traction_high 158 non-null int64 \n", " 32 arch_neutral 158 non-null int64 \n", " 33 arch_stability 158 non-null int64 \n", " 34 weight_lab_oz 158 non-null float64\n", " 35 weight_lab_g 158 non-null int64 \n", " 36 weight_brand_oz 155 non-null float64\n", " 37 weight_brand_g 155 non-null float64\n", " 38 drop_lab_mm 158 non-null float64\n", " 39 drop_brand_mm 152 non-null float64\n", " 40 strike_heel 158 non-null int64 \n", " 41 strike_mid 158 non-null int64 \n", " 42 strike_forefoot 158 non-null int64 \n", " 43 softness_soft 158 non-null int64 \n", " 44 softness_balanced 158 non-null int64 \n", " 45 softness_firm 158 non-null int64 \n", "dtypes: float64(7), int64(22), str(17)\n", "memory usage: 56.9 KB\n" ] } ], "source": [ "df.drop(columns=[\"Midsole softness\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "00df0f14", "metadata": {}, "source": [ "# Toebox durability" ] }, { "cell_type": "code", "execution_count": 48, "id": "6e926181", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Toebox durability\n", "Good 39\n", "Decent 39\n", "- 36\n", "Bad 17\n", "Very bad 15\n", "Very good 12\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Toebox durability'].value_counts())" ] }, { "cell_type": "code", "execution_count": 49, "id": "8a18a9a8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "\n", "Unique Values mapping check:\n", "'-' di-encode menjadi 0 (Total: 36)\n", "'very bad' di-encode menjadi 1 (Total: 15)\n", "'bad' di-encode menjadi 2 (Total: 17)\n", "'decent' di-encode menjadi 3 (Total: 39)\n", "'good' di-encode menjadi 4 (Total: 39)\n", "'very good' di-encode menjadi 5 (Total: 12)\n", "\n", "Sample Data:\n", " Toebox durability toebox_durability\n", "0 good 4\n", "1 - 0\n", "2 decent 3\n", "3 decent 3\n", "4 - 0\n", "5 - 0\n", "6 - 0\n", "7 good 4\n", "8 decent 3\n", "9 - 0\n" ] } ], "source": [ "df['Toebox durability'] = df['Toebox durability'].astype(str).str.lower()\n", "\n", "durability_map = {\n", " \"-\": 0,\n", " \"very bad\": 1,\n", " \"bad\": 2,\n", " \"decent\": 3,\n", " \"good\": 4,\n", " \"very good\": 5\n", "}\n", "\n", "df['toebox_durability'] = df['Toebox durability'].map(durability_map)\n", "print(\"Rows:\", len(df))\n", "\n", "print(\"\\nUnique Values mapping check:\")\n", "for label, value in durability_map.items():\n", " count = (df['Toebox durability'] == label).sum()\n", " print(f\"'{label}' di-encode menjadi {value} (Total: {count})\")\n", "\n", "print(\"\\nSample Data:\")\n", "print(df[[\"Toebox durability\", \"toebox_durability\"]].head(10))" ] }, { "cell_type": "code", "execution_count": 50, "id": "96538ff1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 46 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Plate 158 non-null str \n", " 4 Heel padding durability 158 non-null str \n", " 5 Outsole durability 158 non-null str \n", " 6 Breathability 158 non-null str \n", " 7 Width / fit 158 non-null str \n", " 8 Toebox width 158 non-null str \n", " 9 Stiffness 158 non-null str \n", " 10 Torsional rigidity 158 non-null str \n", " 11 Heel counter stiffness 158 non-null str \n", " 12 Lug depth 158 non-null str \n", " 13 Heel stack lab Heel stack brand 158 non-null str \n", " 14 Forefoot lab Forefoot brand 158 non-null str \n", " 15 For heavy runners 154 non-null float64\n", " 16 Season 158 non-null str \n", " 17 Removable insole 158 non-null int64 \n", " 18 Orthotic friendly 158 non-null int64 \n", " 19 Waterproofing 156 non-null str \n", " 20 terrain_light 158 non-null int64 \n", " 21 terrain_moderate 158 non-null int64 \n", " 22 terrain_technical 158 non-null int64 \n", " 23 shock_low 158 non-null int64 \n", " 24 shock_moderate 158 non-null int64 \n", " 25 shock_high 158 non-null int64 \n", " 26 energy_low 158 non-null int64 \n", " 27 energy_moderate 158 non-null int64 \n", " 28 energy_high 158 non-null int64 \n", " 29 traction_moderate 158 non-null int64 \n", " 30 traction_high 158 non-null int64 \n", " 31 arch_neutral 158 non-null int64 \n", " 32 arch_stability 158 non-null int64 \n", " 33 weight_lab_oz 158 non-null float64\n", " 34 weight_lab_g 158 non-null int64 \n", " 35 weight_brand_oz 155 non-null float64\n", " 36 weight_brand_g 155 non-null float64\n", " 37 drop_lab_mm 158 non-null float64\n", " 38 drop_brand_mm 152 non-null float64\n", " 39 strike_heel 158 non-null int64 \n", " 40 strike_mid 158 non-null int64 \n", " 41 strike_forefoot 158 non-null int64 \n", " 42 softness_soft 158 non-null int64 \n", " 43 softness_balanced 158 non-null int64 \n", " 44 softness_firm 158 non-null int64 \n", " 45 toebox_durability 158 non-null int64 \n", "dtypes: float64(7), int64(23), str(16)\n", "memory usage: 56.9 KB\n" ] } ], "source": [ "df.drop(columns=['Toebox durability'], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "554157d1", "metadata": {}, "source": [ "# Heel padding durability" ] }, { "cell_type": "code", "execution_count": 51, "id": "0d78f5d6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Heel padding durability\n", "Decent 51\n", "Good 50\n", "- 38\n", "Bad 19\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Heel padding durability\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 52, "id": "c5df3591", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--- Value Counts Kolom Asli ---\n", "Heel padding durability\n", "decent 51\n", "good 50\n", "- 38\n", "bad 19\n", "Name: count, dtype: int64\n", "\n", "--- Sebaran Nilai Hasil Ordinal ---\n", "Index 0: 38 baris\n", "Index 1: 0 baris\n", "Index 2: 19 baris\n", "Index 3: 51 baris\n", "Index 4: 50 baris\n", "Index 5: 0 baris\n", "\n", "--- Perbandingan Data (Head) ---\n" ] } ], "source": [ "df['Heel padding durability'] = df['Heel padding durability'].astype(str).str.lower()\n", "\n", "durability_scale_5 = {\n", " \"-\": 0,\n", " \"very bad\": 1,\n", " \"bad\": 2,\n", " \"decent\": 3,\n", " \"good\": 4,\n", " \"very good\": 5\n", "}\n", "\n", "\n", "df['heel_durability'] = df['Heel padding durability'].map(durability_scale_5)\n", "\n", "\n", "print(\"--- Value Counts Kolom Asli ---\")\n", "print(df[\"Heel padding durability\"].value_counts())\n", "\n", "print(\"\\n--- Sebaran Nilai Hasil Ordinal ---\")\n", "counts = df[\"heel_durability\"].value_counts().sort_index()\n", "for i in range(6):\n", " print(f\"Index {i}: {counts.get(i, 0)} baris\")\n", "\n", "print(\"\\n--- Perbandingan Data (Head) ---\")\n", "# print(df[[\"Heel padding durability\", \"heel_durability\"]].head())" ] }, { "cell_type": "code", "execution_count": 53, "id": "5126e7a6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 46 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Plate 158 non-null str \n", " 4 Outsole durability 158 non-null str \n", " 5 Breathability 158 non-null str \n", " 6 Width / fit 158 non-null str \n", " 7 Toebox width 158 non-null str \n", " 8 Stiffness 158 non-null str \n", " 9 Torsional rigidity 158 non-null str \n", " 10 Heel counter stiffness 158 non-null str \n", " 11 Lug depth 158 non-null str \n", " 12 Heel stack lab Heel stack brand 158 non-null str \n", " 13 Forefoot lab Forefoot brand 158 non-null str \n", " 14 For heavy runners 154 non-null float64\n", " 15 Season 158 non-null str \n", " 16 Removable insole 158 non-null int64 \n", " 17 Orthotic friendly 158 non-null int64 \n", " 18 Waterproofing 156 non-null str \n", " 19 terrain_light 158 non-null int64 \n", " 20 terrain_moderate 158 non-null int64 \n", " 21 terrain_technical 158 non-null int64 \n", " 22 shock_low 158 non-null int64 \n", " 23 shock_moderate 158 non-null int64 \n", " 24 shock_high 158 non-null int64 \n", " 25 energy_low 158 non-null int64 \n", " 26 energy_moderate 158 non-null int64 \n", " 27 energy_high 158 non-null int64 \n", " 28 traction_moderate 158 non-null int64 \n", " 29 traction_high 158 non-null int64 \n", " 30 arch_neutral 158 non-null int64 \n", " 31 arch_stability 158 non-null int64 \n", " 32 weight_lab_oz 158 non-null float64\n", " 33 weight_lab_g 158 non-null int64 \n", " 34 weight_brand_oz 155 non-null float64\n", " 35 weight_brand_g 155 non-null float64\n", " 36 drop_lab_mm 158 non-null float64\n", " 37 drop_brand_mm 152 non-null float64\n", " 38 strike_heel 158 non-null int64 \n", " 39 strike_mid 158 non-null int64 \n", " 40 strike_forefoot 158 non-null int64 \n", " 41 softness_soft 158 non-null int64 \n", " 42 softness_balanced 158 non-null int64 \n", " 43 softness_firm 158 non-null int64 \n", " 44 toebox_durability 158 non-null int64 \n", " 45 heel_durability 158 non-null int64 \n", "dtypes: float64(7), int64(24), str(15)\n", "memory usage: 56.9 KB\n" ] } ], "source": [ "df.drop('Heel padding durability', axis=1, inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 54, "id": "46a4046e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
BrandNameLightweightPlateOutsole durabilityBreathabilityWidth / fitToebox widthStiffnessTorsional rigidity...drop_lab_mmdrop_brand_mmstrike_heelstrike_midstrike_forefootsoftness_softsoftness_balancedsoftness_firmtoebox_durabilityheel_durability
0adidasterrex agravic speed ultra0.00DecentModerateMediumNarrowModerateStiff...0.38.001101044
1adidasterrex speed ultra0.00--Narrow-StiffFlexible...8.28.011100000
2altraexperience wild0.00GoodModerateWideWideModerateStiff...4.34.001110033
3altraexperience wild 20.00GoodWarmWideWideModerateModerate...6.14.001101034
4altralone peak 5.00.0Rock plate--Narrow-StiffFlexible...0.20.001100000
\n", "

5 rows × 46 columns

\n", "
" ], "text/plain": [ " Brand Name Lightweight Plate \\\n", "0 adidas terrex agravic speed ultra 0.0 0 \n", "1 adidas terrex speed ultra 0.0 0 \n", "2 altra experience wild 0.0 0 \n", "3 altra experience wild 2 0.0 0 \n", "4 altra lone peak 5.0 0.0 Rock plate \n", "\n", " Outsole durability Breathability Width / fit Toebox width Stiffness \\\n", "0 Decent Moderate Medium Narrow Moderate \n", "1 - - Narrow - Stiff \n", "2 Good Moderate Wide Wide Moderate \n", "3 Good Warm Wide Wide Moderate \n", "4 - - Narrow - Stiff \n", "\n", " Torsional rigidity ... drop_lab_mm drop_brand_mm strike_heel strike_mid \\\n", "0 Stiff ... 0.3 8.0 0 1 \n", "1 Flexible ... 8.2 8.0 1 1 \n", "2 Stiff ... 4.3 4.0 0 1 \n", "3 Moderate ... 6.1 4.0 0 1 \n", "4 Flexible ... 0.2 0.0 0 1 \n", "\n", " strike_forefoot softness_soft softness_balanced softness_firm \\\n", "0 1 0 1 0 \n", "1 1 0 0 0 \n", "2 1 1 0 0 \n", "3 1 0 1 0 \n", "4 1 0 0 0 \n", "\n", " toebox_durability heel_durability \n", "0 4 4 \n", "1 0 0 \n", "2 3 3 \n", "3 3 4 \n", "4 0 0 \n", "\n", "[5 rows x 46 columns]" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.head()" ] }, { "cell_type": "markdown", "id": "20b755dc", "metadata": {}, "source": [ "# Outsole durability" ] }, { "cell_type": "code", "execution_count": 55, "id": "0647abf7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Outsole durability\n", "Good 77\n", "- 42\n", "Decent 38\n", "Bad 1\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Outsole durability\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 56, "id": "fbba911c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--- Value Counts Kolom Asli ---\n", "Outsole durability\n", "good 77\n", "- 42\n", "decent 38\n", "bad 1\n", "Name: count, dtype: int64\n", "\n", "--- Sebaran Nilai Hasil Ordinal (Scale 1-5) ---\n", "Index 0: 42 baris\n", "Index 1: 0 baris\n", "Index 2: 1 baris\n", "Index 3: 38 baris\n", "Index 4: 77 baris\n", "Index 5: 0 baris\n", "\n", "--- Perbandingan Data (Head) ---\n", " Outsole durability outsole_durability\n", "0 decent 3\n", "1 - 0\n", "2 good 4\n", "3 good 4\n", "4 - 0\n" ] } ], "source": [ "df['Outsole durability'] = df['Outsole durability'].astype(str).str.lower()\n", "\n", "durability_scale_5 = {\n", " \"-\": 0,\n", " \"very bad\": 1,\n", " \"bad\": 2,\n", " \"decent\": 3,\n", " \"good\": 4,\n", " \"very good\": 5\n", "}\n", "\n", "\n", "df['outsole_durability'] = df['Outsole durability'].map(durability_scale_5)\n", "print(\"--- Value Counts Kolom Asli ---\")\n", "print(df[\"Outsole durability\"].value_counts())\n", "\n", "print(\"\\n--- Sebaran Nilai Hasil Ordinal (Scale 1-5) ---\")\n", "counts = df[\"outsole_durability\"].value_counts().sort_index()\n", "for i in range(6):\n", " print(f\"Index {i}: {counts.get(i, 0)} baris\")\n", "\n", "print(\"\\n--- Perbandingan Data (Head) ---\")\n", "print(df[[\"Outsole durability\", \"outsole_durability\"]].head())" ] }, { "cell_type": "code", "execution_count": 57, "id": "b9a91d05", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 46 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Plate 158 non-null str \n", " 4 Breathability 158 non-null str \n", " 5 Width / fit 158 non-null str \n", " 6 Toebox width 158 non-null str \n", " 7 Stiffness 158 non-null str \n", " 8 Torsional rigidity 158 non-null str \n", " 9 Heel counter stiffness 158 non-null str \n", " 10 Lug depth 158 non-null str \n", " 11 Heel stack lab Heel stack brand 158 non-null str \n", " 12 Forefoot lab Forefoot brand 158 non-null str \n", " 13 For heavy runners 154 non-null float64\n", " 14 Season 158 non-null str \n", " 15 Removable insole 158 non-null int64 \n", " 16 Orthotic friendly 158 non-null int64 \n", " 17 Waterproofing 156 non-null str \n", " 18 terrain_light 158 non-null int64 \n", " 19 terrain_moderate 158 non-null int64 \n", " 20 terrain_technical 158 non-null int64 \n", " 21 shock_low 158 non-null int64 \n", " 22 shock_moderate 158 non-null int64 \n", " 23 shock_high 158 non-null int64 \n", " 24 energy_low 158 non-null int64 \n", " 25 energy_moderate 158 non-null int64 \n", " 26 energy_high 158 non-null int64 \n", " 27 traction_moderate 158 non-null int64 \n", " 28 traction_high 158 non-null int64 \n", " 29 arch_neutral 158 non-null int64 \n", " 30 arch_stability 158 non-null int64 \n", " 31 weight_lab_oz 158 non-null float64\n", " 32 weight_lab_g 158 non-null int64 \n", " 33 weight_brand_oz 155 non-null float64\n", " 34 weight_brand_g 155 non-null float64\n", " 35 drop_lab_mm 158 non-null float64\n", " 36 drop_brand_mm 152 non-null float64\n", " 37 strike_heel 158 non-null int64 \n", " 38 strike_mid 158 non-null int64 \n", " 39 strike_forefoot 158 non-null int64 \n", " 40 softness_soft 158 non-null int64 \n", " 41 softness_balanced 158 non-null int64 \n", " 42 softness_firm 158 non-null int64 \n", " 43 toebox_durability 158 non-null int64 \n", " 44 heel_durability 158 non-null int64 \n", " 45 outsole_durability 158 non-null int64 \n", "dtypes: float64(7), int64(25), str(14)\n", "memory usage: 56.9 KB\n" ] } ], "source": [ "df.drop('Outsole durability', axis=1, inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "d6e10b84", "metadata": {}, "source": [ "# Breathability" ] }, { "cell_type": "code", "execution_count": 58, "id": "c6a78523", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Breathability\n", "Moderate 92\n", "Warm 31\n", "- 19\n", "Breathable 16\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Breathability\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 59, "id": "35945fd4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--- Value Counts Kolom Asli ---\n", "Breathability\n", "moderate 92\n", "warm 31\n", "- 19\n", "breathable 16\n", "Name: count, dtype: int64\n", "\n", "--- Sebaran Nilai Hasil Ordinal (Scale 1-5) ---\n", "Index 0: 19 baris\n", "Index 1: 0 baris\n", "Index 2: 31 baris\n", "Index 3: 92 baris\n", "Index 4: 0 baris\n", "Index 5: 16 baris\n", "\n", "--- Perbandingan Data (Head) ---\n", " Breathability breathability\n", "0 moderate 3\n", "1 - 0\n", "2 moderate 3\n", "3 warm 2\n", "4 - 0\n" ] } ], "source": [ "df['Breathability'] = df['Breathability'].astype(str).str.lower()\n", "\n", "breathability_scale_5 = {\n", " \"-\": 0,\n", " \"suffocating\": 1,\n", " \"warm\": 2,\n", " \"moderate\": 3,\n", " \"good\": 4,\n", " \"breathable\": 5\n", "}\n", "\n", "df['breathability'] = df['Breathability'].map(breathability_scale_5)\n", "\n", "print(\"--- Value Counts Kolom Asli ---\")\n", "print(df[\"Breathability\"].value_counts())\n", "\n", "print(\"\\n--- Sebaran Nilai Hasil Ordinal (Scale 1-5) ---\")\n", "counts = df[\"breathability\"].value_counts().sort_index()\n", "for i in range(6):\n", " print(f\"Index {i}: {counts.get(i, 0)} baris\")\n", "\n", "print(\"\\n--- Perbandingan Data (Head) ---\")\n", "print(df[[\"Breathability\", \"breathability\"]].head())" ] }, { "cell_type": "code", "execution_count": 60, "id": "f9163564", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 46 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Plate 158 non-null str \n", " 4 Width / fit 158 non-null str \n", " 5 Toebox width 158 non-null str \n", " 6 Stiffness 158 non-null str \n", " 7 Torsional rigidity 158 non-null str \n", " 8 Heel counter stiffness 158 non-null str \n", " 9 Lug depth 158 non-null str \n", " 10 Heel stack lab Heel stack brand 158 non-null str \n", " 11 Forefoot lab Forefoot brand 158 non-null str \n", " 12 For heavy runners 154 non-null float64\n", " 13 Season 158 non-null str \n", " 14 Removable insole 158 non-null int64 \n", " 15 Orthotic friendly 158 non-null int64 \n", " 16 Waterproofing 156 non-null str \n", " 17 terrain_light 158 non-null int64 \n", " 18 terrain_moderate 158 non-null int64 \n", " 19 terrain_technical 158 non-null int64 \n", " 20 shock_low 158 non-null int64 \n", " 21 shock_moderate 158 non-null int64 \n", " 22 shock_high 158 non-null int64 \n", " 23 energy_low 158 non-null int64 \n", " 24 energy_moderate 158 non-null int64 \n", " 25 energy_high 158 non-null int64 \n", " 26 traction_moderate 158 non-null int64 \n", " 27 traction_high 158 non-null int64 \n", " 28 arch_neutral 158 non-null int64 \n", " 29 arch_stability 158 non-null int64 \n", " 30 weight_lab_oz 158 non-null float64\n", " 31 weight_lab_g 158 non-null int64 \n", " 32 weight_brand_oz 155 non-null float64\n", " 33 weight_brand_g 155 non-null float64\n", " 34 drop_lab_mm 158 non-null float64\n", " 35 drop_brand_mm 152 non-null float64\n", " 36 strike_heel 158 non-null int64 \n", " 37 strike_mid 158 non-null int64 \n", " 38 strike_forefoot 158 non-null int64 \n", " 39 softness_soft 158 non-null int64 \n", " 40 softness_balanced 158 non-null int64 \n", " 41 softness_firm 158 non-null int64 \n", " 42 toebox_durability 158 non-null int64 \n", " 43 heel_durability 158 non-null int64 \n", " 44 outsole_durability 158 non-null int64 \n", " 45 breathability 158 non-null int64 \n", "dtypes: float64(7), int64(26), str(13)\n", "memory usage: 56.9 KB\n" ] } ], "source": [ "df.drop('Breathability', axis=1, inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "838283e8", "metadata": {}, "source": [ "# Plate" ] }, { "cell_type": "code", "execution_count": 61, "id": "eb229705", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Plate\n", "0 112\n", "Rock plate 35\n", "Carbon plate 11\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Plate\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 62, "id": "a97958df", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 0\n", "\n", "Sample Comparison:\n", " Plate plate_0 plate_rock_plate plate_carbon_plate\n", "0 0 1 0 0\n", "1 0 1 0 0\n", "2 0 1 0 0\n", "3 0 1 0 0\n", "4 rock plate 0 1 0\n", "5 rock plate 0 1 0\n", "6 0 1 0 0\n", "7 0 1 0 0\n", "8 0 1 0 0\n", "9 0 1 0 0\n" ] } ], "source": [ "df['Plate'] = df['Plate'].astype(str).str.lower()\n", "base_plate = ['0', 'rock plate', 'carbon plate']\n", "\n", "for level in base_plate:\n", " column_name = f\"plate_{level.replace(' ', '_')}\"\n", " if level == '0':\n", " df[column_name] = (df['Plate'] == '0').astype(int)\n", " else:\n", " df[column_name] = df['Plate'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "plate_cols = [f\"plate_{l.replace(' ', '_')}\" for l in base_plate]\n", "zero_vector_count = (df[plate_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Plate\"] + plate_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 63, "id": "ff871a52", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Plate\n", "0 112\n", "rock plate 35\n", "carbon plate 11\n", "Name: count, dtype: int64\n", "\n", "plate_0 sum: 112\n", "plate_rock_plate sum: 35\n", "plate_carbon_plate sum: 11\n", "\n", " Plate plate_0 plate_rock_plate plate_carbon_plate\n", "0 0 1 0 0\n", "1 0 1 0 0\n", "2 0 1 0 0\n", "3 0 1 0 0\n", "4 rock plate 0 1 0\n" ] } ], "source": [ "print(df[\"Plate\"].value_counts())\n", "\n", "print()\n", "for level in base_plate:\n", " col = f\"plate_{level.replace(' ', '_')}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Plate\"] + plate_cols].head())" ] }, { "cell_type": "code", "execution_count": 64, "id": "8173c5b5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 48 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Width / fit 158 non-null str \n", " 4 Toebox width 158 non-null str \n", " 5 Stiffness 158 non-null str \n", " 6 Torsional rigidity 158 non-null str \n", " 7 Heel counter stiffness 158 non-null str \n", " 8 Lug depth 158 non-null str \n", " 9 Heel stack lab Heel stack brand 158 non-null str \n", " 10 Forefoot lab Forefoot brand 158 non-null str \n", " 11 For heavy runners 154 non-null float64\n", " 12 Season 158 non-null str \n", " 13 Removable insole 158 non-null int64 \n", " 14 Orthotic friendly 158 non-null int64 \n", " 15 Waterproofing 156 non-null str \n", " 16 terrain_light 158 non-null int64 \n", " 17 terrain_moderate 158 non-null int64 \n", " 18 terrain_technical 158 non-null int64 \n", " 19 shock_low 158 non-null int64 \n", " 20 shock_moderate 158 non-null int64 \n", " 21 shock_high 158 non-null int64 \n", " 22 energy_low 158 non-null int64 \n", " 23 energy_moderate 158 non-null int64 \n", " 24 energy_high 158 non-null int64 \n", " 25 traction_moderate 158 non-null int64 \n", " 26 traction_high 158 non-null int64 \n", " 27 arch_neutral 158 non-null int64 \n", " 28 arch_stability 158 non-null int64 \n", " 29 weight_lab_oz 158 non-null float64\n", " 30 weight_lab_g 158 non-null int64 \n", " 31 weight_brand_oz 155 non-null float64\n", " 32 weight_brand_g 155 non-null float64\n", " 33 drop_lab_mm 158 non-null float64\n", " 34 drop_brand_mm 152 non-null float64\n", " 35 strike_heel 158 non-null int64 \n", " 36 strike_mid 158 non-null int64 \n", " 37 strike_forefoot 158 non-null int64 \n", " 38 softness_soft 158 non-null int64 \n", " 39 softness_balanced 158 non-null int64 \n", " 40 softness_firm 158 non-null int64 \n", " 41 toebox_durability 158 non-null int64 \n", " 42 heel_durability 158 non-null int64 \n", " 43 outsole_durability 158 non-null int64 \n", " 44 breathability 158 non-null int64 \n", " 45 plate_0 158 non-null int64 \n", " 46 plate_rock_plate 158 non-null int64 \n", " 47 plate_carbon_plate 158 non-null int64 \n", "dtypes: float64(7), int64(29), str(12)\n", "memory usage: 59.4 KB\n" ] } ], "source": [ "df.drop(columns=[\"Plate\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "273e5d26", "metadata": {}, "source": [ "# Width / fit" ] }, { "cell_type": "code", "execution_count": 65, "id": "229ae3b1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Width / fit\n", "Medium 92\n", "Narrow 47\n", "Wide 19\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Width / fit'].value_counts())" ] }, { "cell_type": "code", "execution_count": 66, "id": "9e4b2c22", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 0\n", "\n", "Sample Comparison:\n", " Width / fit width_narrow width_medium width_wide\n", "0 medium 0 1 0\n", "1 narrow 1 0 0\n", "2 wide 0 0 1\n", "3 wide 0 0 1\n", "4 narrow 1 0 0\n", "5 wide 0 0 1\n", "6 narrow 1 0 0\n", "7 medium 0 1 0\n", "8 wide 0 0 1\n", "9 medium 0 1 0\n" ] } ], "source": [ "df['Width / fit'] = df['Width / fit'].astype(str).str.lower()\n", "base_widths = ['narrow', 'medium', 'wide']\n", "\n", "for level in base_widths:\n", " column_name = f\"width_{level}\"\n", " df[column_name] = df['Width / fit'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "width_cols = [f\"width_{l}\" for l in base_widths]\n", "zero_vector_count = (df[width_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Width / fit\"] + width_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 67, "id": "3d808900", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Width / fit\n", "medium 92\n", "narrow 47\n", "wide 19\n", "Name: count, dtype: int64\n", "\n", "width_narrow sum: 47\n", "width_medium sum: 92\n", "width_wide sum: 19\n", "\n", " Width / fit width_narrow width_medium width_wide\n", "0 medium 0 1 0\n", "1 narrow 1 0 0\n", "2 wide 0 0 1\n", "3 wide 0 0 1\n", "4 narrow 1 0 0\n" ] } ], "source": [ "print(df[\"Width / fit\"].value_counts())\n", "\n", "print()\n", "for level in base_widths:\n", " col = f\"width_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Width / fit\"] + width_cols].head())" ] }, { "cell_type": "code", "execution_count": 68, "id": "227f8218", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 50 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Toebox width 158 non-null str \n", " 4 Stiffness 158 non-null str \n", " 5 Torsional rigidity 158 non-null str \n", " 6 Heel counter stiffness 158 non-null str \n", " 7 Lug depth 158 non-null str \n", " 8 Heel stack lab Heel stack brand 158 non-null str \n", " 9 Forefoot lab Forefoot brand 158 non-null str \n", " 10 For heavy runners 154 non-null float64\n", " 11 Season 158 non-null str \n", " 12 Removable insole 158 non-null int64 \n", " 13 Orthotic friendly 158 non-null int64 \n", " 14 Waterproofing 156 non-null str \n", " 15 terrain_light 158 non-null int64 \n", " 16 terrain_moderate 158 non-null int64 \n", " 17 terrain_technical 158 non-null int64 \n", " 18 shock_low 158 non-null int64 \n", " 19 shock_moderate 158 non-null int64 \n", " 20 shock_high 158 non-null int64 \n", " 21 energy_low 158 non-null int64 \n", " 22 energy_moderate 158 non-null int64 \n", " 23 energy_high 158 non-null int64 \n", " 24 traction_moderate 158 non-null int64 \n", " 25 traction_high 158 non-null int64 \n", " 26 arch_neutral 158 non-null int64 \n", " 27 arch_stability 158 non-null int64 \n", " 28 weight_lab_oz 158 non-null float64\n", " 29 weight_lab_g 158 non-null int64 \n", " 30 weight_brand_oz 155 non-null float64\n", " 31 weight_brand_g 155 non-null float64\n", " 32 drop_lab_mm 158 non-null float64\n", " 33 drop_brand_mm 152 non-null float64\n", " 34 strike_heel 158 non-null int64 \n", " 35 strike_mid 158 non-null int64 \n", " 36 strike_forefoot 158 non-null int64 \n", " 37 softness_soft 158 non-null int64 \n", " 38 softness_balanced 158 non-null int64 \n", " 39 softness_firm 158 non-null int64 \n", " 40 toebox_durability 158 non-null int64 \n", " 41 heel_durability 158 non-null int64 \n", " 42 outsole_durability 158 non-null int64 \n", " 43 breathability 158 non-null int64 \n", " 44 plate_0 158 non-null int64 \n", " 45 plate_rock_plate 158 non-null int64 \n", " 46 plate_carbon_plate 158 non-null int64 \n", " 47 width_narrow 158 non-null int64 \n", " 48 width_medium 158 non-null int64 \n", " 49 width_wide 158 non-null int64 \n", "dtypes: float64(7), int64(32), str(11)\n", "memory usage: 61.8 KB\n" ] } ], "source": [ "df.drop(columns=[\"Width / fit\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "2f75044e", "metadata": {}, "source": [ "# Toebox width" ] }, { "cell_type": "code", "execution_count": 69, "id": "5534fbde", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Toebox width\n", "Medium 68\n", "Wide 38\n", "- 32\n", "Narrow 20\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Toebox width'].value_counts())" ] }, { "cell_type": "code", "execution_count": 70, "id": "8a4afd8d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 32\n", "\n", "Sample Comparison:\n", " Toebox width toebox_narrow toebox_medium toebox_wide\n", "0 narrow 1 0 0\n", "1 - 0 0 0\n", "2 wide 0 0 1\n", "3 wide 0 0 1\n", "4 - 0 0 0\n", "5 - 0 0 0\n", "6 - 0 0 0\n", "7 wide 0 0 1\n", "8 wide 0 0 1\n", "9 - 0 0 0\n" ] } ], "source": [ "df['Toebox width'] = df['Toebox width'].astype(str).str.lower()\n", "base_toebox = ['narrow', 'medium', 'wide']\n", "\n", "for level in base_toebox:\n", " column_name = f\"toebox_{level}\"\n", " df[column_name] = df['Toebox width'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "toebox_cols = [f\"toebox_{l}\" for l in base_toebox]\n", "zero_vector_count = (df[toebox_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Toebox width\"] + toebox_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 71, "id": "73514a31", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Toebox width\n", "medium 68\n", "wide 38\n", "- 32\n", "narrow 20\n", "Name: count, dtype: int64\n", "\n", "toebox_narrow sum: 20\n", "toebox_medium sum: 68\n", "toebox_wide sum: 38\n", "\n", " Toebox width toebox_narrow toebox_medium toebox_wide\n", "0 narrow 1 0 0\n", "1 - 0 0 0\n", "2 wide 0 0 1\n", "3 wide 0 0 1\n", "4 - 0 0 0\n" ] } ], "source": [ "print(df[\"Toebox width\"].value_counts())\n", "\n", "print()\n", "for level in base_toebox:\n", " col = f\"toebox_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Toebox width\"] + toebox_cols].head())" ] }, { "cell_type": "code", "execution_count": 72, "id": "54c66b79", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 52 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Stiffness 158 non-null str \n", " 4 Torsional rigidity 158 non-null str \n", " 5 Heel counter stiffness 158 non-null str \n", " 6 Lug depth 158 non-null str \n", " 7 Heel stack lab Heel stack brand 158 non-null str \n", " 8 Forefoot lab Forefoot brand 158 non-null str \n", " 9 For heavy runners 154 non-null float64\n", " 10 Season 158 non-null str \n", " 11 Removable insole 158 non-null int64 \n", " 12 Orthotic friendly 158 non-null int64 \n", " 13 Waterproofing 156 non-null str \n", " 14 terrain_light 158 non-null int64 \n", " 15 terrain_moderate 158 non-null int64 \n", " 16 terrain_technical 158 non-null int64 \n", " 17 shock_low 158 non-null int64 \n", " 18 shock_moderate 158 non-null int64 \n", " 19 shock_high 158 non-null int64 \n", " 20 energy_low 158 non-null int64 \n", " 21 energy_moderate 158 non-null int64 \n", " 22 energy_high 158 non-null int64 \n", " 23 traction_moderate 158 non-null int64 \n", " 24 traction_high 158 non-null int64 \n", " 25 arch_neutral 158 non-null int64 \n", " 26 arch_stability 158 non-null int64 \n", " 27 weight_lab_oz 158 non-null float64\n", " 28 weight_lab_g 158 non-null int64 \n", " 29 weight_brand_oz 155 non-null float64\n", " 30 weight_brand_g 155 non-null float64\n", " 31 drop_lab_mm 158 non-null float64\n", " 32 drop_brand_mm 152 non-null float64\n", " 33 strike_heel 158 non-null int64 \n", " 34 strike_mid 158 non-null int64 \n", " 35 strike_forefoot 158 non-null int64 \n", " 36 softness_soft 158 non-null int64 \n", " 37 softness_balanced 158 non-null int64 \n", " 38 softness_firm 158 non-null int64 \n", " 39 toebox_durability 158 non-null int64 \n", " 40 heel_durability 158 non-null int64 \n", " 41 outsole_durability 158 non-null int64 \n", " 42 breathability 158 non-null int64 \n", " 43 plate_0 158 non-null int64 \n", " 44 plate_rock_plate 158 non-null int64 \n", " 45 plate_carbon_plate 158 non-null int64 \n", " 46 width_narrow 158 non-null int64 \n", " 47 width_medium 158 non-null int64 \n", " 48 width_wide 158 non-null int64 \n", " 49 toebox_narrow 158 non-null int64 \n", " 50 toebox_medium 158 non-null int64 \n", " 51 toebox_wide 158 non-null int64 \n", "dtypes: float64(7), int64(35), str(10)\n", "memory usage: 64.3 KB\n" ] } ], "source": [ "df.drop(columns=[\"Toebox width\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "a723b8bd", "metadata": {}, "source": [ "# Stiffness" ] }, { "cell_type": "code", "execution_count": 73, "id": "76d488f5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Stiffness\n", "Stiff 99\n", "Moderate 53\n", "Flexible 6\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Stiffness'].value_counts())" ] }, { "cell_type": "code", "execution_count": 74, "id": "4e35f6e8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 0\n", "\n", "Sample Comparison:\n", " Stiffness stiffness_flexible stiffness_moderate stiffness_stiff\n", "0 moderate 0 1 0\n", "1 stiff 0 0 1\n", "2 moderate 0 1 0\n", "3 moderate 0 1 0\n", "4 stiff 0 0 1\n", "5 stiff 0 0 1\n", "6 stiff 0 0 1\n", "7 stiff 0 0 1\n", "8 moderate 0 1 0\n", "9 stiff 0 0 1\n" ] } ], "source": [ "df['Stiffness'] = df['Stiffness'].astype(str).str.lower()\n", "base_stiffness = ['flexible', 'moderate', 'stiff']\n", "\n", "for level in base_stiffness:\n", " column_name = f\"stiffness_{level}\"\n", " df[column_name] = df['Stiffness'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "stiffness_cols = [f\"stiffness_{l}\" for l in base_stiffness]\n", "zero_vector_count = (df[stiffness_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Stiffness\"] + stiffness_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 75, "id": "844410fe", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Stiffness\n", "stiff 99\n", "moderate 53\n", "flexible 6\n", "Name: count, dtype: int64\n", "\n", "stiffness_flexible sum: 6\n", "stiffness_moderate sum: 53\n", "stiffness_stiff sum: 99\n", "\n", " Stiffness stiffness_flexible stiffness_moderate stiffness_stiff\n", "0 moderate 0 1 0\n", "1 stiff 0 0 1\n", "2 moderate 0 1 0\n", "3 moderate 0 1 0\n", "4 stiff 0 0 1\n" ] } ], "source": [ "print(df[\"Stiffness\"].value_counts())\n", "\n", "print()\n", "for level in base_stiffness:\n", " col = f\"stiffness_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Stiffness\"] + stiffness_cols].head())" ] }, { "cell_type": "code", "execution_count": 76, "id": "429e0c4e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 54 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Torsional rigidity 158 non-null str \n", " 4 Heel counter stiffness 158 non-null str \n", " 5 Lug depth 158 non-null str \n", " 6 Heel stack lab Heel stack brand 158 non-null str \n", " 7 Forefoot lab Forefoot brand 158 non-null str \n", " 8 For heavy runners 154 non-null float64\n", " 9 Season 158 non-null str \n", " 10 Removable insole 158 non-null int64 \n", " 11 Orthotic friendly 158 non-null int64 \n", " 12 Waterproofing 156 non-null str \n", " 13 terrain_light 158 non-null int64 \n", " 14 terrain_moderate 158 non-null int64 \n", " 15 terrain_technical 158 non-null int64 \n", " 16 shock_low 158 non-null int64 \n", " 17 shock_moderate 158 non-null int64 \n", " 18 shock_high 158 non-null int64 \n", " 19 energy_low 158 non-null int64 \n", " 20 energy_moderate 158 non-null int64 \n", " 21 energy_high 158 non-null int64 \n", " 22 traction_moderate 158 non-null int64 \n", " 23 traction_high 158 non-null int64 \n", " 24 arch_neutral 158 non-null int64 \n", " 25 arch_stability 158 non-null int64 \n", " 26 weight_lab_oz 158 non-null float64\n", " 27 weight_lab_g 158 non-null int64 \n", " 28 weight_brand_oz 155 non-null float64\n", " 29 weight_brand_g 155 non-null float64\n", " 30 drop_lab_mm 158 non-null float64\n", " 31 drop_brand_mm 152 non-null float64\n", " 32 strike_heel 158 non-null int64 \n", " 33 strike_mid 158 non-null int64 \n", " 34 strike_forefoot 158 non-null int64 \n", " 35 softness_soft 158 non-null int64 \n", " 36 softness_balanced 158 non-null int64 \n", " 37 softness_firm 158 non-null int64 \n", " 38 toebox_durability 158 non-null int64 \n", " 39 heel_durability 158 non-null int64 \n", " 40 outsole_durability 158 non-null int64 \n", " 41 breathability 158 non-null int64 \n", " 42 plate_0 158 non-null int64 \n", " 43 plate_rock_plate 158 non-null int64 \n", " 44 plate_carbon_plate 158 non-null int64 \n", " 45 width_narrow 158 non-null int64 \n", " 46 width_medium 158 non-null int64 \n", " 47 width_wide 158 non-null int64 \n", " 48 toebox_narrow 158 non-null int64 \n", " 49 toebox_medium 158 non-null int64 \n", " 50 toebox_wide 158 non-null int64 \n", " 51 stiffness_flexible 158 non-null int64 \n", " 52 stiffness_moderate 158 non-null int64 \n", " 53 stiffness_stiff 158 non-null int64 \n", "dtypes: float64(7), int64(38), str(9)\n", "memory usage: 66.8 KB\n" ] } ], "source": [ "df.drop(columns=[\"Stiffness\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "347d1f39", "metadata": {}, "source": [ "# Torsional rigidity" ] }, { "cell_type": "code", "execution_count": 77, "id": "898bbd3d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Torsional rigidity\n", "Stiff 93\n", "Moderate 37\n", "Flexible 22\n", "- 6\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Torsional rigidity'].value_counts())" ] }, { "cell_type": "code", "execution_count": 78, "id": "94fbcfb9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 6\n", "\n", "Sample Comparison:\n", " Torsional rigidity torsional_flexible torsional_moderate torsional_stiff\n", "0 stiff 0 0 1\n", "1 flexible 1 0 0\n", "2 stiff 0 0 1\n", "3 moderate 0 1 0\n", "4 flexible 1 0 0\n", "5 - 0 0 0\n", "6 flexible 1 0 0\n", "7 flexible 1 0 0\n", "8 moderate 0 1 0\n", "9 - 0 0 0\n" ] } ], "source": [ "df['Torsional rigidity'] = df['Torsional rigidity'].astype(str).str.lower()\n", "base_torsional = ['flexible', 'moderate', 'stiff']\n", "\n", "for level in base_torsional:\n", " column_name = f\"torsional_{level}\"\n", " df[column_name] = df['Torsional rigidity'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "torsional_cols = [f\"torsional_{l}\" for l in base_torsional]\n", "zero_vector_count = (df[torsional_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Torsional rigidity\"] + torsional_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 79, "id": "bdfc1ffd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Torsional rigidity\n", "stiff 93\n", "moderate 37\n", "flexible 22\n", "- 6\n", "Name: count, dtype: int64\n", "\n", "torsional_flexible sum: 22\n", "torsional_moderate sum: 37\n", "torsional_stiff sum: 93\n", "\n", " Torsional rigidity torsional_flexible torsional_moderate torsional_stiff\n", "0 stiff 0 0 1\n", "1 flexible 1 0 0\n", "2 stiff 0 0 1\n", "3 moderate 0 1 0\n", "4 flexible 1 0 0\n" ] } ], "source": [ "print(df[\"Torsional rigidity\"].value_counts())\n", "\n", "print()\n", "for level in base_torsional:\n", " col = f\"torsional_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Torsional rigidity\"] + torsional_cols].head())" ] }, { "cell_type": "code", "execution_count": 80, "id": "5087be70", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 56 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Heel counter stiffness 158 non-null str \n", " 4 Lug depth 158 non-null str \n", " 5 Heel stack lab Heel stack brand 158 non-null str \n", " 6 Forefoot lab Forefoot brand 158 non-null str \n", " 7 For heavy runners 154 non-null float64\n", " 8 Season 158 non-null str \n", " 9 Removable insole 158 non-null int64 \n", " 10 Orthotic friendly 158 non-null int64 \n", " 11 Waterproofing 156 non-null str \n", " 12 terrain_light 158 non-null int64 \n", " 13 terrain_moderate 158 non-null int64 \n", " 14 terrain_technical 158 non-null int64 \n", " 15 shock_low 158 non-null int64 \n", " 16 shock_moderate 158 non-null int64 \n", " 17 shock_high 158 non-null int64 \n", " 18 energy_low 158 non-null int64 \n", " 19 energy_moderate 158 non-null int64 \n", " 20 energy_high 158 non-null int64 \n", " 21 traction_moderate 158 non-null int64 \n", " 22 traction_high 158 non-null int64 \n", " 23 arch_neutral 158 non-null int64 \n", " 24 arch_stability 158 non-null int64 \n", " 25 weight_lab_oz 158 non-null float64\n", " 26 weight_lab_g 158 non-null int64 \n", " 27 weight_brand_oz 155 non-null float64\n", " 28 weight_brand_g 155 non-null float64\n", " 29 drop_lab_mm 158 non-null float64\n", " 30 drop_brand_mm 152 non-null float64\n", " 31 strike_heel 158 non-null int64 \n", " 32 strike_mid 158 non-null int64 \n", " 33 strike_forefoot 158 non-null int64 \n", " 34 softness_soft 158 non-null int64 \n", " 35 softness_balanced 158 non-null int64 \n", " 36 softness_firm 158 non-null int64 \n", " 37 toebox_durability 158 non-null int64 \n", " 38 heel_durability 158 non-null int64 \n", " 39 outsole_durability 158 non-null int64 \n", " 40 breathability 158 non-null int64 \n", " 41 plate_0 158 non-null int64 \n", " 42 plate_rock_plate 158 non-null int64 \n", " 43 plate_carbon_plate 158 non-null int64 \n", " 44 width_narrow 158 non-null int64 \n", " 45 width_medium 158 non-null int64 \n", " 46 width_wide 158 non-null int64 \n", " 47 toebox_narrow 158 non-null int64 \n", " 48 toebox_medium 158 non-null int64 \n", " 49 toebox_wide 158 non-null int64 \n", " 50 stiffness_flexible 158 non-null int64 \n", " 51 stiffness_moderate 158 non-null int64 \n", " 52 stiffness_stiff 158 non-null int64 \n", " 53 torsional_flexible 158 non-null int64 \n", " 54 torsional_moderate 158 non-null int64 \n", " 55 torsional_stiff 158 non-null int64 \n", "dtypes: float64(7), int64(41), str(8)\n", "memory usage: 69.3 KB\n" ] } ], "source": [ "df.drop(columns=[\"Torsional rigidity\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "4fab1922", "metadata": {}, "source": [ "# Heel counter stiffness" ] }, { "cell_type": "code", "execution_count": 81, "id": "d17ba028", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Heel counter stiffness\n", "Moderate 55\n", "Stiff 49\n", "Flexible 46\n", "- 8\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Heel counter stiffness'].value_counts())" ] }, { "cell_type": "code", "execution_count": 82, "id": "1ffb3c8c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL Value: 8\n", "\n", "Sample Comparison:\n", " Heel counter stiffness heel_stiff_flexible heel_stiff_moderate \\\n", "0 flexible 1 0 \n", "1 flexible 1 0 \n", "2 moderate 0 1 \n", "3 flexible 1 0 \n", "4 - 0 0 \n", "5 - 0 0 \n", "6 flexible 1 0 \n", "7 flexible 1 0 \n", "8 flexible 1 0 \n", "9 - 0 0 \n", "\n", " heel_stiff_stiff \n", "0 0 \n", "1 0 \n", "2 0 \n", "3 0 \n", "4 0 \n", "5 0 \n", "6 0 \n", "7 0 \n", "8 0 \n", "9 0 \n" ] } ], "source": [ "df['Heel counter stiffness'] = df['Heel counter stiffness'].astype(str).str.lower()\n", "base_heel_stiff = ['flexible', 'moderate', 'stiff']\n", "\n", "for level in base_heel_stiff:\n", " column_name = f\"heel_stiff_{level}\"\n", " df[column_name] = df['Heel counter stiffness'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "heel_stiff_cols = [f\"heel_stiff_{l}\" for l in base_heel_stiff]\n", "zero_vector_count = (df[heel_stiff_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL Value: {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Heel counter stiffness\"] + heel_stiff_cols].head(10))" ] }, { "cell_type": "code", "execution_count": 83, "id": "e9a07e6f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Heel counter stiffness\n", "moderate 55\n", "stiff 49\n", "flexible 46\n", "- 8\n", "Name: count, dtype: int64\n", "\n", "heel_stiff_flexible sum: 46\n", "heel_stiff_moderate sum: 55\n", "heel_stiff_stiff sum: 49\n", "\n", " Heel counter stiffness heel_stiff_flexible heel_stiff_moderate \\\n", "0 flexible 1 0 \n", "1 flexible 1 0 \n", "2 moderate 0 1 \n", "3 flexible 1 0 \n", "4 - 0 0 \n", "\n", " heel_stiff_stiff \n", "0 0 \n", "1 0 \n", "2 0 \n", "3 0 \n", "4 0 \n" ] } ], "source": [ "print(df[\"Heel counter stiffness\"].value_counts())\n", "\n", "print()\n", "for level in base_heel_stiff:\n", " col = f\"heel_stiff_{level}\"\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Heel counter stiffness\"] + heel_stiff_cols].head())" ] }, { "cell_type": "code", "execution_count": 84, "id": "65d93f9a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 58 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Lug depth 158 non-null str \n", " 4 Heel stack lab Heel stack brand 158 non-null str \n", " 5 Forefoot lab Forefoot brand 158 non-null str \n", " 6 For heavy runners 154 non-null float64\n", " 7 Season 158 non-null str \n", " 8 Removable insole 158 non-null int64 \n", " 9 Orthotic friendly 158 non-null int64 \n", " 10 Waterproofing 156 non-null str \n", " 11 terrain_light 158 non-null int64 \n", " 12 terrain_moderate 158 non-null int64 \n", " 13 terrain_technical 158 non-null int64 \n", " 14 shock_low 158 non-null int64 \n", " 15 shock_moderate 158 non-null int64 \n", " 16 shock_high 158 non-null int64 \n", " 17 energy_low 158 non-null int64 \n", " 18 energy_moderate 158 non-null int64 \n", " 19 energy_high 158 non-null int64 \n", " 20 traction_moderate 158 non-null int64 \n", " 21 traction_high 158 non-null int64 \n", " 22 arch_neutral 158 non-null int64 \n", " 23 arch_stability 158 non-null int64 \n", " 24 weight_lab_oz 158 non-null float64\n", " 25 weight_lab_g 158 non-null int64 \n", " 26 weight_brand_oz 155 non-null float64\n", " 27 weight_brand_g 155 non-null float64\n", " 28 drop_lab_mm 158 non-null float64\n", " 29 drop_brand_mm 152 non-null float64\n", " 30 strike_heel 158 non-null int64 \n", " 31 strike_mid 158 non-null int64 \n", " 32 strike_forefoot 158 non-null int64 \n", " 33 softness_soft 158 non-null int64 \n", " 34 softness_balanced 158 non-null int64 \n", " 35 softness_firm 158 non-null int64 \n", " 36 toebox_durability 158 non-null int64 \n", " 37 heel_durability 158 non-null int64 \n", " 38 outsole_durability 158 non-null int64 \n", " 39 breathability 158 non-null int64 \n", " 40 plate_0 158 non-null int64 \n", " 41 plate_rock_plate 158 non-null int64 \n", " 42 plate_carbon_plate 158 non-null int64 \n", " 43 width_narrow 158 non-null int64 \n", " 44 width_medium 158 non-null int64 \n", " 45 width_wide 158 non-null int64 \n", " 46 toebox_narrow 158 non-null int64 \n", " 47 toebox_medium 158 non-null int64 \n", " 48 toebox_wide 158 non-null int64 \n", " 49 stiffness_flexible 158 non-null int64 \n", " 50 stiffness_moderate 158 non-null int64 \n", " 51 stiffness_stiff 158 non-null int64 \n", " 52 torsional_flexible 158 non-null int64 \n", " 53 torsional_moderate 158 non-null int64 \n", " 54 torsional_stiff 158 non-null int64 \n", " 55 heel_stiff_flexible 158 non-null int64 \n", " 56 heel_stiff_moderate 158 non-null int64 \n", " 57 heel_stiff_stiff 158 non-null int64 \n", "dtypes: float64(7), int64(44), str(7)\n", "memory usage: 71.7 KB\n" ] } ], "source": [ "df.drop(columns=[\"Heel counter stiffness\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "62efa68c", "metadata": {}, "source": [ "# Lug depth" ] }, { "cell_type": "code", "execution_count": 85, "id": "3c47127b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 2.5 mm\n", "1 2.6 mm\n", "2 3.6 mm\n", "3 3.5 mm\n", "4 3.7 mm\n", "Name: Lug depth, dtype: str\n" ] } ], "source": [ "print(df[\"Lug depth\"].head())" ] }, { "cell_type": "code", "execution_count": 86, "id": "31d7c1e3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--- Value Counts Kolom Asli ---\n", "Lug depth\n", "3.5 mm 15\n", "3.0 mm 14\n", "4.0 mm 12\n", "3.4 mm 11\n", "2.5 mm 7\n", "2.9 mm 7\n", "3.2 mm 7\n", "3.6 mm 6\n", "3.7 mm 6\n", "4.4 mm 6\n", "Name: count, dtype: int64\n", "\n", " Lug depth lug_depth\n", "0 2.5 mm 2.5\n", "1 2.6 mm 2.6\n", "2 3.6 mm 3.6\n", "3 3.5 mm 3.5\n", "4 3.7 mm 3.7\n" ] } ], "source": [ "df['lug_depth'] = df['Lug depth'].astype(str).str.replace(' mm', '', regex=False)\n", "df['lug_depth'] = pd.to_numeric(df['lug_depth'].replace('-', '0'), errors='coerce').fillna(0)\n", "\n", "print(\"--- Value Counts Kolom Asli ---\")\n", "print(df[\"Lug depth\"].value_counts().head(10))\n", "\n", "print()\n", "print(df[[\"Lug depth\", \"lug_depth\"]].head())" ] }, { "cell_type": "code", "execution_count": 87, "id": "e7b1ee60", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 58 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Heel stack lab Heel stack brand 158 non-null str \n", " 4 Forefoot lab Forefoot brand 158 non-null str \n", " 5 For heavy runners 154 non-null float64\n", " 6 Season 158 non-null str \n", " 7 Removable insole 158 non-null int64 \n", " 8 Orthotic friendly 158 non-null int64 \n", " 9 Waterproofing 156 non-null str \n", " 10 terrain_light 158 non-null int64 \n", " 11 terrain_moderate 158 non-null int64 \n", " 12 terrain_technical 158 non-null int64 \n", " 13 shock_low 158 non-null int64 \n", " 14 shock_moderate 158 non-null int64 \n", " 15 shock_high 158 non-null int64 \n", " 16 energy_low 158 non-null int64 \n", " 17 energy_moderate 158 non-null int64 \n", " 18 energy_high 158 non-null int64 \n", " 19 traction_moderate 158 non-null int64 \n", " 20 traction_high 158 non-null int64 \n", " 21 arch_neutral 158 non-null int64 \n", " 22 arch_stability 158 non-null int64 \n", " 23 weight_lab_oz 158 non-null float64\n", " 24 weight_lab_g 158 non-null int64 \n", " 25 weight_brand_oz 155 non-null float64\n", " 26 weight_brand_g 155 non-null float64\n", " 27 drop_lab_mm 158 non-null float64\n", " 28 drop_brand_mm 152 non-null float64\n", " 29 strike_heel 158 non-null int64 \n", " 30 strike_mid 158 non-null int64 \n", " 31 strike_forefoot 158 non-null int64 \n", " 32 softness_soft 158 non-null int64 \n", " 33 softness_balanced 158 non-null int64 \n", " 34 softness_firm 158 non-null int64 \n", " 35 toebox_durability 158 non-null int64 \n", " 36 heel_durability 158 non-null int64 \n", " 37 outsole_durability 158 non-null int64 \n", " 38 breathability 158 non-null int64 \n", " 39 plate_0 158 non-null int64 \n", " 40 plate_rock_plate 158 non-null int64 \n", " 41 plate_carbon_plate 158 non-null int64 \n", " 42 width_narrow 158 non-null int64 \n", " 43 width_medium 158 non-null int64 \n", " 44 width_wide 158 non-null int64 \n", " 45 toebox_narrow 158 non-null int64 \n", " 46 toebox_medium 158 non-null int64 \n", " 47 toebox_wide 158 non-null int64 \n", " 48 stiffness_flexible 158 non-null int64 \n", " 49 stiffness_moderate 158 non-null int64 \n", " 50 stiffness_stiff 158 non-null int64 \n", " 51 torsional_flexible 158 non-null int64 \n", " 52 torsional_moderate 158 non-null int64 \n", " 53 torsional_stiff 158 non-null int64 \n", " 54 heel_stiff_flexible 158 non-null int64 \n", " 55 heel_stiff_moderate 158 non-null int64 \n", " 56 heel_stiff_stiff 158 non-null int64 \n", " 57 lug_depth 158 non-null float64\n", "dtypes: float64(8), int64(44), str(6)\n", "memory usage: 71.7 KB\n" ] } ], "source": [ "df.drop(columns=[\"Lug depth\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "edb40b00", "metadata": {}, "source": [ "# Heel stack lab Heel stack brand" ] }, { "cell_type": "code", "execution_count": 88, "id": "6f8956df", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 30.6 mm 38.0 mm\n", "1 32.8 mm 26.0 mm\n", "2 34.5 mm 34.0 mm\n", "3 32.3 mm 32.0 mm\n", "4 24.5 mm 25.0 mm\n", "Name: Heel stack lab Heel stack brand, dtype: str\n" ] } ], "source": [ "print(df[\"Heel stack lab Heel stack brand\"].head())" ] }, { "cell_type": "code", "execution_count": 89, "id": "9123ea7c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "np.int64(0)" ] }, "execution_count": 89, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mask_missing = (\n", " df[\"Heel stack lab Heel stack brand\"].isna() |\n", " (df[\"Heel stack lab Heel stack brand\"].astype(str).str.strip() == \"-\")\n", ")\n", "mask_missing.sum()" ] }, { "cell_type": "code", "execution_count": 90, "id": "dc55349b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Heel stack lab Heel stack brand heel_lab_mm heel_brand_mm\n", "0 30.6 mm 38.0 mm 30.6 38.0\n", "1 32.8 mm 26.0 mm 32.8 26.0\n", "2 34.5 mm 34.0 mm 34.5 34.0\n", "3 32.3 mm 32.0 mm 32.3 32.0\n", "4 24.5 mm 25.0 mm 24.5 25.0\n" ] } ], "source": [ "Heel = df[\"Heel stack lab Heel stack brand\"].str.findall(r\"[\\d.]+\")\n", "\n", "df[[\"heel_lab_mm\", \"heel_brand_mm\"]] = (\n", " pd.DataFrame(Heel.tolist(), index=df.index)\n", ")\n", "\n", "for col in [\"heel_lab_mm\", \"heel_brand_mm\"]:\n", " df[col] = pd.to_numeric(df[col], errors=\"coerce\")\n", "\n", "print(df[[\"Heel stack lab Heel stack brand\", \"heel_lab_mm\", \"heel_brand_mm\"]].head())" ] }, { "cell_type": "code", "execution_count": 91, "id": "2f899e58", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 59 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Forefoot lab Forefoot brand 158 non-null str \n", " 4 For heavy runners 154 non-null float64\n", " 5 Season 158 non-null str \n", " 6 Removable insole 158 non-null int64 \n", " 7 Orthotic friendly 158 non-null int64 \n", " 8 Waterproofing 156 non-null str \n", " 9 terrain_light 158 non-null int64 \n", " 10 terrain_moderate 158 non-null int64 \n", " 11 terrain_technical 158 non-null int64 \n", " 12 shock_low 158 non-null int64 \n", " 13 shock_moderate 158 non-null int64 \n", " 14 shock_high 158 non-null int64 \n", " 15 energy_low 158 non-null int64 \n", " 16 energy_moderate 158 non-null int64 \n", " 17 energy_high 158 non-null int64 \n", " 18 traction_moderate 158 non-null int64 \n", " 19 traction_high 158 non-null int64 \n", " 20 arch_neutral 158 non-null int64 \n", " 21 arch_stability 158 non-null int64 \n", " 22 weight_lab_oz 158 non-null float64\n", " 23 weight_lab_g 158 non-null int64 \n", " 24 weight_brand_oz 155 non-null float64\n", " 25 weight_brand_g 155 non-null float64\n", " 26 drop_lab_mm 158 non-null float64\n", " 27 drop_brand_mm 152 non-null float64\n", " 28 strike_heel 158 non-null int64 \n", " 29 strike_mid 158 non-null int64 \n", " 30 strike_forefoot 158 non-null int64 \n", " 31 softness_soft 158 non-null int64 \n", " 32 softness_balanced 158 non-null int64 \n", " 33 softness_firm 158 non-null int64 \n", " 34 toebox_durability 158 non-null int64 \n", " 35 heel_durability 158 non-null int64 \n", " 36 outsole_durability 158 non-null int64 \n", " 37 breathability 158 non-null int64 \n", " 38 plate_0 158 non-null int64 \n", " 39 plate_rock_plate 158 non-null int64 \n", " 40 plate_carbon_plate 158 non-null int64 \n", " 41 width_narrow 158 non-null int64 \n", " 42 width_medium 158 non-null int64 \n", " 43 width_wide 158 non-null int64 \n", " 44 toebox_narrow 158 non-null int64 \n", " 45 toebox_medium 158 non-null int64 \n", " 46 toebox_wide 158 non-null int64 \n", " 47 stiffness_flexible 158 non-null int64 \n", " 48 stiffness_moderate 158 non-null int64 \n", " 49 stiffness_stiff 158 non-null int64 \n", " 50 torsional_flexible 158 non-null int64 \n", " 51 torsional_moderate 158 non-null int64 \n", " 52 torsional_stiff 158 non-null int64 \n", " 53 heel_stiff_flexible 158 non-null int64 \n", " 54 heel_stiff_moderate 158 non-null int64 \n", " 55 heel_stiff_stiff 158 non-null int64 \n", " 56 lug_depth 158 non-null float64\n", " 57 heel_lab_mm 158 non-null float64\n", " 58 heel_brand_mm 145 non-null float64\n", "dtypes: float64(10), int64(44), str(5)\n", "memory usage: 73.0 KB\n" ] } ], "source": [ "df.drop(columns=[\"Heel stack lab Heel stack brand\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "69155f32", "metadata": {}, "source": [ "# Forefoot lab Forefoot brand" ] }, { "cell_type": "code", "execution_count": 92, "id": "586618dc", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0 30.3 mm 30.0 mm\n", "1 24.6 mm 18.0 mm\n", "2 30.2 mm 30.0 mm\n", "3 26.2 mm 28.0 mm\n", "4 24.3 mm 25.0 mm\n", "Name: Forefoot lab Forefoot brand, dtype: str\n" ] } ], "source": [ "print(df['Forefoot lab Forefoot brand'].head())" ] }, { "cell_type": "code", "execution_count": 93, "id": "b1323541", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "np.int64(0)" ] }, "execution_count": 93, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mask_missing = (\n", " df[\"Forefoot lab Forefoot brand\"].isna() |\n", " (df[\"Forefoot lab Forefoot brand\"].astype(str).str.strip() == \"-\")\n", ")\n", "mask_missing.sum()" ] }, { "cell_type": "code", "execution_count": 94, "id": "a29bbb63", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Forefoot lab Forefoot brand forefoot_lab_mm forefoot_brand_mm\n", "0 30.3 mm 30.0 mm 30.3 30.0\n", "1 24.6 mm 18.0 mm 24.6 18.0\n", "2 30.2 mm 30.0 mm 30.2 30.0\n", "3 26.2 mm 28.0 mm 26.2 28.0\n", "4 24.3 mm 25.0 mm 24.3 25.0\n" ] } ], "source": [ "forefoot = df[\"Forefoot lab Forefoot brand\"].str.findall(r\"[\\d.]+\")\n", "\n", "df[[\"forefoot_lab_mm\", \"forefoot_brand_mm\"]] = (\n", " pd.DataFrame(forefoot.tolist(), index=df.index)\n", ")\n", "\n", "for col in [\"forefoot_lab_mm\", \"forefoot_brand_mm\"]:\n", " df[col] = pd.to_numeric(df[col], errors=\"coerce\")\n", "\n", "print(df[[\"Forefoot lab Forefoot brand\", \"forefoot_lab_mm\", \"forefoot_brand_mm\"]].head())" ] }, { "cell_type": "code", "execution_count": 95, "id": "081b4449", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 60 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 For heavy runners 154 non-null float64\n", " 4 Season 158 non-null str \n", " 5 Removable insole 158 non-null int64 \n", " 6 Orthotic friendly 158 non-null int64 \n", " 7 Waterproofing 156 non-null str \n", " 8 terrain_light 158 non-null int64 \n", " 9 terrain_moderate 158 non-null int64 \n", " 10 terrain_technical 158 non-null int64 \n", " 11 shock_low 158 non-null int64 \n", " 12 shock_moderate 158 non-null int64 \n", " 13 shock_high 158 non-null int64 \n", " 14 energy_low 158 non-null int64 \n", " 15 energy_moderate 158 non-null int64 \n", " 16 energy_high 158 non-null int64 \n", " 17 traction_moderate 158 non-null int64 \n", " 18 traction_high 158 non-null int64 \n", " 19 arch_neutral 158 non-null int64 \n", " 20 arch_stability 158 non-null int64 \n", " 21 weight_lab_oz 158 non-null float64\n", " 22 weight_lab_g 158 non-null int64 \n", " 23 weight_brand_oz 155 non-null float64\n", " 24 weight_brand_g 155 non-null float64\n", " 25 drop_lab_mm 158 non-null float64\n", " 26 drop_brand_mm 152 non-null float64\n", " 27 strike_heel 158 non-null int64 \n", " 28 strike_mid 158 non-null int64 \n", " 29 strike_forefoot 158 non-null int64 \n", " 30 softness_soft 158 non-null int64 \n", " 31 softness_balanced 158 non-null int64 \n", " 32 softness_firm 158 non-null int64 \n", " 33 toebox_durability 158 non-null int64 \n", " 34 heel_durability 158 non-null int64 \n", " 35 outsole_durability 158 non-null int64 \n", " 36 breathability 158 non-null int64 \n", " 37 plate_0 158 non-null int64 \n", " 38 plate_rock_plate 158 non-null int64 \n", " 39 plate_carbon_plate 158 non-null int64 \n", " 40 width_narrow 158 non-null int64 \n", " 41 width_medium 158 non-null int64 \n", " 42 width_wide 158 non-null int64 \n", " 43 toebox_narrow 158 non-null int64 \n", " 44 toebox_medium 158 non-null int64 \n", " 45 toebox_wide 158 non-null int64 \n", " 46 stiffness_flexible 158 non-null int64 \n", " 47 stiffness_moderate 158 non-null int64 \n", " 48 stiffness_stiff 158 non-null int64 \n", " 49 torsional_flexible 158 non-null int64 \n", " 50 torsional_moderate 158 non-null int64 \n", " 51 torsional_stiff 158 non-null int64 \n", " 52 heel_stiff_flexible 158 non-null int64 \n", " 53 heel_stiff_moderate 158 non-null int64 \n", " 54 heel_stiff_stiff 158 non-null int64 \n", " 55 lug_depth 158 non-null float64\n", " 56 heel_lab_mm 158 non-null float64\n", " 57 heel_brand_mm 145 non-null float64\n", " 58 forefoot_lab_mm 158 non-null float64\n", " 59 forefoot_brand_mm 143 non-null float64\n", "dtypes: float64(12), int64(44), str(4)\n", "memory usage: 74.2 KB\n" ] } ], "source": [ "df.drop(columns=[\"Forefoot lab Forefoot brand\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "21494e05", "metadata": {}, "source": [ "# Season" ] }, { "cell_type": "code", "execution_count": 96, "id": "c3e07080", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Season\n", "All seasons 107\n", "- 19\n", "Summer All seasons 15\n", "Winter 15\n", "0 1\n", "SummerAll seasons 1\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Season\"].value_counts())" ] }, { "cell_type": "markdown", "id": "93dfd937", "metadata": {}, "source": [ "Summer All seasons = sepatu yang dirancang secara spesifik untuk summer tapi diklaim bisa dipakai all season" ] }, { "cell_type": "code", "execution_count": 97, "id": "fa7f5747", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Jumlah baris dengan '-' atau '0': 20\n", "\n", "--- Detail Baris (Season = '-' atau '0') ---\n", " Brand Name Season\n", "1 adidas terrex speed ultra -\n", "4 altra lone peak 5.0 -\n", "5 altra lone peak 6 -\n", "9 altra mont blanc -\n", "36 brooks cascadia 16 -\n", "57 hoka tecton x -\n", "61 hoka zinal -\n", "67 inov8 trailtalon 0\n", "68 kailas flythorn air 2.0 -\n", "70 kailas fuga elite 2 -\n", "71 kailas fuga ex 2 -\n", "73 kailas fuga ex boa -\n", "75 kailas fuga pro 4 -\n", "89 merrell nova 2 -\n", "101 nike air zoom terra kiger 6 -\n", "104 nike pegasus trail 4 -\n", "124 salomon sense pro 4 -\n", "140 saucony endorphin trail -\n", "141 saucony peregrine 11 -\n", "142 saucony peregrine 12 -\n", "\n", "Frekuensi spesifik:\n", "Season\n", "- 19\n", "0 1\n", "Name: count, dtype: int64\n" ] } ], "source": [ "# Check weird values\n", "filter_condition = df['Season'].astype(str).isin(['-', '0'])\n", "rows_to_check = df[filter_condition]\n", "\n", "print(f\"Jumlah baris dengan '-' atau '0': {len(rows_to_check)}\")\n", "print(\"\\n--- Detail Baris (Season = '-' atau '0') ---\")\n", "print(rows_to_check[['Brand', 'Name', 'Season']])\n", "\n", "\n", "print(\"\\nFrekuensi spesifik:\")\n", "print(df[df['Season'].astype(str).isin(['-', '0'])]['Season'].value_counts())" ] }, { "cell_type": "code", "execution_count": 98, "id": "40f37790", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "NULL/Unknown Value (0 dan -): 20\n", "\n", "Sample Comparison (Multi-label):\n", " Season season_summer season_winter season_all\n", "13 summer all seasons 1 0 1\n", "17 summer all seasons 1 0 1\n", "26 summer all seasons 1 0 1\n", "28 summer all seasons 1 0 1\n", "29 summer all seasons 1 0 1\n" ] } ], "source": [ "df['Season'] = df['Season'].astype(str).str.lower()\n", "base_seasons = ['summer', 'winter', 'all seasons']\n", "\n", "for level in base_seasons:\n", " clean_name = level.replace(' seasons', '').replace(' ', '_')\n", " column_name = f\"season_{clean_name}\"\n", " df[column_name] = df['Season'].str.contains(level, na=False).astype(int)\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "season_cols = [col for col in df.columns if col.startswith('season_')]\n", "zero_vector_count = (df[season_cols].sum(axis=1) == 0).sum()\n", "print(f\"NULL/Unknown Value (0 dan -): {zero_vector_count}\")\n", "\n", "print(\"\\nSample Comparison (Multi-label):\")\n", "print(df[df[season_cols].sum(axis=1) > 1][['Season'] + season_cols].head())" ] }, { "cell_type": "code", "execution_count": 99, "id": "39a01a66", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Season\n", "all seasons 107\n", "- 19\n", "summer all seasons 15\n", "winter 15\n", "0 1\n", "summerall seasons 1\n", "Name: count, dtype: int64\n", "\n", "season_summer sum: 16\n", "season_winter sum: 15\n", "season_all sum: 123\n", "\n", " Season season_summer season_winter season_all\n", "0 all seasons 0 0 1\n", "1 - 0 0 0\n", "2 all seasons 0 0 1\n", "3 all seasons 0 0 1\n", "4 - 0 0 0\n" ] } ], "source": [ "print(df[\"Season\"].value_counts())\n", "\n", "print()\n", "for col in season_cols:\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "print()\n", "print(df[[\"Season\"] + season_cols].head())" ] }, { "cell_type": "code", "execution_count": 100, "id": "d8eea361", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 62 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 For heavy runners 154 non-null float64\n", " 4 Removable insole 158 non-null int64 \n", " 5 Orthotic friendly 158 non-null int64 \n", " 6 Waterproofing 156 non-null str \n", " 7 terrain_light 158 non-null int64 \n", " 8 terrain_moderate 158 non-null int64 \n", " 9 terrain_technical 158 non-null int64 \n", " 10 shock_low 158 non-null int64 \n", " 11 shock_moderate 158 non-null int64 \n", " 12 shock_high 158 non-null int64 \n", " 13 energy_low 158 non-null int64 \n", " 14 energy_moderate 158 non-null int64 \n", " 15 energy_high 158 non-null int64 \n", " 16 traction_moderate 158 non-null int64 \n", " 17 traction_high 158 non-null int64 \n", " 18 arch_neutral 158 non-null int64 \n", " 19 arch_stability 158 non-null int64 \n", " 20 weight_lab_oz 158 non-null float64\n", " 21 weight_lab_g 158 non-null int64 \n", " 22 weight_brand_oz 155 non-null float64\n", " 23 weight_brand_g 155 non-null float64\n", " 24 drop_lab_mm 158 non-null float64\n", " 25 drop_brand_mm 152 non-null float64\n", " 26 strike_heel 158 non-null int64 \n", " 27 strike_mid 158 non-null int64 \n", " 28 strike_forefoot 158 non-null int64 \n", " 29 softness_soft 158 non-null int64 \n", " 30 softness_balanced 158 non-null int64 \n", " 31 softness_firm 158 non-null int64 \n", " 32 toebox_durability 158 non-null int64 \n", " 33 heel_durability 158 non-null int64 \n", " 34 outsole_durability 158 non-null int64 \n", " 35 breathability 158 non-null int64 \n", " 36 plate_0 158 non-null int64 \n", " 37 plate_rock_plate 158 non-null int64 \n", " 38 plate_carbon_plate 158 non-null int64 \n", " 39 width_narrow 158 non-null int64 \n", " 40 width_medium 158 non-null int64 \n", " 41 width_wide 158 non-null int64 \n", " 42 toebox_narrow 158 non-null int64 \n", " 43 toebox_medium 158 non-null int64 \n", " 44 toebox_wide 158 non-null int64 \n", " 45 stiffness_flexible 158 non-null int64 \n", " 46 stiffness_moderate 158 non-null int64 \n", " 47 stiffness_stiff 158 non-null int64 \n", " 48 torsional_flexible 158 non-null int64 \n", " 49 torsional_moderate 158 non-null int64 \n", " 50 torsional_stiff 158 non-null int64 \n", " 51 heel_stiff_flexible 158 non-null int64 \n", " 52 heel_stiff_moderate 158 non-null int64 \n", " 53 heel_stiff_stiff 158 non-null int64 \n", " 54 lug_depth 158 non-null float64\n", " 55 heel_lab_mm 158 non-null float64\n", " 56 heel_brand_mm 145 non-null float64\n", " 57 forefoot_lab_mm 158 non-null float64\n", " 58 forefoot_brand_mm 143 non-null float64\n", " 59 season_summer 158 non-null int64 \n", " 60 season_winter 158 non-null int64 \n", " 61 season_all 158 non-null int64 \n", "dtypes: float64(12), int64(47), str(3)\n", "memory usage: 76.7 KB\n" ] } ], "source": [ "df.drop(columns=[\"Season\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 101, "id": "acdd890f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Brand Name For heavy runners Removable insole \\\n", "0 adidas terrex agravic speed ultra 0.0 1 \n", "1 adidas terrex speed ultra 0.0 1 \n", "2 altra experience wild 0.0 1 \n", "3 altra experience wild 2 0.0 1 \n", "4 altra lone peak 5.0 0.0 1 \n", "\n", " Orthotic friendly \n", "0 1 \n", "1 1 \n", "2 1 \n", "3 1 \n", "4 1 \n" ] } ], "source": [ "print(df[[\"Brand\", \"Name\", \"For heavy runners\", \"Removable insole\", \"Orthotic friendly\"]].head())" ] }, { "cell_type": "markdown", "id": "2d9886d0", "metadata": {}, "source": [ "# For heavy runners" ] }, { "cell_type": "code", "execution_count": 102, "id": "170c08ea", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "For heavy runners\n", "0.0 147\n", "1.0 7\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"For heavy runners\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 103, "id": "9dc14af9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--- Value Counts Kolom Asli ---\n", "For heavy runners\n", "0.0 147\n", "1.0 7\n", "Name: count, dtype: int64\n", "\n", "--- Sebaran Nilai Hasil ---\n", "heavy_runners\n", "0 151\n", "1 7\n", "Name: count, dtype: int64\n", "\n", "--- Perbandingan Data ---\n", " For heavy runners heavy_runners\n", "0 0.0 0\n", "1 0.0 0\n", "2 0.0 0\n", "3 0.0 0\n", "4 0.0 0\n" ] } ], "source": [ "df['heavy_runners'] = df['For heavy runners'].fillna(0).astype(int)\n", "\n", "print(\"--- Value Counts Kolom Asli ---\")\n", "print(df[\"For heavy runners\"].value_counts())\n", "\n", "print(\"\\n--- Sebaran Nilai Hasil ---\")\n", "print(df[\"heavy_runners\"].value_counts())\n", "\n", "print(\"\\n--- Perbandingan Data ---\")\n", "print(df[[\"For heavy runners\", \"heavy_runners\"]].head())" ] }, { "cell_type": "code", "execution_count": 104, "id": "effc6bb4", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 62 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Removable insole 158 non-null int64 \n", " 4 Orthotic friendly 158 non-null int64 \n", " 5 Waterproofing 156 non-null str \n", " 6 terrain_light 158 non-null int64 \n", " 7 terrain_moderate 158 non-null int64 \n", " 8 terrain_technical 158 non-null int64 \n", " 9 shock_low 158 non-null int64 \n", " 10 shock_moderate 158 non-null int64 \n", " 11 shock_high 158 non-null int64 \n", " 12 energy_low 158 non-null int64 \n", " 13 energy_moderate 158 non-null int64 \n", " 14 energy_high 158 non-null int64 \n", " 15 traction_moderate 158 non-null int64 \n", " 16 traction_high 158 non-null int64 \n", " 17 arch_neutral 158 non-null int64 \n", " 18 arch_stability 158 non-null int64 \n", " 19 weight_lab_oz 158 non-null float64\n", " 20 weight_lab_g 158 non-null int64 \n", " 21 weight_brand_oz 155 non-null float64\n", " 22 weight_brand_g 155 non-null float64\n", " 23 drop_lab_mm 158 non-null float64\n", " 24 drop_brand_mm 152 non-null float64\n", " 25 strike_heel 158 non-null int64 \n", " 26 strike_mid 158 non-null int64 \n", " 27 strike_forefoot 158 non-null int64 \n", " 28 softness_soft 158 non-null int64 \n", " 29 softness_balanced 158 non-null int64 \n", " 30 softness_firm 158 non-null int64 \n", " 31 toebox_durability 158 non-null int64 \n", " 32 heel_durability 158 non-null int64 \n", " 33 outsole_durability 158 non-null int64 \n", " 34 breathability 158 non-null int64 \n", " 35 plate_0 158 non-null int64 \n", " 36 plate_rock_plate 158 non-null int64 \n", " 37 plate_carbon_plate 158 non-null int64 \n", " 38 width_narrow 158 non-null int64 \n", " 39 width_medium 158 non-null int64 \n", " 40 width_wide 158 non-null int64 \n", " 41 toebox_narrow 158 non-null int64 \n", " 42 toebox_medium 158 non-null int64 \n", " 43 toebox_wide 158 non-null int64 \n", " 44 stiffness_flexible 158 non-null int64 \n", " 45 stiffness_moderate 158 non-null int64 \n", " 46 stiffness_stiff 158 non-null int64 \n", " 47 torsional_flexible 158 non-null int64 \n", " 48 torsional_moderate 158 non-null int64 \n", " 49 torsional_stiff 158 non-null int64 \n", " 50 heel_stiff_flexible 158 non-null int64 \n", " 51 heel_stiff_moderate 158 non-null int64 \n", " 52 heel_stiff_stiff 158 non-null int64 \n", " 53 lug_depth 158 non-null float64\n", " 54 heel_lab_mm 158 non-null float64\n", " 55 heel_brand_mm 145 non-null float64\n", " 56 forefoot_lab_mm 158 non-null float64\n", " 57 forefoot_brand_mm 143 non-null float64\n", " 58 season_summer 158 non-null int64 \n", " 59 season_winter 158 non-null int64 \n", " 60 season_all 158 non-null int64 \n", " 61 heavy_runners 158 non-null int64 \n", "dtypes: float64(11), int64(48), str(3)\n", "memory usage: 76.7 KB\n" ] } ], "source": [ "df.drop(columns=[\"For heavy runners\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "00fb8fe8", "metadata": {}, "source": [ "# Removable insole" ] }, { "cell_type": "code", "execution_count": 105, "id": "68f9c5b7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Removable insole\n", "1 147\n", "0 11\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Removable insole\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 106, "id": "4916d5ba", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Removable insole removable_insole\n", "0 1 1\n", "1 1 1\n", "2 1 1\n", "3 1 1\n", "4 1 1\n" ] } ], "source": [ "# rename Removable insole to removable_insole\n", "df['removable_insole'] = df['Removable insole'].fillna(0).astype(int)\n", "print(df[['Removable insole', 'removable_insole']].head())" ] }, { "cell_type": "code", "execution_count": 107, "id": "9eb46039", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 62 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Orthotic friendly 158 non-null int64 \n", " 4 Waterproofing 156 non-null str \n", " 5 terrain_light 158 non-null int64 \n", " 6 terrain_moderate 158 non-null int64 \n", " 7 terrain_technical 158 non-null int64 \n", " 8 shock_low 158 non-null int64 \n", " 9 shock_moderate 158 non-null int64 \n", " 10 shock_high 158 non-null int64 \n", " 11 energy_low 158 non-null int64 \n", " 12 energy_moderate 158 non-null int64 \n", " 13 energy_high 158 non-null int64 \n", " 14 traction_moderate 158 non-null int64 \n", " 15 traction_high 158 non-null int64 \n", " 16 arch_neutral 158 non-null int64 \n", " 17 arch_stability 158 non-null int64 \n", " 18 weight_lab_oz 158 non-null float64\n", " 19 weight_lab_g 158 non-null int64 \n", " 20 weight_brand_oz 155 non-null float64\n", " 21 weight_brand_g 155 non-null float64\n", " 22 drop_lab_mm 158 non-null float64\n", " 23 drop_brand_mm 152 non-null float64\n", " 24 strike_heel 158 non-null int64 \n", " 25 strike_mid 158 non-null int64 \n", " 26 strike_forefoot 158 non-null int64 \n", " 27 softness_soft 158 non-null int64 \n", " 28 softness_balanced 158 non-null int64 \n", " 29 softness_firm 158 non-null int64 \n", " 30 toebox_durability 158 non-null int64 \n", " 31 heel_durability 158 non-null int64 \n", " 32 outsole_durability 158 non-null int64 \n", " 33 breathability 158 non-null int64 \n", " 34 plate_0 158 non-null int64 \n", " 35 plate_rock_plate 158 non-null int64 \n", " 36 plate_carbon_plate 158 non-null int64 \n", " 37 width_narrow 158 non-null int64 \n", " 38 width_medium 158 non-null int64 \n", " 39 width_wide 158 non-null int64 \n", " 40 toebox_narrow 158 non-null int64 \n", " 41 toebox_medium 158 non-null int64 \n", " 42 toebox_wide 158 non-null int64 \n", " 43 stiffness_flexible 158 non-null int64 \n", " 44 stiffness_moderate 158 non-null int64 \n", " 45 stiffness_stiff 158 non-null int64 \n", " 46 torsional_flexible 158 non-null int64 \n", " 47 torsional_moderate 158 non-null int64 \n", " 48 torsional_stiff 158 non-null int64 \n", " 49 heel_stiff_flexible 158 non-null int64 \n", " 50 heel_stiff_moderate 158 non-null int64 \n", " 51 heel_stiff_stiff 158 non-null int64 \n", " 52 lug_depth 158 non-null float64\n", " 53 heel_lab_mm 158 non-null float64\n", " 54 heel_brand_mm 145 non-null float64\n", " 55 forefoot_lab_mm 158 non-null float64\n", " 56 forefoot_brand_mm 143 non-null float64\n", " 57 season_summer 158 non-null int64 \n", " 58 season_winter 158 non-null int64 \n", " 59 season_all 158 non-null int64 \n", " 60 heavy_runners 158 non-null int64 \n", " 61 removable_insole 158 non-null int64 \n", "dtypes: float64(11), int64(48), str(3)\n", "memory usage: 76.7 KB\n" ] } ], "source": [ "df.drop(columns=['Removable insole'], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "f145cc43", "metadata": {}, "source": [ "# Orthotic friendly" ] }, { "cell_type": "code", "execution_count": 108, "id": "d52a6df6", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Orthotic friendly\n", "1 147\n", "0 11\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df[\"Orthotic friendly\"].value_counts())" ] }, { "cell_type": "code", "execution_count": 109, "id": "8f548dc5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Orthotic friendly orthotic_friendly\n", "0 1 1\n", "1 1 1\n", "2 1 1\n", "3 1 1\n", "4 1 1\n" ] } ], "source": [ "# Rename Orthotic friendly to orthotic_friendly\n", "df['orthotic_friendly'] = df['Orthotic friendly'].fillna(0).astype(int)\n", "print(df[['Orthotic friendly', 'orthotic_friendly']].head())" ] }, { "cell_type": "code", "execution_count": 110, "id": "059a1824", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 62 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 Waterproofing 156 non-null str \n", " 4 terrain_light 158 non-null int64 \n", " 5 terrain_moderate 158 non-null int64 \n", " 6 terrain_technical 158 non-null int64 \n", " 7 shock_low 158 non-null int64 \n", " 8 shock_moderate 158 non-null int64 \n", " 9 shock_high 158 non-null int64 \n", " 10 energy_low 158 non-null int64 \n", " 11 energy_moderate 158 non-null int64 \n", " 12 energy_high 158 non-null int64 \n", " 13 traction_moderate 158 non-null int64 \n", " 14 traction_high 158 non-null int64 \n", " 15 arch_neutral 158 non-null int64 \n", " 16 arch_stability 158 non-null int64 \n", " 17 weight_lab_oz 158 non-null float64\n", " 18 weight_lab_g 158 non-null int64 \n", " 19 weight_brand_oz 155 non-null float64\n", " 20 weight_brand_g 155 non-null float64\n", " 21 drop_lab_mm 158 non-null float64\n", " 22 drop_brand_mm 152 non-null float64\n", " 23 strike_heel 158 non-null int64 \n", " 24 strike_mid 158 non-null int64 \n", " 25 strike_forefoot 158 non-null int64 \n", " 26 softness_soft 158 non-null int64 \n", " 27 softness_balanced 158 non-null int64 \n", " 28 softness_firm 158 non-null int64 \n", " 29 toebox_durability 158 non-null int64 \n", " 30 heel_durability 158 non-null int64 \n", " 31 outsole_durability 158 non-null int64 \n", " 32 breathability 158 non-null int64 \n", " 33 plate_0 158 non-null int64 \n", " 34 plate_rock_plate 158 non-null int64 \n", " 35 plate_carbon_plate 158 non-null int64 \n", " 36 width_narrow 158 non-null int64 \n", " 37 width_medium 158 non-null int64 \n", " 38 width_wide 158 non-null int64 \n", " 39 toebox_narrow 158 non-null int64 \n", " 40 toebox_medium 158 non-null int64 \n", " 41 toebox_wide 158 non-null int64 \n", " 42 stiffness_flexible 158 non-null int64 \n", " 43 stiffness_moderate 158 non-null int64 \n", " 44 stiffness_stiff 158 non-null int64 \n", " 45 torsional_flexible 158 non-null int64 \n", " 46 torsional_moderate 158 non-null int64 \n", " 47 torsional_stiff 158 non-null int64 \n", " 48 heel_stiff_flexible 158 non-null int64 \n", " 49 heel_stiff_moderate 158 non-null int64 \n", " 50 heel_stiff_stiff 158 non-null int64 \n", " 51 lug_depth 158 non-null float64\n", " 52 heel_lab_mm 158 non-null float64\n", " 53 heel_brand_mm 145 non-null float64\n", " 54 forefoot_lab_mm 158 non-null float64\n", " 55 forefoot_brand_mm 143 non-null float64\n", " 56 season_summer 158 non-null int64 \n", " 57 season_winter 158 non-null int64 \n", " 58 season_all 158 non-null int64 \n", " 59 heavy_runners 158 non-null int64 \n", " 60 removable_insole 158 non-null int64 \n", " 61 orthotic_friendly 158 non-null int64 \n", "dtypes: float64(11), int64(48), str(3)\n", "memory usage: 76.7 KB\n" ] } ], "source": [ "df.drop(columns=['Orthotic friendly'], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "442b3a27", "metadata": {}, "source": [ "# Waterproofing " ] }, { "cell_type": "code", "execution_count": 111, "id": "a056f12c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Waterproofing\n", "- 137\n", "Waterproof 12\n", "Water repellent 5\n", "Waterproof Water repellent 1\n", "0 1\n", "Name: count, dtype: int64\n" ] } ], "source": [ "print(df['Waterproofing'].value_counts())" ] }, { "cell_type": "markdown", "id": "7494a16e", "metadata": {}, "source": [ "Water repellent cuma nahan menolak air di permukaan tapi kalau terendam, kakinya tetap basah. kalau waterproof bener bener tahan air" ] }, { "cell_type": "code", "execution_count": 112, "id": "d52d4d09", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Rows: 158\n", "\n", "Sample Comparison:\n", " Waterproofing not_waterproof waterproof water_repellent\n", "0 - 1 0 0\n", "1 - 1 0 0\n", "2 - 1 0 0\n", "3 - 1 0 0\n", "4 - 1 0 0\n", "5 - 1 0 0\n", "6 - 1 0 0\n", "7 - 1 0 0\n", "8 - 1 0 0\n", "9 - 1 0 0\n" ] } ], "source": [ "df['Waterproofing'] = df['Waterproofing'].astype(str).str.lower()\n", "base_water = ['not waterproof', 'waterproof', 'water repellent']\n", "\n", "def check_not_waterproof(val):\n", " '''Cek apakah val menunjukkan not waterproof.\n", " Asumsi: jika val adalah - atau 0'''\n", " if val in ['-', '0', 'nan', 'none']:\n", " return 1\n", " return 0\n", "\n", "for level in base_water:\n", " column_name = level.replace(' ', '_')\n", " \n", " if level == 'not waterproof':\n", " df[column_name] = df['Waterproofing'].apply(check_not_waterproof)\n", " else:\n", " df[column_name] = df['Waterproofing'].str.contains(level, na=False).astype(int)\n", " df.loc[df['Waterproofing'].isin(['-', '0']), column_name] = 0\n", "\n", "print(\"Rows:\", len(df))\n", "\n", "water_cols = [l.replace(' ', '_') for l in base_water]\n", "\n", "print(\"\\nSample Comparison:\")\n", "print(df[[\"Waterproofing\"] + water_cols].head(10))\n" ] }, { "cell_type": "code", "execution_count": 113, "id": "9d6e1eb8", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Waterproofing\n", "- 137\n", "waterproof 12\n", "water repellent 5\n", "waterproof water repellent 1\n", "0 1\n", "Name: count, dtype: int64\n", "\n", "--- Sum Per Kolom ---\n", "not_waterproof sum: 138\n", "waterproof sum: 13\n", "water_repellent sum: 6\n", "\n", "Total Check (Harus >= 158): 157\n", "\n", " Waterproofing not_waterproof waterproof water_repellent\n", "0 - 1 0 0\n", "1 - 1 0 0\n", "2 - 1 0 0\n", "3 - 1 0 0\n", "4 - 1 0 0\n" ] } ], "source": [ "print(df[\"Waterproofing\"].value_counts())\n", "\n", "print(\"\\n--- Sum Per Kolom ---\")\n", "for col in water_cols:\n", " print(f\"{col} sum:\", int(df[col].sum()))\n", "\n", "total_sum = df[water_cols].sum().sum()\n", "print(f\"\\nTotal Check (Harus >= {len(df)}): {total_sum}\")\n", "\n", "print()\n", "print(df[[\"Waterproofing\"] + water_cols].head())" ] }, { "cell_type": "code", "execution_count": 114, "id": "1804482a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 64 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 Lightweight 152 non-null float64\n", " 3 terrain_light 158 non-null int64 \n", " 4 terrain_moderate 158 non-null int64 \n", " 5 terrain_technical 158 non-null int64 \n", " 6 shock_low 158 non-null int64 \n", " 7 shock_moderate 158 non-null int64 \n", " 8 shock_high 158 non-null int64 \n", " 9 energy_low 158 non-null int64 \n", " 10 energy_moderate 158 non-null int64 \n", " 11 energy_high 158 non-null int64 \n", " 12 traction_moderate 158 non-null int64 \n", " 13 traction_high 158 non-null int64 \n", " 14 arch_neutral 158 non-null int64 \n", " 15 arch_stability 158 non-null int64 \n", " 16 weight_lab_oz 158 non-null float64\n", " 17 weight_lab_g 158 non-null int64 \n", " 18 weight_brand_oz 155 non-null float64\n", " 19 weight_brand_g 155 non-null float64\n", " 20 drop_lab_mm 158 non-null float64\n", " 21 drop_brand_mm 152 non-null float64\n", " 22 strike_heel 158 non-null int64 \n", " 23 strike_mid 158 non-null int64 \n", " 24 strike_forefoot 158 non-null int64 \n", " 25 softness_soft 158 non-null int64 \n", " 26 softness_balanced 158 non-null int64 \n", " 27 softness_firm 158 non-null int64 \n", " 28 toebox_durability 158 non-null int64 \n", " 29 heel_durability 158 non-null int64 \n", " 30 outsole_durability 158 non-null int64 \n", " 31 breathability 158 non-null int64 \n", " 32 plate_0 158 non-null int64 \n", " 33 plate_rock_plate 158 non-null int64 \n", " 34 plate_carbon_plate 158 non-null int64 \n", " 35 width_narrow 158 non-null int64 \n", " 36 width_medium 158 non-null int64 \n", " 37 width_wide 158 non-null int64 \n", " 38 toebox_narrow 158 non-null int64 \n", " 39 toebox_medium 158 non-null int64 \n", " 40 toebox_wide 158 non-null int64 \n", " 41 stiffness_flexible 158 non-null int64 \n", " 42 stiffness_moderate 158 non-null int64 \n", " 43 stiffness_stiff 158 non-null int64 \n", " 44 torsional_flexible 158 non-null int64 \n", " 45 torsional_moderate 158 non-null int64 \n", " 46 torsional_stiff 158 non-null int64 \n", " 47 heel_stiff_flexible 158 non-null int64 \n", " 48 heel_stiff_moderate 158 non-null int64 \n", " 49 heel_stiff_stiff 158 non-null int64 \n", " 50 lug_depth 158 non-null float64\n", " 51 heel_lab_mm 158 non-null float64\n", " 52 heel_brand_mm 145 non-null float64\n", " 53 forefoot_lab_mm 158 non-null float64\n", " 54 forefoot_brand_mm 143 non-null float64\n", " 55 season_summer 158 non-null int64 \n", " 56 season_winter 158 non-null int64 \n", " 57 season_all 158 non-null int64 \n", " 58 heavy_runners 158 non-null int64 \n", " 59 removable_insole 158 non-null int64 \n", " 60 orthotic_friendly 158 non-null int64 \n", " 61 not_waterproof 158 non-null int64 \n", " 62 waterproof 158 non-null int64 \n", " 63 water_repellent 158 non-null int64 \n", "dtypes: float64(11), int64(51), str(2)\n", "memory usage: 79.1 KB\n" ] } ], "source": [ "df.drop(columns=[\"Waterproofing\"], inplace=True)\n", "df.info()" ] }, { "cell_type": "markdown", "id": "4a88a6c8", "metadata": {}, "source": [ "# Finishing" ] }, { "cell_type": "code", "execution_count": 115, "id": "26dc1dc9", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 64 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 weight_lab_g 158 non-null int64 \n", " 17 weight_brand_oz 155 non-null float64\n", " 18 weight_brand_g 155 non-null float64\n", " 19 drop_lab_mm 158 non-null float64\n", " 20 drop_brand_mm 152 non-null float64\n", " 21 strike_heel 158 non-null int64 \n", " 22 strike_mid 158 non-null int64 \n", " 23 strike_forefoot 158 non-null int64 \n", " 24 softness_soft 158 non-null int64 \n", " 25 softness_balanced 158 non-null int64 \n", " 26 softness_firm 158 non-null int64 \n", " 27 toebox_durability 158 non-null int64 \n", " 28 heel_durability 158 non-null int64 \n", " 29 outsole_durability 158 non-null int64 \n", " 30 breathability 158 non-null int64 \n", " 31 plate_0 158 non-null int64 \n", " 32 plate_rock_plate 158 non-null int64 \n", " 33 plate_carbon_plate 158 non-null int64 \n", " 34 width_narrow 158 non-null int64 \n", " 35 width_medium 158 non-null int64 \n", " 36 width_wide 158 non-null int64 \n", " 37 toebox_narrow 158 non-null int64 \n", " 38 toebox_medium 158 non-null int64 \n", " 39 toebox_wide 158 non-null int64 \n", " 40 stiffness_flexible 158 non-null int64 \n", " 41 stiffness_moderate 158 non-null int64 \n", " 42 stiffness_stiff 158 non-null int64 \n", " 43 torsional_flexible 158 non-null int64 \n", " 44 torsional_moderate 158 non-null int64 \n", " 45 torsional_stiff 158 non-null int64 \n", " 46 heel_stiff_flexible 158 non-null int64 \n", " 47 heel_stiff_moderate 158 non-null int64 \n", " 48 heel_stiff_stiff 158 non-null int64 \n", " 49 lug_depth 158 non-null float64\n", " 50 heel_lab_mm 158 non-null float64\n", " 51 heel_brand_mm 145 non-null float64\n", " 52 forefoot_lab_mm 158 non-null float64\n", " 53 forefoot_brand_mm 143 non-null float64\n", " 54 season_summer 158 non-null int64 \n", " 55 season_winter 158 non-null int64 \n", " 56 season_all 158 non-null int64 \n", " 57 heavy_runners 158 non-null int64 \n", " 58 removable_insole 158 non-null int64 \n", " 59 orthotic_friendly 158 non-null int64 \n", " 60 not_waterproof 158 non-null int64 \n", " 61 waterproof 158 non-null int64 \n", " 62 water_repellent 158 non-null int64 \n", " 63 lightweight 158 non-null int64 \n", "dtypes: float64(10), int64(52), str(2)\n", "memory usage: 79.1 KB\n" ] } ], "source": [ "# change lightweight to int\n", "df['lightweight'] = df['Lightweight'].fillna(0).astype(int)\n", "df.drop(columns=['Lightweight'], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 116, "id": "9b96e4f7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 61 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 drop_lab_mm 158 non-null float64\n", " 17 drop_brand_mm 152 non-null float64\n", " 18 strike_heel 158 non-null int64 \n", " 19 strike_mid 158 non-null int64 \n", " 20 strike_forefoot 158 non-null int64 \n", " 21 softness_soft 158 non-null int64 \n", " 22 softness_balanced 158 non-null int64 \n", " 23 softness_firm 158 non-null int64 \n", " 24 toebox_durability 158 non-null int64 \n", " 25 heel_durability 158 non-null int64 \n", " 26 outsole_durability 158 non-null int64 \n", " 27 breathability 158 non-null int64 \n", " 28 plate_0 158 non-null int64 \n", " 29 plate_rock_plate 158 non-null int64 \n", " 30 plate_carbon_plate 158 non-null int64 \n", " 31 width_narrow 158 non-null int64 \n", " 32 width_medium 158 non-null int64 \n", " 33 width_wide 158 non-null int64 \n", " 34 toebox_narrow 158 non-null int64 \n", " 35 toebox_medium 158 non-null int64 \n", " 36 toebox_wide 158 non-null int64 \n", " 37 stiffness_flexible 158 non-null int64 \n", " 38 stiffness_moderate 158 non-null int64 \n", " 39 stiffness_stiff 158 non-null int64 \n", " 40 torsional_flexible 158 non-null int64 \n", " 41 torsional_moderate 158 non-null int64 \n", " 42 torsional_stiff 158 non-null int64 \n", " 43 heel_stiff_flexible 158 non-null int64 \n", " 44 heel_stiff_moderate 158 non-null int64 \n", " 45 heel_stiff_stiff 158 non-null int64 \n", " 46 lug_depth 158 non-null float64\n", " 47 heel_lab_mm 158 non-null float64\n", " 48 heel_brand_mm 145 non-null float64\n", " 49 forefoot_lab_mm 158 non-null float64\n", " 50 forefoot_brand_mm 143 non-null float64\n", " 51 season_summer 158 non-null int64 \n", " 52 season_winter 158 non-null int64 \n", " 53 season_all 158 non-null int64 \n", " 54 heavy_runners 158 non-null int64 \n", " 55 removable_insole 158 non-null int64 \n", " 56 orthotic_friendly 158 non-null int64 \n", " 57 not_waterproof 158 non-null int64 \n", " 58 waterproof 158 non-null int64 \n", " 59 water_repellent 158 non-null int64 \n", " 60 lightweight 158 non-null int64 \n", "dtypes: float64(8), int64(51), str(2)\n", "memory usage: 75.4 KB\n" ] } ], "source": [ "# Weight cuma pakai yg lab_oz\n", "df.drop(columns=['weight_brand_oz', 'weight_lab_g', 'weight_brand_g'], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 117, "id": "40a900de", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 60 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 drop_lab_mm 158 non-null float64\n", " 17 strike_heel 158 non-null int64 \n", " 18 strike_mid 158 non-null int64 \n", " 19 strike_forefoot 158 non-null int64 \n", " 20 softness_soft 158 non-null int64 \n", " 21 softness_balanced 158 non-null int64 \n", " 22 softness_firm 158 non-null int64 \n", " 23 toebox_durability 158 non-null int64 \n", " 24 heel_durability 158 non-null int64 \n", " 25 outsole_durability 158 non-null int64 \n", " 26 breathability 158 non-null int64 \n", " 27 plate_0 158 non-null int64 \n", " 28 plate_rock_plate 158 non-null int64 \n", " 29 plate_carbon_plate 158 non-null int64 \n", " 30 width_narrow 158 non-null int64 \n", " 31 width_medium 158 non-null int64 \n", " 32 width_wide 158 non-null int64 \n", " 33 toebox_narrow 158 non-null int64 \n", " 34 toebox_medium 158 non-null int64 \n", " 35 toebox_wide 158 non-null int64 \n", " 36 stiffness_flexible 158 non-null int64 \n", " 37 stiffness_moderate 158 non-null int64 \n", " 38 stiffness_stiff 158 non-null int64 \n", " 39 torsional_flexible 158 non-null int64 \n", " 40 torsional_moderate 158 non-null int64 \n", " 41 torsional_stiff 158 non-null int64 \n", " 42 heel_stiff_flexible 158 non-null int64 \n", " 43 heel_stiff_moderate 158 non-null int64 \n", " 44 heel_stiff_stiff 158 non-null int64 \n", " 45 lug_depth 158 non-null float64\n", " 46 heel_lab_mm 158 non-null float64\n", " 47 heel_brand_mm 145 non-null float64\n", " 48 forefoot_lab_mm 158 non-null float64\n", " 49 forefoot_brand_mm 143 non-null float64\n", " 50 season_summer 158 non-null int64 \n", " 51 season_winter 158 non-null int64 \n", " 52 season_all 158 non-null int64 \n", " 53 heavy_runners 158 non-null int64 \n", " 54 removable_insole 158 non-null int64 \n", " 55 orthotic_friendly 158 non-null int64 \n", " 56 not_waterproof 158 non-null int64 \n", " 57 waterproof 158 non-null int64 \n", " 58 water_repellent 158 non-null int64 \n", " 59 lightweight 158 non-null int64 \n", "dtypes: float64(7), int64(51), str(2)\n", "memory usage: 74.2 KB\n" ] } ], "source": [ "# drop cuma pakai yg lab_mm\n", "df.drop(columns=['drop_brand_mm'], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 118, "id": "84034462", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 59 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 drop_lab_mm 158 non-null float64\n", " 17 strike_heel 158 non-null int64 \n", " 18 strike_mid 158 non-null int64 \n", " 19 strike_forefoot 158 non-null int64 \n", " 20 softness_soft 158 non-null int64 \n", " 21 softness_balanced 158 non-null int64 \n", " 22 softness_firm 158 non-null int64 \n", " 23 toebox_durability 158 non-null int64 \n", " 24 heel_durability 158 non-null int64 \n", " 25 outsole_durability 158 non-null int64 \n", " 26 breathability 158 non-null int64 \n", " 27 plate_0 158 non-null int64 \n", " 28 plate_rock_plate 158 non-null int64 \n", " 29 plate_carbon_plate 158 non-null int64 \n", " 30 width_narrow 158 non-null int64 \n", " 31 width_medium 158 non-null int64 \n", " 32 width_wide 158 non-null int64 \n", " 33 toebox_narrow 158 non-null int64 \n", " 34 toebox_medium 158 non-null int64 \n", " 35 toebox_wide 158 non-null int64 \n", " 36 stiffness_flexible 158 non-null int64 \n", " 37 stiffness_moderate 158 non-null int64 \n", " 38 stiffness_stiff 158 non-null int64 \n", " 39 torsional_flexible 158 non-null int64 \n", " 40 torsional_moderate 158 non-null int64 \n", " 41 torsional_stiff 158 non-null int64 \n", " 42 heel_stiff_flexible 158 non-null int64 \n", " 43 heel_stiff_moderate 158 non-null int64 \n", " 44 heel_stiff_stiff 158 non-null int64 \n", " 45 lug_depth 158 non-null float64\n", " 46 heel_lab_mm 158 non-null float64\n", " 47 forefoot_lab_mm 158 non-null float64\n", " 48 forefoot_brand_mm 143 non-null float64\n", " 49 season_summer 158 non-null int64 \n", " 50 season_winter 158 non-null int64 \n", " 51 season_all 158 non-null int64 \n", " 52 heavy_runners 158 non-null int64 \n", " 53 removable_insole 158 non-null int64 \n", " 54 orthotic_friendly 158 non-null int64 \n", " 55 not_waterproof 158 non-null int64 \n", " 56 waterproof 158 non-null int64 \n", " 57 water_repellent 158 non-null int64 \n", " 58 lightweight 158 non-null int64 \n", "dtypes: float64(6), int64(51), str(2)\n", "memory usage: 73.0 KB\n" ] } ], "source": [ "# heel pakai yang heel_lab_mm\n", "df.drop(columns=['heel_brand_mm'], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 119, "id": "becce231", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 58 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 drop_lab_mm 158 non-null float64\n", " 17 strike_heel 158 non-null int64 \n", " 18 strike_mid 158 non-null int64 \n", " 19 strike_forefoot 158 non-null int64 \n", " 20 softness_soft 158 non-null int64 \n", " 21 softness_balanced 158 non-null int64 \n", " 22 softness_firm 158 non-null int64 \n", " 23 toebox_durability 158 non-null int64 \n", " 24 heel_durability 158 non-null int64 \n", " 25 outsole_durability 158 non-null int64 \n", " 26 breathability 158 non-null int64 \n", " 27 plate_0 158 non-null int64 \n", " 28 plate_rock_plate 158 non-null int64 \n", " 29 plate_carbon_plate 158 non-null int64 \n", " 30 width_narrow 158 non-null int64 \n", " 31 width_medium 158 non-null int64 \n", " 32 width_wide 158 non-null int64 \n", " 33 toebox_narrow 158 non-null int64 \n", " 34 toebox_medium 158 non-null int64 \n", " 35 toebox_wide 158 non-null int64 \n", " 36 stiffness_flexible 158 non-null int64 \n", " 37 stiffness_moderate 158 non-null int64 \n", " 38 stiffness_stiff 158 non-null int64 \n", " 39 torsional_flexible 158 non-null int64 \n", " 40 torsional_moderate 158 non-null int64 \n", " 41 torsional_stiff 158 non-null int64 \n", " 42 heel_stiff_flexible 158 non-null int64 \n", " 43 heel_stiff_moderate 158 non-null int64 \n", " 44 heel_stiff_stiff 158 non-null int64 \n", " 45 lug_depth 158 non-null float64\n", " 46 heel_lab_mm 158 non-null float64\n", " 47 forefoot_lab_mm 158 non-null float64\n", " 48 season_summer 158 non-null int64 \n", " 49 season_winter 158 non-null int64 \n", " 50 season_all 158 non-null int64 \n", " 51 heavy_runners 158 non-null int64 \n", " 52 removable_insole 158 non-null int64 \n", " 53 orthotic_friendly 158 non-null int64 \n", " 54 not_waterproof 158 non-null int64 \n", " 55 waterproof 158 non-null int64 \n", " 56 water_repellent 158 non-null int64 \n", " 57 lightweight 158 non-null int64 \n", "dtypes: float64(5), int64(51), str(2)\n", "memory usage: 71.7 KB\n" ] } ], "source": [ "# Forefoot pakai yang forefoot_lab_mm\n", "df.drop(columns=['forefoot_brand_mm'], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 120, "id": "3dcfea5d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 57 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 Brand 158 non-null str \n", " 1 Name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 drop_lab_mm 158 non-null float64\n", " 17 strike_heel 158 non-null int64 \n", " 18 strike_mid 158 non-null int64 \n", " 19 strike_forefoot 158 non-null int64 \n", " 20 softness_soft 158 non-null int64 \n", " 21 softness_balanced 158 non-null int64 \n", " 22 softness_firm 158 non-null int64 \n", " 23 toebox_durability 158 non-null int64 \n", " 24 heel_durability 158 non-null int64 \n", " 25 outsole_durability 158 non-null int64 \n", " 26 breathability 158 non-null int64 \n", " 27 plate_0 158 non-null int64 \n", " 28 plate_rock_plate 158 non-null int64 \n", " 29 plate_carbon_plate 158 non-null int64 \n", " 30 width_narrow 158 non-null int64 \n", " 31 width_medium 158 non-null int64 \n", " 32 width_wide 158 non-null int64 \n", " 33 toebox_narrow 158 non-null int64 \n", " 34 toebox_medium 158 non-null int64 \n", " 35 toebox_wide 158 non-null int64 \n", " 36 stiffness_flexible 158 non-null int64 \n", " 37 stiffness_moderate 158 non-null int64 \n", " 38 stiffness_stiff 158 non-null int64 \n", " 39 torsional_flexible 158 non-null int64 \n", " 40 torsional_moderate 158 non-null int64 \n", " 41 torsional_stiff 158 non-null int64 \n", " 42 heel_stiff_flexible 158 non-null int64 \n", " 43 heel_stiff_moderate 158 non-null int64 \n", " 44 heel_stiff_stiff 158 non-null int64 \n", " 45 lug_depth 158 non-null float64\n", " 46 heel_lab_mm 158 non-null float64\n", " 47 forefoot_lab_mm 158 non-null float64\n", " 48 season_summer 158 non-null int64 \n", " 49 season_winter 158 non-null int64 \n", " 50 season_all 158 non-null int64 \n", " 51 heavy_runners 158 non-null int64 \n", " 52 removable_insole 158 non-null int64 \n", " 53 orthotic_friendly 158 non-null int64 \n", " 54 waterproof 158 non-null int64 \n", " 55 water_repellent 158 non-null int64 \n", " 56 lightweight 158 non-null int64 \n", "dtypes: float64(5), int64(50), str(2)\n", "memory usage: 70.5 KB\n" ] } ], "source": [ "df.drop(columns=['not_waterproof'], inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": 124, "id": "f4fa327a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "RangeIndex: 158 entries, 0 to 157\n", "Data columns (total 57 columns):\n", " # Column Non-Null Count Dtype \n", "--- ------ -------------- ----- \n", " 0 brand 158 non-null str \n", " 1 name 158 non-null str \n", " 2 terrain_light 158 non-null int64 \n", " 3 terrain_moderate 158 non-null int64 \n", " 4 terrain_technical 158 non-null int64 \n", " 5 shock_low 158 non-null int64 \n", " 6 shock_moderate 158 non-null int64 \n", " 7 shock_high 158 non-null int64 \n", " 8 energy_low 158 non-null int64 \n", " 9 energy_moderate 158 non-null int64 \n", " 10 energy_high 158 non-null int64 \n", " 11 traction_moderate 158 non-null int64 \n", " 12 traction_high 158 non-null int64 \n", " 13 arch_neutral 158 non-null int64 \n", " 14 arch_stability 158 non-null int64 \n", " 15 weight_lab_oz 158 non-null float64\n", " 16 drop_lab_mm 158 non-null float64\n", " 17 strike_heel 158 non-null int64 \n", " 18 strike_mid 158 non-null int64 \n", " 19 strike_forefoot 158 non-null int64 \n", " 20 softness_soft 158 non-null int64 \n", " 21 softness_balanced 158 non-null int64 \n", " 22 softness_firm 158 non-null int64 \n", " 23 toebox_durability 158 non-null int64 \n", " 24 heel_durability 158 non-null int64 \n", " 25 outsole_durability 158 non-null int64 \n", " 26 breathability 158 non-null int64 \n", " 27 plate_0 158 non-null int64 \n", " 28 plate_rock_plate 158 non-null int64 \n", " 29 plate_carbon_plate 158 non-null int64 \n", " 30 width_narrow 158 non-null int64 \n", " 31 width_medium 158 non-null int64 \n", " 32 width_wide 158 non-null int64 \n", " 33 toebox_narrow 158 non-null int64 \n", " 34 toebox_medium 158 non-null int64 \n", " 35 toebox_wide 158 non-null int64 \n", " 36 stiffness_flexible 158 non-null int64 \n", " 37 stiffness_moderate 158 non-null int64 \n", " 38 stiffness_stiff 158 non-null int64 \n", " 39 torsional_flexible 158 non-null int64 \n", " 40 torsional_moderate 158 non-null int64 \n", " 41 torsional_stiff 158 non-null int64 \n", " 42 heel_stiff_flexible 158 non-null int64 \n", " 43 heel_stiff_moderate 158 non-null int64 \n", " 44 heel_stiff_stiff 158 non-null int64 \n", " 45 lug_depth 158 non-null float64\n", " 46 heel_lab_mm 158 non-null float64\n", " 47 forefoot_lab_mm 158 non-null float64\n", " 48 season_summer 158 non-null int64 \n", " 49 season_winter 158 non-null int64 \n", " 50 season_all 158 non-null int64 \n", " 51 heavy_runners 158 non-null int64 \n", " 52 removable_insole 158 non-null int64 \n", " 53 orthotic_friendly 158 non-null int64 \n", " 54 waterproof 158 non-null int64 \n", " 55 water_repellent 158 non-null int64 \n", " 56 lightweight 158 non-null int64 \n", "dtypes: float64(5), int64(50), str(2)\n", "memory usage: 70.5 KB\n" ] } ], "source": [ "df.rename(columns={\n", " 'Brand': 'brand', \n", " 'Name': 'name'}, inplace=True)\n", "df.info()" ] }, { "cell_type": "code", "execution_count": null, "id": "d61c3f64", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 125, "id": "5cc8f859", "metadata": {}, "outputs": [], "source": [ "df.to_csv('../../data/trail_dataset.csv', index=False)" ] } ], "metadata": { "kernelspec": { "display_name": "env", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.11" } }, "nbformat": 4, "nbformat_minor": 5 }