[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
THE BOOK cover
The Unwritten Book
is Finally Written!

Read Excerpts & Reviews
E-Book available
as Amazon Kindle or
at iTunes for $9.99.

Hardcopy available at Amazon
SABR101 required reading if you enter this site. Check out the Sabermetric Wiki. And interesting baseball books.
Shop Amazon & Support This Blog
RECENT FORUM TOPICS
Jul 12 15:22 Marcels
Apr 16 14:31 Pitch Count Estimators
Mar 12 16:30 Appendix to THE BOOK - THE GORY DETAILS
Jan 29 09:41 NFL Overtime Idea
Jan 22 14:48 Weighting Years for NFL Player Projections
Jan 21 09:18 positional runs in pythagenpat
Oct 20 15:57 DRS: FG vs. BB-Ref

Advanced

Tangotiger Blog

A blog about baseball, hockey, life, and whatever else there is.

Sunday, January 17, 2016

Code Python with me

?This is my first Python program.  I'll be posting what I'm doing so everyone can follow along.  And especially for the experts out there to give me (us) some pointers.

If you are brand new, download PyCharm and Anaconda.  I'll eventually do a tutorial, but for now, I'll just post some stuff.

For those who use Python, here's the first program, which all it does is download data files from the NHL site:

http://tangotiger.net/python/

When you download the file, just rename it to .py

So, my questions:

  1. I need to be able to loop through 0001 through 0666.  Can it be done as a string, or does it have to be converted as I'm doing it.
  2. If we have to convert it, then can you calculate the zero-padding as a function instead of the if/else?
  3. What if the urlRetrieve is interrupted or the file itself doesn't exist?

Any other piece of advice so far?

(35) Comments • 2016/02/13 • Tech_Web

Latest...

COMMENTS

Nov 23 14:15
Layered wOBAcon

Nov 22 22:15
Cy Young Predictor 2024

Oct 28 17:25
Layered Hit Probability breakdown

Oct 15 13:42
Binomial fun: Best-of-3-all-home is equivalent to traditional Best-of-X where X is

Oct 14 14:31
NaiveWAR and VictoryShares

Oct 02 21:23
Component Run Values: TTO and BIP

Oct 02 11:06
FRV v DRS

Sep 28 22:34
Runs Above Average

Sep 16 16:46
Skenes v Webb: Illustrating Replacement Level in WAR

Sep 16 16:43
Sacrifice Steal Attempt

Sep 09 14:47
Can Wheeler win the Cy Young in 2024?

Sep 08 13:39
Small choices, big implications, in WAR

Sep 07 09:00
Why does Baseball Reference love Erick Fedde?

Sep 03 19:42
Re-Leveraging Aaron Judge

Aug 24 14:10
Science of baseball in 1957

THREADS

January 17, 2016
Code Python with me