Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 4 new columns ({'blocked', 'total_attempts', 'off_target', 'on_target'}) and 4 missing columns ({'assists', 'dribbles', 'corner_taken', 'offsides'}).

This happened while the csv dataset builder was generating data using

hf://datasets/yanivohayon1/ucl-2021-22/attempts.csv (at revision 343fb7730058237e2f914c7eb205b43fc62127dc), [/tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/attacking.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/attacking.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/attempts.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/attempts.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/defending.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/defending.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/disciplinary.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/disciplinary.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/distributon.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/distributon.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/goalkeeping.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/goalkeeping.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/goals.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/goals.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/key_stats.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/key_stats.csv)]

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1893, in _prepare_split_single
                  writer.write_table(table)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 765, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 773, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2218, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              serial: int64
              player_name: string
              club: string
              position: string
              total_attempts: int64
              on_target: int64
              off_target: int64
              blocked: int64
              match_played: int64
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 1305
              to
              {'serial': Value('int64'), 'player_name': Value('string'), 'club': Value('string'), 'position': Value('string'), 'assists': Value('int64'), 'corner_taken': Value('int64'), 'offsides': Value('int64'), 'dribbles': Value('int64'), 'match_played': Value('int64')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 884, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 947, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1739, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1895, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 4 new columns ({'blocked', 'total_attempts', 'off_target', 'on_target'}) and 4 missing columns ({'assists', 'dribbles', 'corner_taken', 'offsides'}).
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/yanivohayon1/ucl-2021-22/attempts.csv (at revision 343fb7730058237e2f914c7eb205b43fc62127dc), [/tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/attacking.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/attacking.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/attempts.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/attempts.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/defending.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/defending.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/disciplinary.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/disciplinary.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/distributon.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/distributon.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/goalkeeping.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/goalkeeping.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/goals.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/goals.csv), /tmp/hf-datasets-cache/medium/datasets/22631546493182-config-parquet-and-info-yanivohayon1-ucl-2021-22-efcf5f0f/hub/datasets--yanivohayon1--ucl-2021-22/snapshots/343fb7730058237e2f914c7eb205b43fc62127dc/key_stats.csv (origin=hf://datasets/yanivohayon1/ucl-2021-22@343fb7730058237e2f914c7eb205b43fc62127dc/key_stats.csv)]
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

serial
int64
player_name
string
club
string
position
string
assists
int64
corner_taken
int64
offsides
int64
dribbles
int64
match_played
int64
1
Bruno Fernandes
Man. United
Midfielder
7
10
2
7
7
2
Vinícius Júnior
Real Madrid
Forward
6
3
4
83
13
2
Sané
Bayern
Midfielder
6
3
3
32
10
4
Antony
Ajax
Forward
5
3
4
28
7
5
Alexander-Arnold
Liverpool
Defender
4
36
0
9
9
5
De Bruyne
Man. City
Midfielder
4
18
0
14
10
5
Modrić
Real Madrid
Midfielder
4
10
0
8
13
5
João Mário
Benfica
Midfielder
4
8
0
7
8
5
Mbappé
Paris
Forward
4
4
8
43
8
5
Gerard Moreno
Villarreal
Forward
4
0
3
9
7
5
Capoue
Villarreal
Midfielder
4
0
0
17
12
12
Parejo
Villarreal
Midfielder
3
36
0
4
12
12
Grimaldo
Benfica
Defender
3
11
1
10
10
12
Müller
Bayern
Forward
3
10
8
2
10
12
Arnold
Wolfsburg
Midfielder
3
10
0
1
6
12
Angeliño
Leipzig
Defender
3
8
0
4
5
12
Coman
Bayern
Forward
3
4
4
59
9
12
Bernardo Silva
Man. City
Midfielder
3
2
3
18
11
12
Bellingham
Dortmund
Midfielder
3
1
1
24
6
12
Zapata
Atalanta
Forward
3
0
7
10
6
12
Lewandowski
Bayern
Forward
3
0
7
1
10
12
João Cancelo
Man. City
Defender
3
0
2
26
9
12
Cristiano
Sheriff
Defender
3
0
1
7
6
24
Mahrez
Man. City
Midfielder
2
30
5
28
12
24
Robertson
Liverpool
Defender
2
27
1
9
10
24
Ziyech
Chelsea
Midfielder
2
23
0
12
9
24
Gündoğan
Man. City
Midfielder
2
16
1
3
10
24
Tsimikas
Liverpool
Defender
2
16
0
4
5
24
Foden
Man. City
Midfielder
2
13
6
12
11
24
Pjanic
Beşiktaş
Midfielder
2
9
0
4
3
24
Forsberg
Leipzig
Forward
2
9
0
3
6
24
Bernardeschi
Juventus
Midfielder
2
7
1
7
5
24
Dahoud
Dortmund
Midfielder
2
7
1
3
4
24
Pedro Gonçalves
Sporting CP
Midfielder
2
7
0
10
5
24
Mount
Chelsea
Midfielder
2
7
0
6
7
24
Douglas Santos
Zenit
Defender
2
6
1
3
5
24
Rakitskyy
Zenit
Defender
2
6
0
4
6
24
Tadić
Ajax
Forward
2
5
5
13
7
24
Asensio
Real Madrid
Forward
2
5
0
1
8
24
Aaronson
Salzburg
Midfielder
2
4
5
9
8
24
Danjuma
Villarreal
Midfielder
2
3
8
31
11
24
Shaw
Man. United
Defender
2
3
1
1
5
24
Gnabry
Bayern
Forward
2
3
0
12
8
24
Griezmann
Atlético
Forward
2
2
1
8
9
24
Renan Lodi
Atlético
Defender
2
1
5
9
10
24
Rodrygo
Real Madrid
Forward
2
1
1
20
11
24
Hudson-Odoi
Chelsea
Midfielder
2
1
1
15
5
24
Jorginho
Chelsea
Midfielder
2
1
0
1
8
24
André Silva
Leipzig
Forward
2
0
9
5
6
24
Sterling
Man. City
Forward
2
0
6
14
12
24
Salah
Liverpool
Forward
2
0
5
49
13
24
Ikoné
LOSC
Midfielder
2
0
1
15
5
24
Werner
Chelsea
Forward
2
0
1
10
5
24
Jones
Liverpool
Midfielder
2
0
1
0
4
24
Matheus Nunes
Sporting CP
Midfielder
2
0
0
21
6
24
Davies
Bayern
Midfielder
2
0
0
18
7
24
Mazraoui
Ajax
Defender
2
0
0
13
8
24
Mendy
Real Madrid
Defender
2
0
0
8
10
24
Keïta
Liverpool
Midfielder
2
0
0
6
10
24
Henderson
Liverpool
Midfielder
2
0
0
2
12
24
Vidal
Inter
Midfielder
2
0
0
2
7
24
Ricardo Esgaio
Sporting CP
Defender
2
0
0
1
8
24
Fernandinho
Man. City
Midfielder
2
0
0
1
8
64
Seiwald
Salzburg
Midfielder
1
18
1
5
8
64
Berghuis
Ajax
Forward
1
15
2
3
8
64
Gravenberch
Ajax
Midfielder
1
15
1
18
8
64
Lang
Club Brugge
Forward
1
12
5
17
6
64
Aebischer
Young Boys
Midfielder
1
11
0
6
6
64
Tsygankov
Dynamo Kyiv
Midfielder
1
10
0
8
6
64
Oxlade-Chamberlain
Liverpool
Midfielder
1
9
0
6
6
64
S. Thill
Sheriff
Midfielder
1
9
0
1
6
64
Di María
Paris
Forward
1
8
1
3
5
64
Koopmeiners
Atalanta
Midfielder
1
8
0
1
5
64
Neymar
Paris
Forward
1
7
1
27
6
64
Lemar
Atlético
Midfielder
1
7
0
7
8
64
Rakitić
Sevilla
Midfielder
1
7
0
0
5
64
De Ketelaere
Club Brugge
Forward
1
6
10
6
6
64
Malcom
Zenit
Forward
1
6
2
12
6
64
Vormer
Club Brugge
Midfielder
1
6
1
0
4
64
Rieder
Young Boys
Midfielder
1
6
0
2
6
64
Reus
Dortmund
Midfielder
1
5
7
5
6
64
Alan Patrick
Shakhtar Donetsk
Midfielder
1
4
0
5
4
64
Koke
Atlético
Midfielder
1
4
0
2
9
64
Milner
Liverpool
Midfielder
1
4
0
1
8
64
Grealish
Man. City
Midfielder
1
3
6
18
7
64
T. Hernández
Milan
Defender
1
3
4
10
5
64
Benzema
Real Madrid
Forward
1
2
9
18
12
64
Iličić
Atalanta
Midfielder
1
2
2
13
4
64
Dybala
Juventus
Forward
1
2
0
8
5
64
Vanaken
Club Brugge
Midfielder
1
2
0
7
6
64
Bruno Tabata
Sporting CP
Midfielder
1
2
0
2
4
64
João Félix
Atlético
Forward
1
1
3
21
8
64
Taremi
Porto
Forward
1
1
2
4
6
64
Ocampos
Sevilla
Midfielder
1
1
1
16
6
64
Moumi Ngamaleu
Young Boys
Midfielder
1
1
0
34
6
64
Zinchenko
Man. City
Defender
1
1
0
3
8
64
Aurier
Villarreal
Defender
1
1
0
0
5
64
Mané
Liverpool
Midfielder
1
0
9
17
13
64
Paulinho
Sporting CP
Forward
1
0
5
8
8
64
Diogo Jota
Liverpool
Forward
1
0
4
19
11
End of preview.

UCL 2021/22 — UEFA Champions League Player Statistics

Dataset Overview

This dataset contains player statistics from the 2021/22 UEFA Champions League season. It consists of 8 CSV files covering different aspects of player performance, with a total of 3,524 rows across all files. After merging all files, the working dataset contains 751 unique players across 44 columns.

Source: Kaggle — UCL Matches & Players Data 2021/22

Target Variable: position — Forward / Midfielder / Defender / Goalkeeper


Main Research Goal

The main goal of this project is to understand what makes a player statistically unique based on their position, and how positional roles influence attacking performance, disciplinary behavior, and overall goal contributions in the 2021/22 UEFA Champions League season.


Feature Selection

The dataset consists of 8 separate files, each covering a different aspect of player performance. The key features used in this analysis are:

Attacking: goals, assists, shot attempts, shots on target

Defending: tackles, clearances, blocks, interceptions

Disciplinary: yellow cards, red cards, fouls committed

Distribution: passes, pass accuracy

Goalkeeping: saves, clean sheets, goals conceded

Key Stats: minutes played, matches played, position, club


Files

File Description
attacking.csv Goals, assists, shot attempts
attempts.csv Shot attempts breakdown
defending.csv Tackles, clearances, blocks
disciplinary.csv Yellow cards, red cards, fouls
distributon.csv Passes, pass accuracy
goalkeeping.csv Saves, clean sheets
goals.csv Goal details
key_stats.csv General player stats
notebook_1 (1).ipynb Full EDA Notebook

Data Cleaning & Decision Making

Step 1 — Merging: I merged all 8 CSV files into one Master DataFrame using player_name, club, and position as keys. The result was 751 unique players × 44 columns.

Step 2 — Missing Values: I found that goalkeeping columns (saved, cleansheets, etc.) had 92.9% missing values — this is expected since only 53 out of 751 players are goalkeepers. I filled those with 0 for non-goalkeepers, and all other numeric columns were filled with the median per position. Final result: 0 missing values.

Step 3 — Duplicates: No duplicate rows were found.

Step 4 — Scaling & Normalization: I checked the range of each key column and found that columns exist on very different scales (e.g. minutes_played up to 1,230 vs goals up to 15). I chose not to apply normalization at this stage since I am performing EDA only and not building an ML model. The original scales are clear and interpretable as-is.

Step 5 — Outlier Detection: I used the IQR method to detect outliers and visualized them using Box Plots. I found 183 outliers in goals and 176 in assists. I decided to keep all outliers because they represent genuine elite performers like Benzema with 15 goals — not data errors.


Research Questions & Visual Insights

Question 1: What is the unique statistical profile of each position?

Q1

Forwards dominate all attacking statistics with an average of 1.23 goals per player. Goalkeepers play the most minutes (418 on average). Each position has a clearly distinct statistical profile that reflects its role on the pitch.


Question 2: Do more shot attempts lead to more goals, or does accuracy matter more?

Q2

Shots on target correlate more strongly with goals (r=0.85) than total attempts (r=0.75). This confirms that accuracy matters more than quantity — a player who shoots less but more accurately scores more goals.


Question 3: Does a player's position affect the number of fouls committed?

Q3

Midfielders commit the most fouls, but defenders receive the most yellow cards (0.065 average). This suggests that defensive positioning leads to more consequential fouls than midfield ones.


Question 4: Which club was the most efficient — most goals per shot attempt?

Q4

Villarreal was the most efficient club, converting 15% of their shots into goals. Surprisingly, big clubs like Real Madrid and Bayern did not top the list — efficiency is not always about having the best players.


Question 5: Do clubs with more assists necessarily score more goals?

Q5

Yes — there is a near-perfect correlation of r=0.98 between assists and goals at the club level. Teamwork is the key to attacking success in the UCL.


Question 6: Does a player's position affect their goal contributions (goals + assists)?

Q6

Forwards and midfielders together account for 84% of all goal contributions (42.5% and 41.3% respectively). Goalkeepers contribute only 0.2% — exactly as expected.


Key Findings Summary

  • Forwards average 1.23 goals per player — significantly more than any other position
  • Shot accuracy (r=0.85) predicts goals better than total attempts (r=0.75)
  • Defenders receive the most yellow cards despite midfielders committing more fouls
  • Villarreal was the most efficient club, converting 15% of shots into goals
  • Assists and goals have a near-perfect correlation (r=0.98) — teamwork is key
  • Forwards and midfielders account for 84% of all goal contributions

Final Conclusion

The EDA process successfully told the story of UCL 2021/22 player performance. The analysis revealed that position is the strongest predictor of a player's statistical profile — forwards and midfielders dominate goal contributions, while defenders and goalkeepers play a completely different role. Efficiency matters more than volume — Villarreal proved that converting chances well is more important than creating many of them. Finally, teamwork is the true engine of attacking success, as clubs with more assists almost always score more goals.


Challenges & Lessons Learned

Challenges: I was on military reserve duty during semester A and did not study Python properly. My main challenge was learning how to write code correctly before and during the project, with the help of Claude AI. Additionally, merging 8 files with different columns caused recurring errors that took time to resolve.

Lessons Learned: At the beginning I did not work in an organized and structured way, which made things increasingly difficult as I progressed — to the point where I had to start over. The most important lesson I learned: working in an organized and structured way, step by step, is the foundation of success.


📂 Project Files & Deliverables

File Description Link
attacking.csv Attacking stats View File
attempts.csv Shot attempts View File
defending.csv Defensive stats View File
disciplinary.csv Cards & fouls View File
distributon.csv Pass stats View File
goalkeeping.csv Goalkeeper stats View File
goals.csv Goal details View File
key_stats.csv General stats View File
notebook_1 (1).ipynb Full EDA Notebook View Notebook
Downloads last month
39