SMALL BALL

If you just unsealed this like I ordered you to, tie yourself down to whatever chair you’re sitting in, because this letter is going to be a rough fucking ride. 

For those of you that have your heads stuck under rocks, which is apparently the majority of this house, we have been FUCKING UP in terms of formal dinners and general social interactions with the Tyrells. I’ve been getting messengers on messengers about people LITERALLY being so fucking AWKWARD and so fucking BORING. If you’re reading this right now and saying to yourself “But seven hells Tywin, I’ve been having so much fun with my fellow Lannisters this week!” then dagger yourself in the face right now so that I don’t have to fucking find you in the Red Keep and do it myself.

HEY. IDIOT COUNTRY DUDE:

http://abcnews.go.com/blogs/entertainment/2013/04/paisley-ll-cool-j-stand-by-accidental-racist/

 and Paisley singing that white Americans are “still paying for mistakes that a bunch of folks made before we came.”

[…]

“I’m not advising anyone to truly forget slavery, but what I’m saying is forget the slavery mentality,” LL Cool J said.  “Forget the bitterness.  Don’t get bitter, get better.”

[…]

“Let’s not be victims of things that happened so long ago,” Paisley said.

Drink

http://schoolsofthought.blogs.cnn.com/2013/04/05/big-plans-for-georgia-students-first-racially-integrated-prom/

Bleach

http://www.usnews.com/news/articles/2013/04/03/study-recession-widened-racial-gaps-in-wealth-income

Shitheads

http://www.motherjones.com/mojo/2013/03/texas-county-sought-death-penalty-blacks-three-times-more-often

 

MLB GameDay XML Parser for Python

ADDENDUM (OH SHIT I FORGOT) : You need one non-standard module for this, and it’s BeautifulSoup. Try ‘easy_install bs4’ or get it from here: http://www.crummy.com/software/BeautifulSoup/

I’m not posting this on GitHub or anything because this was just an exercise in the process of teaching myself Python, and it could very well be buggy as shit and I don’t want to support it at all. BUT:

I wrote a Python module that has a few functions that are useful in grabbing and parsing the gameday data that MLB makes available via XML files. You can get it here:

https://docs.google.com/file/d/0B8pmvqXqfluEX0ZkQXlNTEVDMGc/edit?usp=sharing

There are 10 functions in total, but of particular interest to Dude McRandom will probably be the WriteGames function, which will take every pitch from a list of games and write the data (game info, inning info, at bat info, and pitch f/x info) to a CSV file, one row per pitch. I’m going to list the functions and what they do, but after all that will be a concrete example, so you might want to just scroll down a bunch. 

mlbgid module functions:

SetFieldNames()

This returns a list of the field names that correspond to the data that will be written to the CSV file when you use WriteGames(). Needed for the sake of the csv.DictWriter (more on that later)

CreateWriter(file) 

This takes an open CSV file and returns a DictWriter object that will translate the Python dictionary of values extracted from the XML to a row of CSV data

GetGame(gameid)

This takes a string, formatted as an MLB game ID, and returns an XML element object that contains all of the game data. MLB game IDs are formatted like so: YYYY_MM_DD_AWAYTEAMmlb_HOMETEAMmlb_gamenumber, where gamenumber is usually 1, but would be 2 if it’s the second game of a doubleheader

TodaysGames()

This returns a list of MLB game IDs consisting of all games that occurred on the present day. 

DateGames(date)

This takes a date string and returns a list of MLB game IDs consisting of all games that occurred on the date represented by the string. The string MUST be formatted as YYYY-MM-DD

ParsePitch(pitch, GameProperties, InnProperties, ABProperties, istop, writer)

This takes an XML element for a pitch, a dictionary of game attributes, a dictionary of inning attributes, a dictionary of at bat attributes, a boolean variable indicating whether it is the top of an inning or not, and a CSV DictWriter. It combines the dictionaries into one set of attributes and writes it to the open CSV file handled by the DictWriter. This is the business end of building the CSV file. It returns nothing of value.

ParseAtBat(atbat)

This takes an XML element for an atbat, and returns a dictionary of attributes for the atbat.

ParseInning(inning)

This takes an XML element for an inning, and returns a dictionary of attributes for the inning.

ParseGame(game, gameid, writer)

This takes an XML element for a game, a string of the MLB game ID, and a CSV DictWriter, and writes the game’s pitches to the CSV file handled by the DictWriter

WriteGames(gameids, filename)

This takes a list of MLB game IDs, and a string representing a CSV filename that you want to write to, and writes the pitch data for every game in the list to the csv file. It returns the file object, so add a .close() on the end if you want to close the file. 

 ::EXAMPLE::

The most useful implementation I can think of, for the moment, is to write a script that will grab the day’s games and write their pitch data to a csv file. With this module, you would do it like this:

import mlbgid

mlbgid.WriteGames(mlbgid.TodaysGames(),’/games.csv’).close()

That’s it. The first line imports the module. The second line calls the WriteGames() function. The first argument for WriteGames is mlbgid.TodaysGames(), which is a list of MLB game IDs for games that happened today. The second argument is a file name that refers to ‘games.csv’ in your root. The file does not need to be preexisting. ‘.close()’ is appended to close the games.csv file. 

::NOTES::

  • The MLB XML files use home_team_runs and away_team_runs to represent the score after the play in question. I thought that was fucking stupid. One might want to figure out things like “list all pitches thrown while the score was 2-1” or some such, so I jiggered the code a bit such that away_team_runs and home_team_runs represent the score at the beginning of the at bat in question. The only time this gets tricky is if a run scores in the middle of an at bat (i.e. on a wild pitch). If that occurs, then those fields will continue to represent the score at the beginning of the at bat, until the next batter comes up. I could probably fix this, but, reasons. 
  • WriteGames() writes a header row to the CSV file. This is just for ease of interpretation. If you use it to write Spring Training or exhibition games, though, not all pitch f/x data is recorded for those. So you’ll have the full header row but not all of the data will be filled in for those games. Just FYI. I’m not sure exactly what happens if you use WriteGames() on a day when there are both spring games with no pitch f/x data and regular season games with pitch f/x data. Try it and find out for yourself! Fucker. 
  • WriteGames() will write little notifications for each game it completes. If it comes across a game where the consolidated XML file is not available, the notification will say “[Game] not found.” This should only happen in 3 instances: 1) World Baseball Classic games , 2) 2012 regular season games where the Marlins were an away or home team and MLB stupidly included a blank entry for ‘flomlb,’ but don’t worry, it included a full entry for ‘miamlb’ and that data WILL be written, 3) games that did not occur on that day because of rain/snow/whatever postponement; the future makeup game will be collected when you run WriteGames() on that date. 
  • Certain pitches thrown in 2010 and earlier will probably have some blank data because pitch f/x collection was sort of spotty
  • That’s all I can think of for now. Like I said this was literally a babby’s first Python exercise so I can’t guarantee the code is all that rigorous, but I’ve tested it a bunch and it seems to work fine. 

Questions —-> @phylan but like I said I’m not exactly supporting this shit.

2013 PHILLIES PREVIEW PRESENTED BY TUMBLR

INFIELD

Ryan Howard | 1B | .219/.295/.423, 14 HR in 292 PA





===========================================

Chase Utley | 2B | .256/.365/.429, 11 HR in 362 PA





===========================================

Jimmy Rollins | SS | .250/.316/.427, 23 HR in 699 PA





===========================================

Michael Young | 3B | .277/.312/.370, 8 HR in 651 PA





===========================================

Carlos Ruiz | C | .325/.394/.540, 16 HR in 421 PA





===========================================

OUTFIELD

Delmon Young | LF | .267/.296/.411, 18 HR in 608 PA





===========================================

Ben Revere | CF | .294/.333/.342, 0 HR in 553 PA





===========================================

John Mayberry, Jr. | RF | .245/.301/.395, 14 HR in 479 PA





===========================================

Domonic Brown | RF | .235/.316/.396, 5 HR in 212 PA





===========================================

PITCHERS

Roy Halladay | SP | 4.49 ERA, 20.4% K, 5.6% BB in 156.1 IP





===========================================

Cliff Lee | SP | 3.16 ERA, 24.4% K, 3.3% BB in 211 IP





===========================================

Cole Hamels | SP | 3.05 ERA, 24.9% K, 6.0% BB in 215.1 IP





===========================================

Kyle Kendrick | SP | 3.90 ERA, 17.2% K, 7.3% BB in 159.1 IP





===========================================

Jonathan Papelbon | CL | 2.44 ERA, 32.4% K, 6.3% BB in 70 IP



I Swear This Is About Baseball

This week, British journalist and feminist essayist Suzanne Moore wrote a column for The New Statesman titled Seeing Red: The Power of Female Anger. While otherwise pretty on point, it contained a really unfortunate line about men preferring the body type of “a Brazilian transsexual.” For obvious reasons, it was a pretty offensive way in which to invoke transgender identities, and a lot of people were upset. At this point, Moore probably could have apologized for her insensitivity, and the whole thing would have been forgotten about. Instead she went into full meltdown, making a series of awful tweets that only dug her deeper. The full summary is here, but, here is one of them just to give you an idea: 

image

Awful. She also griped about being the victim of language policing and Twitter mobs. Worse, still, was how many other journalists who ostensibly should know better began their reflexive wagon circling — among others, Caitlin Moran and Charles Arthur. Maybe this isn’t unique to journalism, but the way in which other writers refused to even consider that Moore might be in the wrong, even as she dug herself deeper, was astonishing. The general sentiment is pretty well summarized by that Moran tweet linked above: “We are commentators! The gall of holding us responsible for our commentary! This never happened before Twitter!”

In the end, Moore took her ball and went home, deleting her Twitter account merely because she was called to account for her language. Owen Jones of The Independent lamented “Twitter storms:”

image

Poor helpless writers, forced to bear the agony of being told they’re wrong.

This reminded me of something drastically less important: baseball journalism. Because on Wednesday, after not a single player on a Hall of Fame ballot overflowing with worthy talent was elected, Jon Heyman took up (well, really, continued to promote) The Wrongest Cause: 

image

Putting aside that Jack Morris as a worthy Hall of Fame candidate is completely ridiculous for a laundry list of reasons, note that Jon Heyman thinks “[inter]net negativity” is a contributing factor in sinking Morris’ candidacy. Matt Gelb, bracing himself for certain backlash against the BBWAA, spoke of ”arrogant Internet bullies chastising anyone who resists their groupthink.”

Similarly, when Dayton Moore traded a ridiculous bounty of prospects for James Shields and Wade Davis in early December, writers exhibited bizarre defensiveness about the Royals GM. Danny Knobler penned a hilariously whiny column that began, “No surprise, the Twitter world hates what the Royals just did.” Ken Rosenthal wrotewoe to any GM who parts with [prospects] in this hyper-critical, Twitter-crazed era.”

Here’s a fucking memo to sports writers, British journalists, baseball general managers and whoever the hell else: Sometimes you are wrong. You didn’t start being wrong when Twitter was created. There are instances of you being wrong years and years before that. Sometimes you engage in lazy analysis, or write offensive things. This, too, believe it or not, predates Twitter and any other social media outlet you could name. 

Twitter is not “hyper-critical,” it just abolishes the illusion that every precious opinion you put on the record is owed some super special deference because of your occupation. It does this by putting you on a more-or-less equal platform with the people who consume your work, who think critically about it, and form their own opinions. Sometimes they’re wrong. Many times, maybe. But sometimes you are wrong, and Twitter isn’t obligated to stop and act aghast at that prospect. 

Presumably you’ve exposed yourself to this because it’s a powerful way to promote your work. That is the trade-off. It’s not altogether different from when you accepted a job at a bigger newspaper, or had your blog bought out by a large media outlet, or whatever. So stop mournfully eulogizing the death of discourse at the hands of new media every time someone on Twitter thinks you’re incorrect. Stop whining about it. 

Have I seen people write like this before? Yes. 

Is it completely insufferable and unnecessary? Sure.

Does it sometimes include more than just a one word answer? Of course, and that makes the format even stupider because it ruins the cadence. 

Should it switch between affirmative and negative answers, which makes no sense at all? No, but people do that too. 

Is this just a way of masking a total lack of creativity in sentence construction? Definitely.

Would it be much easier to just make a goddamned statement in a straightforward way? Absolutely. 

Am I going to just stop reading anything that includes this dumb shit in the future? Probably.

This is Leo Egan. He is a baseball player in a nerdy fictional baseball league I participate in. He is the best baseball player to ever have existed in the league, and would be the best player in baseball history if he actually existed. In 9 major league seasons he’s hit .375/.478/.765. He’s never posted an OPS under 1.100 in any season at any level. He has 478 home runs at the age of 28. He is not on my team. Goddamnit. 

This is Leo Egan. He is a baseball player in a nerdy fictional baseball league I participate in. He is the best baseball player to ever have existed in the league, and would be the best player in baseball history if he actually existed. In 9 major league seasons he’s hit .375/.478/.765. He’s never posted an OPS under 1.100 in any season at any level. He has 478 home runs at the age of 28. He is not on my team. Goddamnit. 

How to Make an AL MVP Case for Miguel Cabrera

Like so:

Mike Trout has had an incredible season, particularly considering his age, but in terms of overall value, Cabrera edges him out. Entering today, Cabrera has recorded 67 more plate appearances than Trout, a not-insignificant gap. Their on-base percentages are effectively equal, and Cabrera has a 58 point edge in slugging percentage.

Trout advocates give him a positional and defensive edge to make up for this, or do so indirectly in the form of Wins Above Replacement, but consider this: in the 2011 and 2012 seasons, third base has become a more difficult position at which to find offense than center field. In both seasons, OPS from the center field position has outstripped that of third base by at least 28 points. And Trout, it should be noted, has logged almost a third of his defensive innings at corner outfield positions of decidedly less value than third.

While defensive metrics indicate a wide gap between their respective abilities, the unreliability of single-season defensive measures is well documented. For human-charted metrics, the natural tendency to chart the ball closer to the only visible landmark (the fielder) than it actually is significantly penalizes infielders like Cabrera, making it appear that they should’ve made more plays than were actually possible. And the distorting effect that something like an infield shift can have on other metrics has been amply demonstrated by Brett Lawrie.

This is not to even mention the question of how heavily defense should be weighed in things like WAR; to suggest that Trout’s defense alone makes him 2.5 wins better than the average fielder, as his rField value would imply, stretches credibility severely. Given all of this information, it’s hardly a given that Trout’s defensive abilities can overcome the advantage that Cabrera has by virtue of providing slightly better offense over substantially more plate appearances.

Notice I did not:

  • Cite the Triple Crown as if it were anything more than a category-based novelty
  • Allude to monthly splits or September performance when discussing an award predicated on overall value
  • Point to Cabrera’s achievements in other seasons as support for his case in winning an award that is handed out every season, for that season’s performance. 
  • Try to distract the audience from the most reliable and simple measures of hitter performance by stringing together peripheral numbers to construct meaningless narratives like “most-feared” or “matters most”
  • Bring up the performance of either player’s team

I don’t find the case above convincing at all. I think it falls far short of robustness actually. To me, Mike Trout is the obvious AL MVP in 2012. But I’d much rather hear the above case for Cabrera than the others being made, because it’s reasonably intellectually honest, straightforward, and doesn’t recast this whole thing as another interminable old stats vs. new stats, traditional vs. advanced showdown. Which is what is going to happen. Somebody fucking kill me. 

Horse_Ebooks Presents the 2012 Philadelphia Phillies

THE 2012 PHILADELPHIA PHILLIES: Enjoying Baseball http://tinyurl.com/7baf6ut

2011 Record: 102-60
713 runs scored, 529 runs allowed



GENERAL MANAGER RUBEN AMARO







MANAGER CHARLIE MANUEL







Carlos Ruiz
Catcher



2011: 472 PA, .283/.371/.383, 6 HR, 107 OPS+, 3 rWAR





Ryan Howard
First Baseman



2011: 644 PA, .253/.346/.488, 33 HR, 125 OPS+, 2.7 rWAR
12:$20M, 13:$20M, 14:$25M, 15:$25M, 16:$25M, 17:$23M club option ($10M buyout)




Chase Utley
Second Baseman



2011: 454 PA, .259/.344/.425, 11 HR, 109 OPS+, 3.6 rWAR




Jimmy Rollins
Shortstop



2011: 631 PA, .268/.338/.399, 16 HR, 101 OPS+, 3.7 rWAR




Placido Polanco
Third Baseman



2011: 523 PA, .277/.335/.339, 5 HR, 85 OPS+, 1.8 rWAR




Domonic Brown
Left Fielder



2011: 210 PA, .245/.333/.391, 5 HR, 97 OPS+, 0 rWAR




Shane Victorino
Center Fielder



2011: 586 PA, .279/.355/.491, 17 HR, 129 OPS+, 5.1 rWAR




Hunter Pence
Right Fielder



2011: 668 PA, .314/.370/.502, 22 HR, 138 OPS+, 5.2 rWAR




Roy Halladay
Starting Pitcher



2011: 233.2 IP, 2.35 ERA, 220 K, 35 BB




Cole Hamels
Starting Pitcher



2011: 216.0 IP, 2.79 ERA, 194 K, 44 BB




Cliff Lee
Starting Pitcher



2011: 232.2 IP, 2.40 ERA, 238 K, 42 BB




Vance Worley
Starting Pitcher



2011: 131.2 IP, 3.01 ERA, 119 K, 46 BB




Joe Blanton
Starting Pitcher



2011: 41.1 IP, 5.01 ERA, 35 K, 9 BB




Jonathan Papelbon
Closer



2011: 64.1 IP, 2.94 ERA, 87 K, 10 BB




Jim Thome
Bench/First Baseman



2011: 324 PA, .256/.361/.477, 15 HR, 131 OPS+, 1.4 rWAR