Sabermetrics Documentation Release 0.1.1

Fernando Crema

August 08, 2016

Contents

1 3 1.1 sabermetrics package...... 3

2 Indices and tables 5

Python Module Index 7

i ii Sabermetrics Documentation, Release 0.1.1

Contents:

Contents 1 Sabermetrics Documentation, Release 0.1.1

2 Contents CHAPTER 1

sabermetrics

1.1 sabermetrics package

1.1.1 Submodules

1.1.2 sabermetrics. module

sabermetrics.batting.avg(h, ab) is determined by dividing a player’s hits by his total at-bats for a number between zero (shown as .000) and one (1.000). 퐻 퐴푉 퐺 = 퐴퐵 Parameters • h (int.) – Hits. • ab (int.) – At bats. Returns float – The batting average. Raises ZeroDivisionError sabermetrics.batting.babip(h, hr, ab, k, sf ) BABIP measures a player’s batting average exclusively on balls into the field of play, removing outcomes not affected by the opposing defense (namely home runs and ). 퐻 − 퐻푅 퐵퐴퐵퐼푃 = 퐴퐵 − 퐾 − 퐻푅 − 푆퐹 Parameters • h (int.) – Hits. • hr (int.) – Homeruns. • ab (int.) – At bats. • k (int.) – Strikeouts. • sf (int.) – Sacrifice fly. Returns float – Batting average balls in play.. Raises ZeroDivisionError

3 Sabermetrics Documentation, Release 0.1.1

1.1.3 sabermetrics.fielding module

sabermetrics.fielding.fpct(a, po, e) How often does a fielder or team make the play when tasked with fielding a batted ball, throwing a ball, or receiving a thrown ball for an .

푃 푂 + 퐴 퐹 푃 퐶푇 = 푃 푂 + 퐴 + 퐸 Parameters • a (int.) – Assists. • po (int.) – . • e (int.) – Errors. Returns float – The fielding percentage. Raises ZeroDivisionError

1.1.4 sabermetrics.pitching module sabermetrics.pitching.era(er, outs) Represents the number of earned runs a allows per nine innings – with earned runs being any runs that scored without the aid of an or a . 27퐸푅 퐵퐴퐵퐼푃 = 푂푢푡푠 Parameters • er (int.) – Earned runs. • outs (int.) – Number of batters and baserunners that are put out while the pitcher is on the mound. Returns float – the return code. Raises ZeroDivisionError

1.1.5 Module contents

Sabermetrics: A python package with a set of baseball analytic functions for sabermetric purposes. sabermetrics.start() Initializing modules.

4 Chapter 1. sabermetrics CHAPTER 2

Indices and tables

• genindex • modindex • search

5 Sabermetrics Documentation, Release 0.1.1

6 Chapter 2. Indices and tables Python Module Index

b batting (Unix, Windows),3 f fielding (Unix, Windows),4 p pitching (Unix, Windows),4 s sabermetrics,4 sabermetrics.batting,3 sabermetrics.fielding,4 sabermetrics.pitching,4

7 Sabermetrics Documentation, Release 0.1.1

8 Python Module Index Index

A avg() (in module sabermetrics.batting),3 B babip() (in module sabermetrics.batting),3 batting (module),3 E era() (in module sabermetrics.pitching),4 F fielding (module),4 fpct() (in module sabermetrics.fielding),4 P pitching (module),4 S sabermetrics (module),4 sabermetrics.batting (module),3 sabermetrics.fielding (module),4 sabermetrics.pitching (module),4 start() (in module sabermetrics),4

9