https://github.com/totalhack/zillion-baseball
Use Zillion to analyze Baseball Statistics
https://github.com/totalhack/zillion-baseball
Last synced: 10 months ago
JSON representation
Use Zillion to analyze Baseball Statistics
- Host: GitHub
- URL: https://github.com/totalhack/zillion-baseball
- Owner: totalhack
- License: mit
- Created: 2020-08-21T20:40:27.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-21T20:47:04.000Z (over 5 years ago)
- Last Synced: 2024-10-28T16:45:14.646Z (over 1 year ago)
- Language: Python
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Zillion Baseball
================
This is an example repo showing how one can use
[Zillion](https://github.com/totalhack/zillion) to analyze data from the
[Baseball Data Bank](https://github.com/chadwickbureau/baseballdatabank).
The `zillion` warehouse is defined in `zillion_baseball/baseball_warehouse.json`.
To see the available warehouse metrics, dimensions, and datasources try the
following from the `zillion_warehouse` directory:
```shell
$ python warehouse.py
"""
---- Warehouse
metrics:
{
'at_bats': ,
'batting_average': ,
'caught_stealing': ,
'doubles': ,
'games': ,
...
"""
```
To run reports on the command line use the `run_report.py` helper script.
```shell
$ python run_report.py -m hits home_runs -d franchise_name -c '[("year", "=", "2018")]'
"""
H HR
Franchise Name
Arizona Diamondbacks 1283 176
Atlanta Braves 1433 175
Baltimore Orioles 1317 188
Boston Red Sox 1509 208
Chicago Cubs 1453 167
Chicago White Sox 1332 182
...
"""
```
Use `--help` for more information. The output is simply a printed dataframe,
so data may be truncated in the terminal.
> **Note:** this is meant to be a quick example. Zillion is still in its
infancy and is subject to rapid changes.