One row per MLB team per season from 1871 through 2021, 2,985 team-seasons built from the Lahman Baseball Database (Sean Lahman and the Chadwick Baseball Bureau, CC BY-SA 3.0). Thirty columns cover the full record: league and division, finish, games, wins, losses and win percentage, runs scored and allowed with the derived run differential, home runs, stolen bases, strikeouts, team ERA, shutouts, saves, errors and fielding percentage, flags for winning the division, the pennant and the World Series plus a made-the-postseason flag, attendance, ballpark and the batting and pitching park factors. It spans every major league the database records, from the 1870s National Association through the American Association and the Union, Players and Federal leagues to the modern National and American Leagues. A rich dataset for baseball analysis: the run differential to wins relationship (Pythagorean expectation), franchise trajectories across eras, offense and pitching trends, and attendance. Nine acceptance tests, one enforcing the 25 percent fill rule on every column.
2,985 rows in one CSV file, with 30 columns in total: Season_Year, Team, Franchise, Team_ID, League, Division, Finish, Games, Wins, Losses, Win_Pct, Runs_Scored, Runs_Allowed, Run_Differential, Home_Runs, Stolen_Bases, Strikeouts_Batting, Team_ERA, Shutouts, Saves, Errors, Fielding_Pct, Made_Postseason, Won_Division, Won_Pennant, Won_World_Series, Attendance, Ballpark, Batting_Park_Factor, Pitching_Park_Factor.
It is built by programmatically scraping github.com, last pulled on 2026-10-24. Datasets are versioned; older versions stay downloadable.
Yes. Every CodeSights dataset is completely free as a CSV download; a free account is all it takes. Anyone can preview the data without signing in.
Yes. The exact Python scraper that built it is viewable on the dataset page by any signed-in member, so every number is reproducible.
Automated scraping leaves room for error and the underlying sources change over time, so no version is guaranteed accurate or complete. If a number matters, verify it against the original source.