Filtering
Once you have your data loaded into a plays dataframe, you can perform various filtering operations to focus on specific skills. This section covers techniques for filtering skills such as reception, serve, attack, set, dig, block, and more.
Python - Filtering for attacks
Code from datavolley import read_dv
import pandas as pd
from IPython.display import Markdown
dv_instance = read_dv.DataVolley(None ) # Replace `None` with path of your dvw file
df = dv_instance.get_plays()
atks = df[df['skill' ] == 'Attack' ]
atks = atks.head(5 )
Markdown(atks.to_markdown(index = False ))
153e954d-9e22-4f6f-a24b-844611174156
1
499
a10AT-X546CH2 00F
University of Dayton
10
Jamie Peterson
-11802
Attack
-
6
X5
nan
nan
4
6
C
2
1
0
1
6
00F
19
9
11
15
10
7
1
16
17
10
6
8
4512
5522
8150
Reception
Reception
0.55625
3.12963
0.9312499999999999
3.8703700000000008
1.98125
5.79629
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Louisville
University of Dayton
1
1
153e954d-9e22-4f6f-a24b-844611174156
1
504
*09AH#V541BH2 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
1
V5
nan
nan
4
1
B
2
1
0
1
6
00F
19
9
11
15
10
7
1
16
17
10
6
8
4316
5517
7918
Serve
BP-Transition
0.70625
2.98148
0.7437500000000001
3.8703700000000008
0.78125
5.64815
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Louisville
University of Dayton
1
2
153e954d-9e22-4f6f-a24b-844611174156
1
550
a16AQ=X131AH1 -2F
University of Dayton
16
Olivia Dubay
14555
Attack
=
6
X1
nan
nan
3
1
A
1
3
0
1
6
-2F
19
9
11
15
10
7
1
16
17
10
6
8
4444
8913
Reception
Reception
1.75625
3.05556
0.59375
6.38889
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Louisville
University of Dayton
3
1
153e954d-9e22-4f6f-a24b-844611174156
1
605
a10AT#X545BH4 -5F
University of Dayton
10
Jamie Peterson
-11802
Attack
#
6
X5
nan
nan
4
5
B
4
5
1
1
6
-5F
19
9
11
15
10
7
1
16
17
10
6
8
4513
8469
Reception
Reception
0.59375
3.12963
2.69375
6.01852
1
University of Louisville
University of Dayton
17
42
University of Dayton
University of Louisville
University of Dayton
6
1
153e954d-9e22-4f6f-a24b-844611174156
1
628
*09AT+X546CH2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
+
1
X5
nan
nan
4
6
C
2
6
1
1
5
+4F
19
9
11
15
10
7
16
17
10
6
8
1
4210
5525
7851
Reception
Reception
0.48125
2.90741
1.04375
3.8703700000000008
2.01875
5.57407
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
7
1
Python - Filtering for attacks by player
Code atks = df[(df['skill' ] == 'Attack' ) & (df['player_name' ] == 'Claire Chaussee' )]
atks = atks.head(5 )
Markdown(atks.to_markdown(index = False ))
153e954d-9e22-4f6f-a24b-844611174156
1
504
*09AH#V541BH2 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
1
V5
nan
nan
4
1
B
2
1
0
1
6
00F
19
9
11
15
10
7
1
16
17
10
6
8
4316
5517
7918
Serve
BP-Transition
0.70625
2.98148
0.7437500000000001
3.8703700000000008
0.78125
5.64815
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Louisville
University of Dayton
1
2
153e954d-9e22-4f6f-a24b-844611174156
1
628
*09AT+X546CH2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
+
1
X5
nan
nan
4
6
C
2
6
1
1
5
+4F
19
9
11
15
10
7
16
17
10
6
8
1
4210
5525
7851
Reception
Reception
0.48125
2.90741
1.04375
3.8703700000000008
2.01875
5.57407
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
7
1
153e954d-9e22-4f6f-a24b-844611174156
1
631
*09AT#X549DT2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
1
X5
nan
nan
4
9
D
2
6
1
1
5
+4F
19
9
11
15
10
7
16
17
10
6
8
1
4414
7024
Reception
SO-Transition
0.63125
3.05556
1.00625
4.98148
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
7
2
153e954d-9e22-4f6f-a24b-844611174156
1
956
*09AH-V549DP2 +5F
University of Louisville
9
Claire Chaussee
-225496
Attack
-
3
V5
nan
nan
4
9
D
2
10
6
3
2
+5F
10
7
25
9
11
12
6
8
5
16
3
10
4022
7426
Serve
BP-Transition
0.93125
2.75926
1.08125
5.27778
1
University of Louisville
University of Dayton
17
42
University of Dayton
University of Louisville
University of Dayton
16
4
153e954d-9e22-4f6f-a24b-844611174156
1
989
*09AH+V541CT2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
+
3
V5
nan
nan
4
1
C
2
11
6
3
1
+4F
10
7
25
9
11
12
7
5
16
17
10
6
4426
5529
8036
Reception
Reception
1.08125
3.05556
1.19375
3.8703700000000008
1.45625
5.72222
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
17
1
R - Filtering for attacks
Code
a9e6117d72bb9cf6065ceb32112aa955
0
NA
1
499
a10AT-X546CH2 00F
University of Dayton
10
Jamie Peterson
-11802
Attack
Head ball attack
-
Poor, easily dug
X5
Go
NA
NA
NA
4
6
C
NA
Hard spike
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
1
0
1
6
00F
126
19
9
11
15
10
7
1
16
17
10
6
8
4512
5522
8150
NA
NA
0.55625
3.129630
0.93125
3.87037
1.98125
5.796296
-296094
-225496
-278838
-224838
-75967
-224837
-231069
14555
-11804
-11802
-230139
-232525
1
3
University of Louisville
University of Dayton
17
42
42
University of Louisville
FALSE
University of Louisville
Reception
0
0
a9e6117d72bb9cf6065ceb32112aa955
0
NA
1
504
*09AH#V541BH2 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
High ball attack
#
Winning attack
V5
Hut
NA
NA
NA
4
1
B
NA
Hard spike
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
1
0
1
6
00F
130
19
9
11
15
10
7
1
16
17
10
6
8
4316
5517
7918
NA
NA
0.70625
2.981482
0.74375
3.87037
0.78125
5.648148
-296094
-225496
-278838
-224838
-75967
-224837
-231069
14555
-11804
-11802
-230139
-232525
1
4
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Louisville
Transition
0
0
a9e6117d72bb9cf6065ceb32112aa955
2
NA
1
550
a16AQ=X131AH1 -2F
University of Dayton
16
Olivia Dubay
14555
Attack
Quick ball attack
=
Error
X1
Quick in front (4)
NA
NA
NA
3
1
A
NA
Hard spike
1 player block
1
NA
FALSE
FALSE
FALSE
FALSE
3
0
1
6
-2F
147
19
9
11
15
10
7
1
16
17
10
6
8
4444
NA
8913
NA
NA
1.75625
3.055556
NA
NA
0.59375
6.388889
-296094
-225496
-278838
-224838
-75967
-224837
-231069
14555
-11804
-11802
-230139
-232525
1
15
University of Louisville
University of Dayton
17
42
42
University of Louisville
FALSE
University of Louisville
Reception
2
0
a9e6117d72bb9cf6065ceb32112aa955
5
NA
1
605
a10AT#X545BH4 -5F
University of Dayton
10
Jamie Peterson
-11802
Attack
Head ball attack
#
Winning attack
X5
Go
NA
NA
NA
4
5
B
NA
Hard spike
Hole block
4
NA
FALSE
FALSE
FALSE
FALSE
5
1
1
6
-5F
170
19
9
11
15
10
7
1
16
17
10
6
8
4513
NA
8469
NA
NA
0.59375
3.129630
NA
NA
2.69375
6.018518
-296094
-225496
-278838
-224838
-75967
-224837
-231069
14555
-11804
-11802
-230139
-232525
1
30
University of Louisville
University of Dayton
17
42
42
University of Dayton
TRUE
University of Louisville
Reception
5
0
a9e6117d72bb9cf6065ceb32112aa955
6
NA
1
628
*09AT+X546CH2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
+
Positive, good attack
X5
Go
NA
NA
NA
4
6
C
NA
Hard spike
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
6
1
1
5
+4F
179
19
9
11
15
10
7
16
17
10
6
8
1
4210
5525
7851
NA
NA
0.48125
2.907407
1.04375
3.87037
2.01875
5.574074
-296094
-225496
-278838
-224838
-75967
-224837
14555
-11804
-11802
-230139
-232525
-231069
1
34
University of Louisville
University of Dayton
17
42
17
University of Louisville
FALSE
University of Dayton
Reception
5
1
R - Filtering for attacks by player
Code atks <- px %>% filter ( skill == 'Attack' & player_name == 'Claire Chaussee' )
atks <- head ( atks , 5 )
knitr :: kable ( atks )
a9e6117d72bb9cf6065ceb32112aa955
0
NA
1
504
*09AH#V541BH2 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
High ball attack
#
Winning attack
V5
Hut
NA
NA
NA
4
1
B
NA
Hard spike
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
1
0
1
6
00F
130
19
9
11
15
10
7
1
16
17
10
6
8
4316
5517
7918
NA
NA
0.70625
2.981482
0.74375
3.87037
0.78125
5.648148
-296094
-225496
-278838
-224838
-75967
-224837
-231069
14555
-11804
-11802
-230139
-232525
1
4
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Louisville
Transition
0
0
a9e6117d72bb9cf6065ceb32112aa955
6
NA
1
628
*09AT+X546CH2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
+
Positive, good attack
X5
Go
NA
NA
NA
4
6
C
NA
Hard spike
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
6
1
1
5
+4F
179
19
9
11
15
10
7
16
17
10
6
8
1
4210
5525
7851
NA
NA
0.48125
2.907407
1.04375
3.87037
2.01875
5.574074
-296094
-225496
-278838
-224838
-75967
-224837
14555
-11804
-11802
-230139
-232525
-231069
1
34
University of Louisville
University of Dayton
17
42
17
University of Louisville
FALSE
University of Dayton
Reception
5
1
a9e6117d72bb9cf6065ceb32112aa955
6
NA
1
631
*09AT#X549DT2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
#
Winning attack
X5
Go
NA
NA
NA
4
9
D
NA
Tip
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
6
1
1
5
+4F
183
19
9
11
15
10
7
16
17
10
6
8
1
4414
NA
7024
NA
NA
0.63125
3.055556
NA
NA
1.00625
4.981482
-296094
-225496
-278838
-224838
-75967
-224837
14555
-11804
-11802
-230139
-232525
-231069
1
36
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Dayton
Transition
5
1
a9e6117d72bb9cf6065ceb32112aa955
16
NA
1
956
*09AH-V549DP2 +5F
University of Louisville
9
Claire Chaussee
-225496
Attack
High ball attack
-
Poor, easily dug
V5
Hut
NA
NA
NA
4
9
D
NA
Soft spike/topspin
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
10
6
3
2
+5F
290
10
7
25
9
11
12
6
8
5
16
3
10
4022
NA
7426
NA
NA
0.93125
2.759259
NA
NA
1.08125
5.277778
-75967
-224837
-278840
-225496
-278838
-263069
-230139
-232525
-230141
14555
-230142
-11802
1
96
University of Louisville
University of Dayton
17
42
17
University of Dayton
FALSE
University of Louisville
Transition
10
5
a9e6117d72bb9cf6065ceb32112aa955
17
NA
1
989
*09AH+V541CT2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
High ball attack
+
Positive, good attack
V5
Hut
NA
NA
NA
4
1
C
NA
Tip
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
11
6
3
1
+4F
305
10
7
25
9
11
12
7
5
16
17
10
6
4426
5529
8036
NA
NA
1.08125
3.055556
1.19375
3.87037
1.45625
5.722222
-75967
-224837
-278840
-225496
-278838
-263069
-96826
-230141
14555
-11804
-11802
-230139
1
103
University of Louisville
University of Dayton
17
42
17
University of Louisville
FALSE
University of Dayton
Reception
10
6
Advanced filtering
Advanced filtering
We can narrow down our analysis to instances where a particular player receives the ball during attacks or when a set code occurs in the preceding skill. This can be achieved using methods that allow us to examine the previous skill or the next skill, enabling targeted filtering for these specific scenarios.
Python - Filtering for attacks by player reception
Code atks = df[(df['skill' ] == 'Attack' ) &
(df['player_name' ] == 'Claire Chaussee' ) &
(df['player_name' ].shift(2 ) == 'Mel McHenry' ) &
(df['skill' ].shift(2 ) == 'Reception' )]
Markdown(atks.to_markdown(index = False ))
153e954d-9e22-4f6f-a24b-844611174156
1
989
*09AH+V541CT2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
+
3
V5
nan
nan
4
1
C
2
11
6
3
1
+4F
10
7
25
9
11
12
7
5
16
17
10
6
4426
5529
8036
Reception
Reception
1.08125
3.05556
1.19375
3.8703700000000008
1.45625
5.72222
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
17
1
153e954d-9e22-4f6f-a24b-844611174156
1
2475
*09AT#X548DH4 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
2
X5
nan
nan
4
8
D
4
10
9
2
6
00F
7
25
9
11
12
10
20
16
6
10
15
7
4519
7455
Reception
Reception
0.81875
3.12963
2.16875
5.27778
2
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
19
1
Python - Filtering for attacks by set code
Code atks = df[(df['skill' ] == 'Attack' ) &
(df['player_name' ] == 'Claire Chaussee' ) &
(df['set_code' ].shift(1 ) == 'K1' )]
Markdown(atks.to_markdown(index = False ))
153e954d-9e22-4f6f-a24b-844611174156
1
1735
*09AT#X541CH2 +7F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
3
X5
nan
nan
4
1
C
2
25
17
3
1
+7F
10
7
25
9
11
12
7
5
16
17
10
15
4311
5516
7926
Reception
SO-Transition
0.51875
2.98148
0.70625
3.8703700000000008
1.08125
5.64815
1
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
42
3
153e954d-9e22-4f6f-a24b-844611174156
1
2475
*09AT#X548DH4 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
2
X5
nan
nan
4
8
D
4
10
9
2
6
00F
7
25
9
11
12
10
20
16
6
10
15
7
4519
7455
Reception
Reception
0.81875
3.12963
2.16875
5.27778
2
University of Louisville
University of Dayton
17
42
University of Louisville
University of Dayton
University of Louisville
19
1
153e954d-9e22-4f6f-a24b-844611174156
1
2830
*09AT#X548AH4 +6F
University of Louisville
9
Claire Chaussee
-225496
Attack
#
1
X5
nan
nan
4
8
A
4
16
9
1
6
+6F
19
9
11
15
10
7
20
12
6
10
15
7
4411
7545
Serve
BP-Transition
0.51875
3.05556
1.79375
5.35185
2
University of Louisville
University of Dayton
17
42
University of Louisville
University of Louisville
University of Dayton
25
2
R - Filtering for attacks by player reception
Code atks <- px %>% filter ( skill == 'Attack' &
player_name == 'Claire Chaussee' &
lag ( player_name ,2 ) == 'Mel McHenry' &
lag ( skill ,2 ) == 'Reception' )
knitr :: kable ( atks )
a9e6117d72bb9cf6065ceb32112aa955
17
NA
1
989
*09AH+V541CT2 +4F
University of Louisville
9
Claire Chaussee
-225496
Attack
High ball attack
+
Positive, good attack
V5
Hut
NA
NA
NA
4
1
C
NA
Tip
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
11
6
3
1
+4F
305
10
7
25
9
11
12
7
5
16
17
10
6
4426
5529
8036
NA
NA
1.08125
3.055556
1.19375
3.87037
1.45625
5.722222
-75967
-224837
-278840
-225496
-278838
-263069
-96826
-230141
14555
-11804
-11802
-230139
1
103
University of Louisville
University of Dayton
17
42
17
University of Louisville
FALSE
University of Dayton
Reception
10
6
a9e6117d72bb9cf6065ceb32112aa955
63
NA
1
2475
*09AT#X548DH4 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
#
Winning attack
X5
Go
NA
NA
NA
4
8
D
NA
Hard spike
Hole block
4
NA
FALSE
FALSE
FALSE
FALSE
10
9
2
6
00F
818
7
25
9
11
12
10
20
16
6
10
15
7
4519
NA
7455
NA
NA
0.81875
3.129630
NA
NA
2.16875
5.277778
-224837
-278840
-225496
-278838
-263069
-75967
-231072
14555
-230139
-11802
-273640
-96826
2
379
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Dayton
Reception
9
9
R - Filtering for attacks by set code
Code atks <- px %>% filter ( skill == 'Attack' &
player_name == 'Claire Chaussee' &
lag ( set_code ,1 ) == 'K1' )
knitr :: kable ( atks )
a9e6117d72bb9cf6065ceb32112aa955
43
NA
1
1735
*09AT#X541CH2 +7F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
#
Winning attack
X5
Go
NA
NA
NA
4
1
C
NA
Hard spike
2 player block
2
NA
FALSE
FALSE
FALSE
FALSE
25
17
3
1
+7F
600
10
7
25
9
11
12
7
5
16
17
10
15
4311
5516
7926
NA
NA
0.51875
2.981482
0.70625
3.87037
1.08125
5.648148
-75967
-224837
-278840
-225496
-278838
-263069
-96826
-230141
14555
-11804
-11802
-273640
1
259
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Dayton
Transition
24
17
a9e6117d72bb9cf6065ceb32112aa955
63
NA
1
2475
*09AT#X548DH4 00F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
#
Winning attack
X5
Go
NA
NA
NA
4
8
D
NA
Hard spike
Hole block
4
NA
FALSE
FALSE
FALSE
FALSE
10
9
2
6
00F
818
7
25
9
11
12
10
20
16
6
10
15
7
4519
NA
7455
NA
NA
0.81875
3.129630
NA
NA
2.16875
5.277778
-224837
-278840
-225496
-278838
-263069
-75967
-231072
14555
-230139
-11802
-273640
-96826
2
379
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Dayton
Reception
9
9
a9e6117d72bb9cf6065ceb32112aa955
69
NA
1
2830
*09AT#X548AH4 +6F
University of Louisville
9
Claire Chaussee
-225496
Attack
Head ball attack
#
Winning attack
X5
Go
NA
NA
NA
4
8
A
NA
Hard spike
Hole block
4
NA
FALSE
FALSE
FALSE
FALSE
16
9
1
6
+6F
905
19
9
11
15
10
7
20
12
6
10
15
7
4411
NA
7545
NA
NA
0.51875
3.055556
NA
NA
1.79375
5.351852
-296094
-225496
-278838
-224838
-75967
-224837
-231072
-233246
-230139
-11802
-273640
-96826
2
420
University of Louisville
University of Dayton
17
42
17
University of Louisville
TRUE
University of Louisville
Transition
15
9