Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.87 KB | None | 0 0
  1. import numpy as np
  2. import pandas as pd
  3. import matplotlib.pyplot as plt
  4.  
  5. men = pd.read_csv("US Rank List Men.csv")
  6. women = pd.read_csv("US Rank List Women.csv")
  7. mixed = pd.read_csv("US Rank List Mixed.csv")
  8. us_open = pd.read_csv("US Rank List Open.csv")
  9. athlete_list = pd.concat([men, women, mixed, us_open], axis = 0)
  10. athlete_list.drop(athlete_list.columns[[6,5,7,8,9,12,13,14,15,16,17,18]],
  11. axis = 1, inplace = True)
  12. athlete_list["Person/Team"] = athlete_list["Person/Team"].str.replace(r"\(.*\)","")
  13. athlete_list["Discipline"] = athlete_list["Discipline"].str.strip()
  14. athlete_list["DoB"] = pd.to_datetime(athlete_list["DoB"], errors = "coerce")
  15.  
  16. # Create nested dictionary for {Sport: [Dispcline, Risk]}
  17. risk_dict = {
  18. "44": {
  19. "37": 1.00,
  20. "39": .986182,
  21. "36": .980809,
  22. "35": .963153,
  23. "38": .952406,
  24. "40": .943961
  25. },
  26. "1": {
  27. "55": .017437,
  28. "54": .017437,
  29. "61": .017437,
  30. },
  31. "12":{
  32. "7": .605391,
  33. "90": .570079,
  34. "52": .566241,
  35. "6": .565473,
  36. "8": .559332,
  37. "57": .558565,
  38. },
  39. "51":{
  40. "224": .525208,
  41. },
  42. "48" :{
  43. "42": .286292,
  44. "41": .053626,
  45. },
  46. "42":{
  47. "180": .27401,
  48. },
  49. "52":{
  50. "47": .177908,
  51. "46": .161019,
  52. },
  53. "38": {
  54. "85": .171079,
  55. "84": .151888,
  56. "86": .140373,
  57. "87": .136535,
  58. },
  59. "20":{
  60. "15": .152899,
  61. "16": .12987,
  62. "17": .129102,
  63. },
  64. "22":{
  65. "164": .136172,
  66. },
  67. "8":{
  68. "155": .132829,
  69. },
  70. "36":{
  71. "31": .125921,
  72. "135": .125921,
  73. "34": .125921,
  74. "136": .11978,
  75. },
  76. "27":{
  77. "174": .096624,
  78. },
  79. "85":{
  80. "200": .094119,
  81. "244": .094119,
  82. },
  83. "47":{
  84. "81": .081165,
  85. "80": .068883,
  86. },
  87. "90":{
  88. "122": .074478,
  89. "124": .065266,
  90. "121": .064499,
  91. "125": .062963,
  92. "123": .062963,
  93. },
  94. "18":{
  95. "162": .067781,
  96. },
  97. "30":{
  98. "22": .065472,
  99. "23": .065472,
  100. "24": .065472,
  101. "21": .065472,
  102. },
  103. "34":{
  104. "201": .062192,
  105. },
  106. "107":{
  107. "194": .062084,
  108. },
  109. "41":{
  110. "202": .061201,
  111. },
  112. "15":{
  113. "216": .059223,
  114. },
  115. "88":{
  116. "219": .056303,
  117. },
  118. "43":{
  119. "139": .055173,
  120. },
  121. "111":{
  122. "68": .047926,
  123. "69": .047926,
  124. },
  125. "7":{
  126. "154": .040582,
  127. },
  128. "19":{
  129. "176": .038383,
  130. },
  131. "21":{
  132. "163": .037286,
  133. },
  134. "94":{
  135. "82": .034222,
  136. "83": .033455,
  137. "110": .026546
  138. },
  139. "49":{
  140. "147": .033779,
  141. },
  142. "89":{
  143. "183": .032947,
  144. },
  145. "6":{
  146. "2": .032132,
  147. "3": .015572,
  148. },
  149. "33":{
  150. "64": .032132,
  151. "25": .028842,
  152. "27": .021494,
  153. "75": .01305,
  154. "77": .010747,
  155. "26": .008663,
  156. "29": .005922,
  157. "28": .005922,
  158. "76": .032132,
  159. "63": .028842,
  160. "62": .021494,
  161. "133": .01305,
  162. },
  163. "29":{
  164. "175": .027745,
  165. },
  166. "143":{
  167. "196": .02435,
  168. },
  169. "110":{
  170. "184": .022262,
  171. },
  172. "16":{
  173. "9": .021277,
  174. "10": .021277,
  175. "11": .021277,
  176. "102": .02051,
  177. },
  178. "11":{
  179. "158": .020946,
  180. },
  181. "57":{
  182. "49": .017656,
  183. "48": .0176556,
  184. },
  185. "108":{
  186. "198": .016781,
  187. },
  188. "23":{
  189. "167": .01645,
  190. },
  191. "86":{
  192. "191": .016121,
  193. },
  194. "35":{
  195. "177": .015463,
  196. },
  197. "84":{
  198. "189": .015353,
  199. },
  200. "50":{
  201. "45": .014585,
  202. "43": .014585,
  203. "44": .014585,
  204. "56": .014585,
  205. },
  206. "114":{
  207. "187": .014478,
  208. },
  209. "97":{
  210. "190": .01305,
  211. },
  212. "39":{
  213. "146": .011953,
  214. },
  215. "102":{
  216. "210": .011515,
  217. "209": .011515,
  218. },
  219. "103":{
  220. "118": .010747,
  221. "117": .004606,
  222. "119": .10747,
  223. },
  224. "25":{
  225. "173": .010747,
  226. },
  227. "9":{
  228. "4": .005812,
  229. "88": .005045,
  230. "89": .004277,
  231. "5": .00965,
  232. },
  233. "17":{
  234. "12": .007786,
  235. "13": .007786,
  236. "14": .007019,
  237. },
  238. "2":{
  239. "148": .007677,
  240. },
  241. "5":{
  242. "151": .007677,
  243. },
  244. "40":{
  245. "179": .007677,
  246. },
  247. "24":{
  248. "168": .007348,
  249. },
  250. "123":{
  251. "193": .006909,
  252. },
  253. "101":{
  254. "73": .006141,
  255. "72": .006141,
  256. "74": .006141,
  257. },
  258. "138":{
  259. "1199": .006141,
  260. },
  261. "37":{
  262. "178": .006141,
  263. },
  264. "99":{
  265. "192": .003071,
  266. },
  267. "153":{
  268. "186": .002303,
  269. },
  270. "93":{
  271. "114": .002303,
  272. "113": .002303
  273. },
  274. "104":{
  275. "197": .001535,},}
  276.  
  277. #TODO Take the athlete_list dataframe and convert the sport/discipline names
  278. # to those conained in the risk dictionary.
  279.  
  280.  
  281. # Replace command does not like matching k:v pairs, so those are commented out
  282. sport_dict={
  283. "Athletics": "44",
  284. "Archery": "1",
  285. "Alpine Skiing": "33",
  286. "Badminton": "2",
  287. "Baseball": "3",
  288. "Basketball": "4",
  289. "Beach Volleyball": "48",
  290. "Biathlon": "5",
  291. "BMX": "12",
  292. "Bobsleigh": "6",
  293. "Boxing": "8",
  294. "Canoe Slalom": "9",
  295. "Canoe Sprint": "9",
  296. "Cross Country Skiing": "33",
  297. "Curling": "11",
  298. "Cycling - Road": "12",
  299. "Cycling - Track": "12",
  300. "Diving": "15",
  301. "Fencing": "17",
  302. "Figure Skating": "19",
  303. "Football": "34",
  304. "Freestyle Skiing": "33",
  305. "Golf": "142",
  306. "Gymnastics - Artistic": "20",
  307. "Gymnastics - Trampolining": "20",
  308. "Handball": "41",
  309. "Hockey": "18",
  310. "Ice Hockey": "21",
  311. "Judo": "22",
  312. "Karate": "57",
  313. "Luge": "23",
  314. "Modern Pentathlon": "24",
  315. "Mountain Bike": "12",
  316. "Nordic Combined": "33",
  317. "Open Water Swimming": "38",
  318. "Rowing": "27",
  319. "Rugby Sevens": "111",
  320. "Sailing": "29",
  321. "Shooting": "30",
  322. "Short Track": "36",
  323. "Skateboarding": "133",
  324. "Skeleton": "6",
  325. "Ski Jumping": "33",
  326. "Snowboard": "33",
  327. "Speed Skating": "36",
  328. "Sport Climbing": "121",
  329. "Surfing": "141",
  330. "Swimming": "38",
  331. "Table Tennis": "40",
  332. "Taekwondo": "43",
  333. "Tennis": "42",
  334. "Triathlon": "47",
  335. "Volleyball": "48",
  336. "Water Polo": "49",
  337. "Weightlifting": "51",
  338. "Wrestling - Freestyle": "52",
  339. "Wrestling - Greco-Roman": "52",
  340. "Gymnastics - Rhythmic": "20",
  341. "Softball": "35",
  342. "Synchronised Swimming": "39",
  343. "Equestrian - Dressage": "16",
  344. "Equestrian - Eventing": "16",
  345. "Equestrian - Jumping": "16"}
  346.  
  347. athlete_list = athlete_list.replace({"Sport": sport_dict})
  348.  
  349. discipline_change_dict = {
  350. "44": {
  351. "4 x 100m Relay": "37",
  352. "4 x 400m Relay": "37",
  353. "4 x 400m Relay Indoor": "37",
  354. "60m Hurdles Indoor": "37",
  355. "50km Walk" : "39",
  356. "60m Hurdles Indoor": "37",
  357. "60m Indoor": "37",
  358. "100m": "37",
  359. "110m Hurdles": "37",
  360. "200m":"37",
  361. "400m":"37",
  362. "400m Hurdles":"37",
  363. "400m Indoor": "37",
  364. "800m": "38",
  365. "800m Indoor": "38",
  366. "1500m": "38",
  367. "1500m Indoor": "38",
  368. "3000m Indoor": "39",
  369. "3000m Steeplechase": "39",
  370. "5000m": "39",
  371. "10000m": "39",
  372. "Decathlon": "40",
  373. "Heptathlon": "40",
  374. "Discus Throw": "35",
  375. "Hammer Throw": "35",
  376. "High Jump": "36",
  377. "Javelin Throw": "35",
  378. "Long Jump": "36",
  379. "Marathon": "39",
  380. "Pole Vault": "36",
  381. "Shot Put": "35",
  382. "Triple Jump": "36",
  383. "100m Hurdles": "37",
  384. "20km Walk": "39",
  385. },
  386. "2":{
  387. "Doubles": "148",
  388. "Singles": "148",
  389. },
  390. "5":{
  391. "4 x 7.5km Relay": "151",
  392. "10k Sprint": "151",
  393. "12.5km Pursuit": "151",
  394. "15km Mass Start": "151",
  395. "20km Individual": "151",
  396. "4 x 6km Relay": "151",
  397. "7.5km Sprint": "151",
  398. "10km Pursuit": "151",
  399. "10km Sprint": "151",
  400. "12.5km Mass Start": "151",
  401. "15km Individual": "151",
  402. "2 x 6 + 2 x 7.5km Relay": "151",
  403. "6 + 7.5km Relay": "151",
  404. },
  405. "6":{
  406. "2-Man Competition": "2",
  407. "Individual": "3",
  408. "4-Man Competition": "2",
  409. },
  410. "8":{
  411. "Bantamweight": "155",
  412. "Flyweight": "155",
  413. "Light Flyweight": "155",
  414. "Light Heavyweight": "155",
  415. "Light Welterweight": "155",
  416. "Lightweight": "155",
  417. "Middleweight": "155",
  418. "Super Heavyweight": "155",
  419. "Welterweight": "155",
  420. },
  421. "9":{
  422. "C1 200m": "4",
  423. "C1 1000m": "89",
  424. "K1 200m": "4",
  425. "K1 500m": "88",
  426. "K1 1000m": "89",
  427. "K1 5000m": "89",
  428. "K2 500m": "88",
  429. "K4 1000m": "89",
  430. "K4 500m": "88",
  431. "C1": "5",
  432. "C1 Team": "5",
  433. "C2": "5",
  434. "C2 Team": "5",
  435. "K1": "5",
  436. "K1 Cross": "5",
  437. "K1 Team": "5",
  438. },
  439. "11":{
  440. "Team": "158",
  441. "Doubles": "158",
  442. },
  443. "12":{
  444. "Individual": "52",
  445. "1km Time Trial": "8",
  446. "3km Individual Pursuit": "8",
  447. "4-Cross": "57",
  448. "4km Individual Pursuit": "8",
  449. "500m Time Trial": "8",
  450. "Cross Country": "6",
  451. "Cross Country Eliminator": "6",
  452. "Downhill": "6",
  453. "Individual time trial": "7",
  454. "Keirin": "90",
  455. "Madison": "90",
  456. "Marathon": "6",
  457. "Omnium": "90",
  458. "Points Race": "90",
  459. "Road race": "7",
  460. "Scratch": "90",
  461. "Sprint": "8",
  462. "Team Pursuit": "8",
  463. "Team Sprint": "8",
  464. },
  465. "15":{
  466. "10m Platform": "216",
  467. "10m Platform Synchro": "216",
  468. "1m Springboard": "216",
  469. "3m Springboard": "216",
  470. "3m Springboard Synchro": "216",
  471. },
  472. "16":{
  473. "Individual": "10",
  474. "Team": "10",# Nielson breaks on 3 levels, us on 2, so everything into 1 category
  475. },
  476. "17":{
  477. "Individual Epee": "12",
  478. "Individual Foil": "13",
  479. "Individual Sabre": "13",
  480. "Team Epee": "12",
  481. "Team Foil": "13",
  482. "Team Sabre": "13",
  483. },
  484. "18":{
  485. "Team": "162",
  486. },
  487. "19":{
  488. "Ice Dance": "176",
  489. "Pairs": "176",
  490. "Singles": "176",
  491. "Team": "176",
  492. },
  493. "142":{
  494. "Individual": "217",
  495. },
  496. "20":{
  497. "Ball": "16",
  498. "Beam": "15",
  499. "Clubs": "16",
  500. "Floor Exercise": "15",
  501. "Group All-Around": "16",
  502. "Group Competition - 3x Clubs + 2x Hoop": "16",
  503. "Group Competition - 5x Hoop": "16",
  504. "Group Competition - 5x Ribbon": "16",
  505. "Hoop": "16",
  506. "Horizontal Bar": "15",
  507. "Individual All-Around": "15",
  508. "Parallel Bars": "15",
  509. "Pommel Horse": "15",
  510. "Individual Trampoline": "17",
  511. "Ribbon": "16",
  512. "Rings": "15",
  513. "Team": "15",
  514. "Uneven Bars": "15",
  515. "Vault": "15",
  516. },
  517. "21":{
  518. "Team": "163",
  519. },
  520. "22":{
  521. "+100kg": "164",
  522. "+78kg": "164",
  523. "100kg": "164",
  524. "48kg": "164",
  525. "52kg": "164",
  526. "57kg": "164",
  527. "60kg": "164",
  528. "63kg": "164",
  529. "66kg": "164",
  530. "70kg": "164",
  531. "73kg": "164",
  532. "78kg": "164",
  533. "81kg": "164",
  534. "90kg": "164",
  535. },
  536. "57":{
  537. "+68kg Kumite": "48", #We have no history on Kumite, so cominbing all into karate
  538. "+84kg Kumite": "48",
  539. "-50kg Kumite": "48",
  540. "-55kg Kumite": "48",
  541. "-60kg Kumite": "48",
  542. "-61kg Kumite": "48",
  543. "-67kg Kumite": "48",
  544. "-68kg Kumite": "48",
  545. "-75kg Kumite": "48",
  546. "-84kg Kumite": "48",
  547. "Individual Kata": "49",
  548. "Team Kata": "49",
  549. "Team Kumite": "48",
  550. "Individual Kumite": "48",
  551. },
  552. "23":{
  553. "Double": "167",
  554. "Single": "167",
  555. "Sprint - Double": "167",
  556. "Sprint - Single": "167",
  557. "Team - Relay": "167",
  558. },
  559. "24":{
  560. "Individual": "168",
  561. },
  562. "27":{
  563. "Coxed Pair": "174",
  564. "Double Sculls": "174",
  565. "Eight": "174",
  566. "Four": "174",
  567. "Lightweight Double Sculls": "174",
  568. "Lightweight Eight": "174",
  569. "Lightweight Four": "174",
  570. "Lightweight Pair": "174",
  571. "Lightweight Quadruple Sculls": "174",
  572. "Lightweight Single Sculls": "174",
  573. "Pair": "174",
  574. "Quadruple Sculls": "174",
  575. "Single Sculls": "174",
  576. },
  577. "111":{
  578. "Team": "69",
  579. },
  580. "29":{
  581. "470": "175",
  582. "49er": "175",
  583. "49er FX": "175",
  584. "Finn": "175",
  585. "Laser": "175",
  586. "Laser Radial": "175",
  587. "Nacra 17": "175",
  588. "RS:X": "175",
  589. },
  590. "30":{
  591. "10m Air Pistol": "22",
  592. "10m Air Rifle": "23",
  593. "25m Pistol": "22",
  594. "50m Pistol": "22",
  595. "50m Rifle 3 Positions": "23",
  596. "50m Rifle Prone": "23",
  597. "Double Trap": "21",
  598. "Skeet": "21",
  599. "Trap": "21",
  600. "25m Rapid Fire Pistol": "22",
  601. },
  602. "133":{
  603. "Park": "222",
  604. "Street": "222",
  605. },
  606. "33":{
  607. "5km Classic Style": "26",
  608. "5km Freestyle": "26",
  609. "10km Classic Style": "26",
  610. "10km Freestyle": "26",
  611. "15km Classic Style": "26",
  612. "15km Freestyle": "26",
  613. "30km Classic Style": "26",
  614. "30km Freestyle": "26",
  615. "2 x 10km Skiathlon": "26",
  616. "4 x 10km Skiathlon": "26",
  617. "2 x 15km Skiathlon": "26",
  618. "2 x 5km Skiathlon": "26",
  619. "2 x 7.5km Skiathlon": "26",
  620. "4 x 5km Relay": "26",
  621. "4 x 7.5km Relay": "26",
  622. "50km Classic Style": "26",
  623. "50km Freestyle": "26",
  624. "5km Classic Style": "26",
  625. "5km Freestyle": "26",
  626. "Aerials": "27",
  627. "Alpine Combined": "25",
  628. "Big Air": "27",
  629. "City Event": "25",
  630. "Downhill": "25",
  631. "Dual Moguls": "27",
  632. "Giant Slalom": "25",
  633. "Gundersen Large Hill / 10km": "29",
  634. "Gundersen Normal Hill / 5km": "29",
  635. "Gundersen Normal Hill / 10km": "29",
  636. "Gundersen Normal Hill / 15km": "29",
  637. "Halfpipe": "75",
  638. "Individual - Large Hill": "28",
  639. "Individual - Normal Hill": "28",
  640. "Individual - Ski Flying": "28",
  641. "Moguls": "27",
  642. "Parallel Giant Slalom": "25",
  643. "Parallel Slalom": "25",
  644. "Pursuit": "26",
  645. "Ski Cross": "76",
  646. "Slalom": "25",
  647. "Slopestyle": "77",
  648. "Snowboard Cross": "64",
  649. "Snowboard Cross Team": "64",
  650. "Sprint Classic Style": "26",
  651. "Sprint Freestyle": "26",
  652. "Super G": "25",
  653. "Team - Large Hill": "28",
  654. "Team - Normal Hill": "28",
  655. "Team - Ski Flying": "28",
  656. "Team Normal Hill / 4 x 5km": "29",
  657. "Team Sprint Classic Style": "26",
  658. "Team Sprint Freestyle": "26",
  659. "Team Sprint Large Hill / 2 x 7.5km": "26",
  660. "10km Classic Style": "26",
  661. "4 x 10km Relay": "26",
  662. "Team": "25",
  663. },
  664. "34":{
  665. "Team": "201",
  666. },
  667. "36":{
  668. "10000m": "136",
  669. "1000m": "31",
  670. "1500m": "31",
  671. "3000m": "136",
  672. "3000m Relay": "136",
  673. "5000m": "136",
  674. "5000m Relay": "136",
  675. "500m": "31",
  676. "Mass Start 16 Laps": "136",
  677. "Overall": "31",
  678. "Small Combination": "135",
  679. "Sprint Combination": "135",
  680. "Team Pursuit 6 Laps": "31",
  681. "Team Pursuit 8 Laps": "31",
  682. },
  683. "121":{
  684. "Bouldering": "60g",
  685. "Combined": "59",
  686. "Lead": "59",
  687. "Speed": "58",
  688. },
  689. "141":{
  690. "Longboard": "79",
  691. "Shortboard": "79",
  692. "Team": "79",
  693. },
  694. "38":{
  695. "100m Backstroke": "84",
  696. "100m Backstroke SC": "84",
  697. "100m Breaststroke": "84",
  698. "100m Breaststroke SC": "84",
  699. "100m Butterfly": "84",
  700. "100m Butterfly SC": "84",
  701. "100m Freestyle": "84",
  702. "100m Freestyle SC": "84",
  703. "100m Individual Medley SC": "84",
  704. "10km": "87",
  705. "1500m Freestyle": "86",
  706. "1500m Freestyle SC": "86",
  707. "200m Backstroke": "85",
  708. "200m Backstroke SC": "85",
  709. "200m Breaststroke": "85",
  710. "200m Breaststroke SC": "85",
  711. "200m Butterfly": "85",
  712. "200m Butterfly SC": "85",
  713. "200m Freestyle": "85",
  714. "200m Freestyle SC": "85",
  715. "200m Individual Medley": "85",
  716. "200m Individual Medley SC": "85",
  717. "4 x 100m Freestyle Relay": "85",
  718. "4 x 100m Freestyle Relay SC": "85",
  719. "4 x 100m Medley Relay": "85",
  720. "4 x 100m Medley Relay SC": "85",
  721. "4 x 200m Freestyle Relay": "86",
  722. "4 x 200m Freestyle Relay SC": "86",
  723. "4 x 50m Freestyle Relay SC": "85",
  724. "4 x 50m Medley Relay SC": "85",
  725. "400m Freestyle": "85",
  726. "400m Freestyle SC": "85",
  727. "400m Individual Medley": "85",
  728. "400m Individual Medley SC": "85",
  729. "50m Backstroke": "84",
  730. "50m Backstroke SC": "84",
  731. "50m Breaststroke": "84",
  732. "50m Breaststroke SC": "84",
  733. "50m Butterfly": "84",
  734. "50m Butterfly SC": "84",
  735. "50m Freestyle": "84",
  736. "50m Freestyle SC": "84",
  737. "5km": "87",
  738. "800m Freestyle": " 86",
  739. "800m Freestyle SC": "86",
  740. },
  741. "39":{
  742. "Duet": "146",
  743. "Team": "146",
  744. "Team Free Routine": "146",
  745. "Team Technical Routine": "146",
  746. },
  747. "40":{
  748. "Doubles": "179",
  749. "Singles": "179",
  750. "Team": "179",
  751. },
  752. "43":{
  753. "Bantamweight 49-53kg": "139",
  754. "Bantamweight 58-63kg": "139",
  755. "Featherweight 53-57kg": "139",
  756. "Featherweight 63-68kg": "139",
  757. "Finweight -46kg": "139",
  758. "Finweight -54kg": "139",
  759. "Flyweight 46-49kg": "139",
  760. "Flyweight 54-58kg": "139",
  761. "Heavyweight +67kg": "139",
  762. "Heavyweight +73kg": "139",
  763. "Heavyweight +80kg": "139",
  764. "Heavyweight +87kg": "139",
  765. "Lightweight 57-62kg": "139",
  766. "Lightweight 68-74kg": "139",
  767. "Middleweight 67-73kg": "139",
  768. "Middleweight 80-87kg": "139",
  769. "Welterweight 57-67kg": "139",
  770. "Welterweight 62-67kg": "139",
  771. "Welterweight 68-80kg": "139",
  772. "Welterweight 74-80kg": "139",
  773. },
  774. "41":{
  775. "Team Handball": "202",
  776. "Team": "202",
  777. },
  778. "42":{
  779. "Doubles": "180",
  780. "Singles": "180",
  781. },
  782. "47":{
  783. "Olympic Distance": "80",
  784. "Sprint Distance": "80",
  785. },
  786. "48":{
  787. "Team": "42",
  788. },
  789. "51":{
  790. "+105kg": "224",
  791. "+105kg - Clean & Jerk": "224",
  792. "+105kg - Snatch": "224",
  793. "+75kg":"224",
  794. "+75kg Clean & Jerk":"224",
  795. "+75kg - Snatch": "224",
  796. "105kg": "224",
  797. "105kg - Clean & Jerk": "224",
  798. "105kg - Snatch": "224",
  799. "48kg": "224",
  800. "48kg - Clean & Jerk": "224",
  801. "48kg - Snatch": "224",
  802. "53kg": "224",
  803. "53kg - Clean & Jerk": "224",
  804. "53kg - Snatch": "224",
  805. "56kg": "224",
  806. "56kg - Clean & Jerk": "224",
  807. "56kg - Snatch": "224",
  808. "58kg": "224",
  809. "58kg - Clean & Jerk": "224",
  810. "58kg - Snatch": "224",
  811. "63kg": "224",
  812. "63kg - Clean & Jerk": "224",
  813. "63kg - Snatch": "224",
  814. "69kg": "224",
  815. "69kg - Clean & Jerk": "224",
  816. "69kg - Snatch": "224",
  817. "75kg": "224",
  818. "+75kg - Clean & Jerk": "224",
  819. "75kg - Clean & Jerk": "224",
  820. "75kg - Snatch": "224",
  821. "77kg": "224",
  822. "77kg - Clean & Jerk": "224",
  823. "77kg - Snatch": "224",
  824. "85kg": "224",
  825. "85kg - Clean & Jerk": "224",
  826. "85kg - Snatch": "224",
  827. "94kg": "224",
  828. "94kg - Clean & Jerk": "224",
  829. "94kg - Snatch": "224",
  830. },
  831. "52":{
  832. "125kg": "47",
  833. "130kg": "46",
  834. "48kg": "47",
  835. "53kg": "47",
  836. "57kg": "47",
  837. "58kg": "47",
  838. "59kg": "46",
  839. "63kg": "47",
  840. "65kg": "47",
  841. "66kg": "46",
  842. "69kg": "47",
  843. "74kg": "47",
  844. "75kg": "46",
  845. "85kg": "46",
  846. "86kg": "47",
  847. "97kg": "47",
  848. "98kg": "46",
  849. },
  850. "1":{
  851. "Compound Individual": "54",
  852. "Compound Team": "54",
  853. "Individual": "55",
  854. "Team": "55",
  855. },
  856. "3":{
  857. "Team": "149",
  858. },
  859. "4":{
  860. "Team": "150",
  861. },
  862. "35":{
  863. "Team": "177",
  864. },
  865. "49":{
  866. "Team": "147",
  867. },}
  868.  
  869. sport_name_change_df = pd.DataFrame(sport_dict).stack().to_frame("Renamed Discipline")
  870. out_df = athlete_list.merge(sport_dict_df, how = "left", left_on=["Discipline", "Sport"], right_index = True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement