Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/totalhack/zillion-baseball

Use Zillion to analyze Baseball Statistics
https://github.com/totalhack/zillion-baseball

Last synced: 13 days ago
JSON representation

Use Zillion to analyze Baseball Statistics

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.