A Python library for tennis data analysis.
Project description
Pytennis
Install
pip install pytennis
How to use
Data
path = untar_data(URLs.ATP_2019_AUSTRALIAN_OPEN_SINGLES_FINAL)
path
Path('/Users/robertseidl/.pytennis/data/ATP_2019_AustralianOpen_Singles_Final')
path.ls()
(#4) [Path('/Users/robertseidl/.pytennis/data/ATP_2019_AustralianOpen_Singles_Final/rallies.csv'),Path('/Users/robertseidl/.pytennis/data/ATP_2019_AustralianOpen_Singles_Final/points.csv'),Path('/Users/robertseidl/.pytennis/data/ATP_2019_AustralianOpen_Singles_Final/events.csv'),Path('/Users/robertseidl/.pytennis/data/ATP_2019_AustralianOpen_Singles_Final/serves.csv')]
pd.read_csv(path/'rallies.csv', index_col=0).head()
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
rallyid | server | returner | winner | reason | serve | strokes | totaltime | x | y | |
---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | Djokovic | Nadal | Djokovic | winner | first | 3 | 0.92 | 1.92 | 21.96 |
1 | 2 | Djokovic | Nadal | __undefined__ | second_serve | first | 1 | 0.00 | 7.42 | 12.10 |
2 | 3 | Djokovic | Nadal | Djokovic | out | second | 4 | 4.16 | 3.33 | -0.39 |
3 | 4 | Djokovic | Nadal | __undefined__ | second_serve | first | 1 | 0.00 | 4.64 | 17.69 |
4 | 5 | Djokovic | Nadal | Djokovic | ace | second | 2 | 0.40 | 1.62 | 17.18 |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytennis-0.0.2.tar.gz
(16.7 kB
view hashes)
Built Distribution
pytennis-0.0.2-py3-none-any.whl
(14.0 kB
view hashes)