Learn Coding & Data Science Fundamentals with Baseball

Python. Web Scraping. Databases. SQL. Statistics. Machine Learning. APIs. All applied to baseball.

This book is in progress. Enter your email to get updates, early access to chapters and give feedback on which topics are most important to you.

Go beyond Excel with this book from the author of Learn to Code with Fantasy Football and creator of Fantasy Math

This book is designed to take someone interested in baseball analytics — but who doesn't necessarily have any formal coding or advanced math background — from beginner to being comfortable with Python, databases, web scraping, machine learning and more!

This is the baseball adaptation of Learn to Code with Fantasy Football, which has helped hundreds of people learn to code while staying motivated because it's a subject they're interested in.

What will you get?

The football version of this book (which this is based off of) includes: book, 16 example Python scripts, 3 datasets, and more than 300 Anki questions to help you remember what you've read.

Want to see what the book covers? Check out the table of contents!

Get notified when it comes out!

What People Are Saying

about Learn to Code with Fantasy Football

"The book here was really, really well done..." — Bill Connelly, ESPN

"This is amazingly awesome. I’ve recently slowly crept into data science driven by a pet passion for fantasy sport analytics. ...I’m roughly 40 pages into this book and the way the learning is framed here is 10x what you’ll get someplace else." — u/Nick5893

"Incredible work! Bought it right away. Only 3 chapters in and this book is already better than expected. Worth every penny. Thank you!" — u/TheMotizzle

"...probably the best / most complete Pandas walk through I've seen." — Bill S

"I’ve probably picked up more, and at a better pace, using this than a lot of the free online tools I’d been trying the past few months. " — Ryan P

"...really helpful and a fun way to learn." — Brian D

"I can't tell you how many times I've tried to get into programming and gave up because it was so dry. This has been such a nice change of pace and I'm loving it. " — Paval M

"I’m like ~40 pages in and the simple intro to python chapter is much more engaging for me personally because it’s info I’m interested in. I’ve taken automate the boring stuff, python for finance, etc and while those courses are great.. I seem to be understanding it better because its about a subject I like." — u/financenstuff

"I have always wanted to learn a language but always seemed to get discouraged by the 'Hello World' chapters that were never ending. I like that your book cuts out the riff raff and teaches the important things! I'm flying through the book and feel like I'm learning a ton! Best wishes from a satisfied customer" — Jason K

"I recently purchased LTCWFF and could not be more satisfied with the content. ...it has been great to work through your in-depth examples learning new skills. I had a previous interest in this sort of analysis and have had intermediate programming experience, but never could tie the two together." — Owen B

"...your book is great. It's exactly what I needed to motivate me to push through..." — Matt O

"...the book is very well structured and easy to follow... I found it very helpful!" — Xiaolu Z

Get notified when it comes out!

What will you learn?

Python — This flexible language is the foundation of everything from data munging to web scraping to machine learning. You'll also learn about its key libraries like Pandas and scikit-learn.

Web Scraping & APIs — Next time you run across a site with data you'd like to analyze you'll know how to grab data via its public API if it's available, or build a web scraper to get it yourself if it's not.

Machine Learning & Statistics — You'll learn the difference between a regression and a random forest, and will know when and how to build both.

Monte Carlo & Simulation — You'll earn about the type of questions simulation techniques can help you answer, and how to build a simulation from scratch next time you have one.

Databases & SQL — Build your own database — whether it's for player statistics, to keep track of your own research, etc — and use SQL to get data in and out of it.

All in the applied to baseball data and designed so you can learn how to apply them to your own questions and do your own analysis.

About the author

Nathan Braun

Hi! My name is Nate and I'm a self-taught programmer and data scientist based in Milwaukee, WI

I'm the founder of fantasymath.com and the author of Learn to Code with Fantasy Football, which this book is based off of.

A few years ago, I didn't know anything about Python, SQL, machine learning, web scraping or any of the other topics covered here.

So, I taught myself. I ran into a lot of dead ends along the way, but ultimately figured it out. In this book, I distill everything I've learned to provide a step-by-step guide to doing baseball analytics and get you up and running as quickly as possible.

Get notified when it comes out!

Learn Coding & Data Science Fundamentals with Baseball

Python. Web Scraping. Databases. SQL. Statistics. Machine Learning. APIs. All applied to baseball.

This book is in progress. Enter your email to get updates, early access to chapters and give feedback on which topics are most important to you.

Thank You

Thanks for signing up for updates!

Go beyond Excel with this book from the author of Learn to Code with Fantasy Football and creator of Fantasy Math

This book is designed to take someone interested in baseball analytics — but who doesn't necessarily have any formal coding or advanced math background — from beginner to being comfortable with Python, databases, web scraping, machine learning and more!

This is the baseball adaptation of Learn to Code with Fantasy Football, which has helped hundreds of people learn to code while staying motivated because it's a subject they're interested in.

What will you get?

The football version of this book (which this is based off of) includes: book, 16 example Python scripts, 3 datasets, and more than 300 Anki questions to help you remember what you've read.

Want to see what the book covers? Check out the table of contents!

What People Are Saying

about Learn to Code with Fantasy Football

"The book here was really, really well done..." — Bill Connelly, ESPN

"This is amazingly awesome. I’ve recently slowly crept into data science driven by a pet passion for fantasy sport analytics. ...I’m roughly 40 pages into this book and the way the learning is framed here is 10x what you’ll get someplace else." — u/Nick5893

"Incredible work! Bought it right away. Only 3 chapters in and this book is already better than expected. Worth every penny. Thank you!" — u/TheMotizzle

"...probably the best / most complete Pandas walk through I've seen." — Bill S

"I’ve probably picked up more, and at a better pace, using this than a lot of the free online tools I’d been trying the past few months. " — Ryan P

"...really helpful and a fun way to learn." — Brian D

"I can't tell you how many times I've tried to get into programming and gave up because it was so dry. This has been such a nice change of pace and I'm loving it. " — Paval M

"I’m like ~40 pages in and the simple intro to python chapter is much more engaging for me personally because it’s info I’m interested in. I’ve taken automate the boring stuff, python for finance, etc and while those courses are great.. I seem to be understanding it better because its about a subject I like." — u/financenstuff

"I have always wanted to learn a language but always seemed to get discouraged by the 'Hello World' chapters that were never ending. I like that your book cuts out the riff raff and teaches the important things! I'm flying through the book and feel like I'm learning a ton! Best wishes from a satisfied customer" — Jason K

"I recently purchased LTCWFF and could not be more satisfied with the content. ...it has been great to work through your in-depth examples learning new skills. I had a previous interest in this sort of analysis and have had intermediate programming experience, but never could tie the two together." — Owen B

"...your book is great. It's exactly what I needed to motivate me to push through..." — Matt O

"...the book is very well structured and easy to follow... I found it very helpful!" — Xiaolu Z

What will you learn?

Python — This flexible language is the foundation of everything from data munging to web scraping to machine learning. You'll also learn about its key libraries like Pandas and scikit-learn.

Web Scraping & APIs — Next time you run across a site with data you'd like to analyze you'll know how to grab data via its public API if it's available, or build a web scraper to get it yourself if it's not.

Machine Learning & Statistics — You'll learn the difference between a regression and a random forest, and will know when and how to build both.

Monte Carlo & Simulation — You'll earn about the type of questions simulation techniques can help you answer, and how to build a simulation from scratch next time you have one.

Databases & SQL — Build your own database — whether it's for player statistics, to keep track of your own research, etc — and use SQL to get data in and out of it.

All in the applied to baseball data and designed so you can learn how to apply them to your own questions and do your own analysis.

About the author

Nathan Braun

Hi! My name is Nate and I'm a self-taught programmer and data scientist based in Milwaukee, WI

I'm the founder of fantasymath.com and the author of Learn to Code with Fantasy Football, which this book is based off of.

A few years ago, I didn't know anything about Python, SQL, machine learning, web scraping or any of the other topics covered here.

So, I taught myself. I ran into a lot of dead ends along the way, but ultimately figured it out. In this book, I distill everything I've learned to provide a step-by-step guide to doing baseball analytics and get you up and running as quickly as possible.