Тёмный
No video :(

Loading in and investigating World Cup data in Python 

Friends of Tracking
Подписаться 23 тыс.
Просмотров 19 тыс.
50% 1

Second lecture in our series on Soccermatics in Python. David Sumpter looks at how to load in manipulate football data (json files) in to Python.
Learning goals for this video are:
1, Downloading code
2, Downloading data
3, Organising working folder
4, Loading in data
5, What is a json file?
6, Using ‘for’ loops
7, Using ‘if’ statements
8, Identifying specific matches in Statsbomb data
The code you need for todays lecture is available in
github.com/Fri...

Опубликовано:

 

24 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 46   
@allenqueen
@allenqueen 2 года назад
Loved that some exercises were included into the comments. Doing them gives a much much better understanding of the topic discussed. Sets up the learners to start thinking of problem statements on their own.
4 года назад
When we are getting data from an API error handling is a must. Because sometimes the API will send corrupt data and when you slice the dictionary without error handling the code will break at some point. At least that's my experience. So in addition to this nice material (after becoming a bit more comfortable), you might want to search google for the solution of such a situation. I am not even talking about the team names coming with different names :) Man. Unt, Manchester U., ManU, Man. United... Things can get ugly real fast, fuzzy-wuzzy...
@dukedevil117
@dukedevil117 3 года назад
This is a lifesaver. Best Python tutorial I've ever done
@rightplant7137
@rightplant7137 4 года назад
Brilliant, thanks for making this! I'll be following along with your videos to help me with my masters studies
@xavierbaltazar2453
@xavierbaltazar2453 4 года назад
The match ID for the Men's World Cup match of England v Sweden should be 8651. Also, it should be Sweden as the HOME team and England as the AWAY team. The video is incorrect according to the JSON files provided. His IDE likely returned the old value since he runs portions of his code at a time rather than the whole script. So because it failed to find the Sweden v England match, it spit out the old value of the Argentina v Scotland match.
@amitg2476
@amitg2476 4 года назад
yeah exactly, getting the same result, if teams are interchanged older id is getting stored
@BigDataSport
@BigDataSport 4 года назад
%% Select match home_team_required ="Sweden" away_team_required ="England" # %% Sweden vs England has id:8651 MAN
@joseangelmartinez308
@joseangelmartinez308 4 года назад
Many many thanks for this kind of content. Really highly appreciated :)
@Kwin4u
@Kwin4u 4 года назад
Guys, If you are facing an error called "name 'match_id_required' is not defined". Please make this change to the code: #Now let's find a match we are interested in home_team_required ="United States Women's" away_team_required ="Netherlands Women's" This will fix the issue. The problem was that, there isn't a team called Sweden or England under competition id 72. Happy Learning!!!!
@jschvach
@jschvach 4 года назад
or better yet, to make robust and not dependant on Mens or Womens: adjust lines 29,30 home_team_name=match['home_team']['country']['name'] away_team_name=match['away_team']['country']['name']
@royarru
@royarru 4 года назад
Thanks a lot
@jschvach
@jschvach 4 года назад
There's a few flaws with this code. 1) a variable to store the competition_id, which is then input into the path to a filename which is not static. Why hard code a dynamic changing filename in relation to the competition id? 2) the home/away team names' include "Women's" in the women's competitions. Just simply pull the country name, or don't look for exact match, but rather if home_team_required" in home_team_name
@amarakbar2374
@amarakbar2374 4 года назад
Thank you for these videos
@bobbobker3911
@bobbobker3911 4 года назад
Why can`t I put files into the Statsbomb folder that I got from the Friends of tracking git? I use Windows 10
@jorrithoekstra7326
@jorrithoekstra7326 4 года назад
Hi, when I load in the data in Spyder and try to get an output through variable explorer I only get one match? The score of all the matches is in my control panel but can't select it like the video does. Is there any way I can move this from the control panel to the variable explorer ?
@sarabentelli6632
@sarabentelli6632 3 года назад
Thanks a lot
@dabody123456
@dabody123456 3 года назад
like here to keeping learning
@berndmeno9771
@berndmeno9771 3 года назад
thank you so much!!
@xXB0WLESYHDXx
@xXB0WLESYHDXx 4 года назад
Great vid! But when I run the file it comes with a name error ‘“match_id_required’ is not defined”
@friendsoftracking755
@friendsoftracking755 4 года назад
I think there was a problem. It should be fixed. If not it is explained what you need to do in the video.
@MrJaymes1973
@MrJaymes1973 4 года назад
Getting the same error, can't figure out why?! Anyone figured this out yet?
@miszadukla
@miszadukla 4 года назад
I had the same problem and was able to find a solution. So if you are looking for match id within Women`s cup remember to use for example "England Women's" and not "England Women`s" there are 2 different aposthrophies not sure if they have different names. Also remember to set the right competition ID. If you would like to look within mens world cup, remember to change the json file from 30 to 3, it`s explained on the video. But this aposthrophe shit got me crazy for a moment:p
@Zigabyte97
@Zigabyte97 4 года назад
@UC4nkw_be96JnRNLxhx3252g change home_team_required and away_team_required to "England Women's" and "Sweden Women's" and it should work
@hervesimons9610
@hervesimons9610 4 года назад
@@friendsoftracking755 Sorry but I've got the same problem with the exercise but not with the explanations (with Sweden Women's). I don't understand what it goes with the second and not with the first. Thanks
@pablovelazquez986
@pablovelazquez986 4 года назад
Hi guys,I have a problem FileNotFoundError: [Errno 2] No such file or directory: 'Statsbomb/data/competitions.json' but i check and i have all the files, i don´t know what to do, Im a begginer and I dont see my mistake
@bweavuh
@bweavuh 4 года назад
I am having exactly the same problem. Can't figure it out and am also a beginner
@pablovelazquez986
@pablovelazquez986 4 года назад
@@bweavuh hi, I already solve it, it was just a extra folder, so the program didn't find it, but check your folders, if you have problems maybe I can help
@Buendia41st
@Buendia41st 3 года назад
@@pablovelazquez986 hi, how did you solve it? did you delete any folder? or like, where did you move the file?
@pablovelazquez986
@pablovelazquez986 3 года назад
@@Buendia41st I just checked all the folders one by one and saw that one has two entrys so I erased one. Its easier that it sounds, but if you have any problem tell me and maybe I can help with a other social media I already finished this and the course of soccermatics
@akshayprakash7312
@akshayprakash7312 3 года назад
@@pablovelazquez986 Hello Diario. I'm having the same problem but can't figure how to solve it. Can you help me?
@muhammadfaisal6052
@muhammadfaisal6052 4 года назад
FileNotFoundError: [Errno 2] No such file or directory: 'Statsbomb/data/competitions.json' when i try to load competition.json i cant fix this problem
@DJ9874023978
@DJ9874023978 4 года назад
you can solve this issue by using the absolute pathname of the file.
@johanlindqvist4106
@johanlindqvist4106 4 года назад
Hi muhammad. As devrup indicates, your issue lies within the path. SOLUTION 1: The path "statsbomb/data/competions.json" is a relative path, i.e. the path from where you are "located now". You should make sure that you are "located" in the right working directory. >> right click the filename tab ("1LoadData.py") and click "set console working directory". This way, your console will be working from the location of the 1LoadData.py file. And from that directory you should be able to access the path "/statsbomb/data/competions.json" SOLUTION 2: Change the "statsbomb/data/competitions.json" relative path to the full path of the file, typically starting from "C:". something like "C:\Users ame\folder\Mathematical modelling of football\SoccermaticsForPython-master\Statsbomb\data
@ANDERHR-sd4bs
@ANDERHR-sd4bs Год назад
@@johanlindqvist4106 ❤
@josecondori6391
@josecondori6391 3 года назад
you should use a microphone. only saying. thanks
Далее
Making Your Own Shot and Pass Maps
20:00
Просмотров 21 тыс.
Setting Up to do Data Science
19:51
Просмотров 20 тыс.
Cute kitty gadgets 💛
00:24
Просмотров 2,7 млн
Data Analytics in Soccer | Chalk Talk | 09.03.17
23:06
25 Nooby Pandas Coding Mistakes You Should NEVER make.
11:30
R vs Python
7:07
Просмотров 319 тыс.
Statsbomb 360 Data Intro in Python
33:24
Просмотров 11 тыс.
Audio Data Processing in Python
19:52
Просмотров 156 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 948 тыс.
Paul Power: neural networks for understanding defending
1:46:36