How to Make Graphs Like The Athletic in Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ก.ย. 2024
  • The Complete Football Analytics in Python Course:
    mckay-s-site.t...
    use code youtube for 25% off :)
    My Newsletter teaching sports analytics:
    mckayjohns.sub...
    GitHub Code:
    github.com/mck...

ความคิดเห็น • 45

  • @syscrusher
    @syscrusher 19 วันที่ผ่านมา +7

    Re the average distance, soccer pitches in the UK vary quite a bit. You could use the home team column to reference data for actual length per pitch.

    • @McKayJohns
      @McKayJohns  16 วันที่ผ่านมา +3

      Yeah I went pretty basic here, you could go get the pitch lengths for every shot and get a more accurate calculation for sure. Would have probably extended the tutorial by 30 min tho haha

  • @user-po3vd7jq6l
    @user-po3vd7jq6l 20 วันที่ผ่านมา +7

    Guys, I would also recommend McKey courses. Very useful.

    • @vardhan254
      @vardhan254 20 วันที่ผ่านมา +1

      is he mckay’s evil more intelligent twin

    • @-BarathKumarS
      @-BarathKumarS 15 วันที่ผ่านมา +1

      bot

  • @tsaminamina_eheh
    @tsaminamina_eheh 20 วันที่ผ่านมา +2

    Dope! Real challenge is to do it in Plotly to add another dimension of interactivity!!

  • @Waldroid
    @Waldroid 16 วันที่ผ่านมา

    Thanks for this! Kept me engaged throughout the whole video

    • @McKayJohns
      @McKayJohns  16 วันที่ผ่านมา

      Glad you enjoyed!

  • @bollin0802
    @bollin0802 20 วันที่ผ่านมา

    Very informative! Thanks

  • @prathmesh5405
    @prathmesh5405 15 วันที่ผ่านมา

    Bro , thats super stuff...

  • @genretypebeats4612
    @genretypebeats4612 11 วันที่ผ่านมา

    Hi mCkay.. Honestly your videos are awesome

    • @McKayJohns
      @McKayJohns  11 วันที่ผ่านมา

      Thank you!

  • @Carlos-wv4zk
    @Carlos-wv4zk 15 วันที่ผ่านมา

    Good video! What monitor are you using? I noticed the frame rate is so smooth when you move your mouse

    • @McKayJohns
      @McKayJohns  15 วันที่ผ่านมา

      It's actually just my macbook screen haha and I'm just doing a screen recording

  • @NihumDe
    @NihumDe 12 วันที่ผ่านมา

    thanks for the tut!
    does fbref have info on shot location for players?

    • @McKayJohns
      @McKayJohns  11 วันที่ผ่านมา

      No but sites like sofascore, fotmob, and whoscored all do

  • @MohamedIdris-xt7mz
    @MohamedIdris-xt7mz 12 วันที่ผ่านมา

    Cool Vid!, what website was the haaland stats used in this video scraped from?

    • @McKayJohns
      @McKayJohns  11 วันที่ผ่านมา

      Understat 👍

  • @tomkmb4120
    @tomkmb4120 20 วันที่ผ่านมา

    Great video man - how were you able to get a full season set of data for a single player from understat? I'm not familiar with that site so just exploring it now but can only see game by game entries - is that information behind a paywall or do you compile it yourself from some sort of scraping protocol?

    • @McKayJohns
      @McKayJohns  20 วันที่ผ่านมา +3

      I used a Python package called Understat to scrape it. You could also loop over all matches and extract all of the shots that way

    • @tomkmb4120
      @tomkmb4120 20 วันที่ผ่านมา

      @@McKayJohns ah cool thanks for confirming - do you have a video on that package/process?

  • @amineberouaken
    @amineberouaken 16 วันที่ผ่านมา +3

    Good video, but instead of calling the scatter function 5 times to plot the legend, you can call it just one time as follow:
    x_legend = np.linspace(start=0.37, stop=.6, num=5)
    y_legend = np.asarray([.53]*5)
    sizes = np.linspace(start=100, stop=500, num=5)
    ax1.scatter(x=x_legend,
    y=y_legend,
    s=sizes)

    • @McKayJohns
      @McKayJohns  15 วันที่ผ่านมา +1

      Yes that’s a good solution. For simplicity I ended up doing what I did

  • @The_notorious_8
    @The_notorious_8 15 วันที่ผ่านมา

    Thank you very much mate, but I have a problem with "df" is not defined

    • @McKayJohns
      @McKayJohns  14 วันที่ผ่านมา

      Hm usually that means the code wasn’t ran did you run the line to import the data?

  • @anshmehrotraxi-a7207
    @anshmehrotraxi-a7207 14 วันที่ผ่านมา

    I wanna get into cricket analytics would web scrapping cource pf yours would be helpful???? Or of football course

    • @McKayJohns
      @McKayJohns  13 วันที่ผ่านมา

      The web scraping course is great for learning how to build a web scraping pipeline while the football course focuses more on teaching Python and Football analytics

  • @IntrovertedCoder
    @IntrovertedCoder 14 วันที่ผ่านมา

    Hi! Is there any PPP available on your course?

    • @McKayJohns
      @McKayJohns  14 วันที่ผ่านมา

      If you send me an email: mckayjohns@gmail.com we can work something out :)

  • @bhavinho
    @bhavinho 16 วันที่ผ่านมา

    Is it possible to do this with data from the new season?

    • @McKayJohns
      @McKayJohns  16 วันที่ผ่านมา

      Yes I would just label it as shots through whatever match week you’re on

  • @samthomas2056
    @samthomas2056 13 วันที่ผ่านมา

    hi, does fbref have shot location data that i can use to create this chart? if not, where can i get data easily from

    • @samthomas2056
      @samthomas2056 13 วันที่ผ่านมา

      the player played in the mls last season

    • @McKayJohns
      @McKayJohns  12 วันที่ผ่านมา

      I got this data from Understat you can also use sofascore

  • @DarekVinogradov
    @DarekVinogradov 16 วันที่ผ่านมา

    how would i export it into a png file?

    • @McKayJohns
      @McKayJohns  16 วันที่ผ่านมา

      In the GitHub code there is a line of code at the very bottom that shows how to do it

  • @anshmehrotraxi-a7207
    @anshmehrotraxi-a7207 15 วันที่ผ่านมา

    Bro would we learn web scraping in football cource of yours???

    • @McKayJohns
      @McKayJohns  15 วันที่ผ่านมา

      You'll learn how to scrape specific sites like fotmob, sofascore and fbref!

    • @anshmehrotraxi-a7207
      @anshmehrotraxi-a7207 14 วันที่ผ่านมา

      So what's the other add on things that we will learn in your cource of web scrapping????​@@McKayJohns

  • @gabriel1991
    @gabriel1991 20 วันที่ผ่านมา

    Is there any way to get this data from other website than understat? I want to the same plot for other player that is not there.

    • @McKayJohns
      @McKayJohns  20 วันที่ผ่านมา +1

      You can scrape from other sites like sofascore or fotmob 👍

    • @exmidland
      @exmidland 20 วันที่ผ่านมา

      ​@@McKayJohns course has a method that taught me to get data from Fotmob, it's very well explained. I think the x,y data on Fotmob is based differently though as some x values are greater than 100, unless I'm picking up an incorrect data item.

  • @remy7663
    @remy7663 12 วันที่ผ่านมา

    Your cose is so damn expensive bruh I'm just a college student wanting to learn more abt football data analytics.