I have very, very basic experience with Python, but I adore football and am at that point in my career where I am seeking change. I'm 32 years old so hopefully not too old to learn and to be able to one day land a job in football data analytics! This video really was great and made me very excited to learn python.
I’m a sports data analyst for Second Spectrum. I’m trying my best to work my way up and make this a career, I keep hearing this word “python” in job listings for the NBA and that’s what lead me to this video!
@@chrisgill_UK Hey Chris! Thanks for the kind words. I checked out your channel, love the branding you’ve done, how long have you been a Sports Analyst for?
@@mooreideas In-Play Sports. We offer online video analysis software (In-Play Online) as well as sports filming and analysis... its linked on my channel 👍
thanks much for this analysis: but my very concern and desire is that i want to design a program that will fetch a particular or current seasons games, match played (Mp), goals scored, goals conceded for both home (Hm) and away(Aw) teams, each of which should automatically run in a respective input unit for further analysis. the input units looks like this; #TeamA Hm = str(input('Home: ')) Mpa = int(input('enter Mp:')) HXa = int(input('Scored: ')) HXb = int(input('Conceded: ')) #TeamB Aw = str(input('Away: ')) Mpb = int(input('enter Mp:')) AYa = int(input('Scored: ')) AYb = int(input('Conceded: ')) #How can you go about helping me please?
First, thanks a lot, Laurie Shaw. If anyone would like to know event frequencies per period (First Period or Second Period), I would like to contribute (using groupy): home_shots.groupby('Period')['Subtype'].value_counts() away_shots.groupby('Period')['Subtype'].value_counts()
Can someone help? Tutorial excellent and I've created pass maps etc. I'm trying to work out how I can plot 2 pitches side by side showing passes for 2 different players on the 2 pitches. I'm looking at subplots (is this the correct way of doing it?). I can get the 2 pitches but not in 1 figure. Any help or pointers, much appreciated. Thanks.
This is amazing, i want to learn more about it, never coded in my life, would this work with the videos of my kids soccer U13 games? I've been looking for something to track data like this to help the coaches with the team to preform better. Thank you again.
Hello People, I am very new to Python. Need some help. When I am trying to compile the modules Metrica_IO and Metrica_Viz I am getting an error "ModuleNotFoundError: No module named ". I have downloaded all the codes in the same working folder. Is there anything I am missing?
Hi Debapam, this confused me too and as I have replied to Alex earlier, I said I'd let you know so you didn't remain stuck. You need to download the GitHub files with Metrica_IO.py etc... The __init__.py file contains what is needed to recognise the import metric_IO part as a package. Let me know if you need any further help.
@@gonzalovarela2016 hey Gonzalo, you have to create the file yourself. It's just a file called __init__.py and it should have these two lines in it (and nothing else): import Metrico_IO as mio import Metrica_Viz as mviz It has to be in the same folder as the python files you're working on. Any other problems, let me know and I'll walk you through it.
@@robbiedunne8170 i tried creating the file and have added both the lines. Still for some reason it shows No module named Error. Any help would be appreciated. Thanks
Very new user to python here, but my locations appear inverted to what you have. For example the shot is taken from the same location but from the post nearest the bottom of the screen. Also how do I get the pitch object to pop out in a separate window, mine just appears in the python console? TIA
The figure placement is a preference you need to set. Tools -> Preferences -> IPython control -> Graphics -> Graphics -> Change Graphics backend to 'Automatic'.
@@stevengallagher360 This issue is related to that no at Metric_IO.py? At that code, the variable data[y_columns] is multiplied by -1. Originally (in green not), this variable was not multiplied by -1. Is that why the points were inverted in relation to y coordinates?
I seem to get an error when making the tiny amendment to the code to plot the passes leading up to the second goal : Code: # plot passing move in run up to goal mviz.plot_events( events.loc[1109:1118], indicators = ['Marker','Arrow'], annotate=True ) Error: File "C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\patches.py", line 3219, in ensure_quadratic_bezier "'path' is not a valid quadratic Bezier curve") ValueError: 'path' is not a valid quadratic Bezier curve The default code runs fine for the first goal. I am also able to plot the second goal itself, just not the passes leading up to it. Has anyone else had this problem? Many thanks !
Yep I got this problem with the third goal. What you need to do is plot from the first pass before the goal until the shot. If you try include things like Interception or ball Recovery, it just won't plot.
Heloo i try to learn but i got some problem when inputing this code events = pd.read_csv('{}/{}'.format(DATADIR, eventfile)) # read data The result said filenotfounderror iam pretty sure placed the data in the right folder can you help me thank you
@@muhammadfaisal6052 i'm not sure to get what's your problem, but I would say that you did not change the line of the variable DATADIR so the program can't find the folder. Check where is the folder located in your computer (could be on your disk C:// or D:// etc) and change the original path in your the code
For the 2nd question; i couldnt find the solution on how to do it on 1 figure. I can seperate the events of goal from the other shots and do necessary changes but can not display on them in 1 figure. It would be nice if you can give the solutions as well :) Thank you for the video!
when I try to change the coordinate system and import metric_IO I get the error message ModuleNotFound: no module named ‘Metrica_IO’ can anyone advise on what I’m doing wrong ?
I believe you need to import the module into your working directory for whichever version of Python your using e.g. using pip installer. You can find details here - docs.python.org/2/tutorial/modules.html#packages
Alex, this confused me too and I figured I'd reply to let you know how I figured it out. You need to download the GitHub files with Metrica_IO.py etc... The __init__.py file contains what is needed to recognise the import metric_IO part as a package. Let me know if you need any further help.
I had the same issue. The most simple workaround is to just copy and paste the functions from the metrica_IO and metrica_viz py files and run them in the console. Then when you copy and paste code from the main py file, just drop the mio. and mviz from the code lines.
I find this absolutely fascinating and would love to try and apply this to other games such as Warhammer 40k. My question is how is the data set collected initially. That would be the first step in being able to do any kind of visual analysis of Wh40K players who play professionally.
This is the first time I'm using Spyder but it seems to combine the features of Jupyter and more traditional IDEs. You can write and execute entire scripts in one panel while running individual lines in another. Pretty cool!