Level of difficulty:
Objective: This workout will provide you practice in sub setting and filtering your data for analysis.
Note: this workout is entirely platform/tool independent. Feel free to use any tool you would like to perform this workout - SQL, DAX, Power Query, Python, R, Excel, Lotus 1-2-3 (just seeing if you’re paying attention…). Whatever tool you want to hone your skills on is fine - we hope to have a range of different tools utilized in this workout every week.
Link to the dataset: https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/02_Filtering_%26_Sorting/Euro12/Euro_2012_stats_TEAM.csv
Challenge Questions
- How many teams participated in the Euro2012?
- What is the number of columns in the dataset?
- View only the columns Team, Yellow Cards and Red Cards and assign them to a dataframe called discipline.
- Sort the teams by Red Cards, then to Yellow Cards.
- Calculate the mean Yellow Cards given per Team.
- Filter teams that scored more than 6 goals.
- Select the teams that start with the letter G.
- Select the first 7 columns.
- Select all columns except the last 3.
- Present only the Shooting Accuracy from England, Italy and Russia.
Submission
Simply post your code and a screenshot of your results.
Please format your code and blur it or place it in a hidden section.
This workout will be released on Tuesday April 4, 2023, and the author’s solution will be posted on Sunday April 9, 2023.