You Are Here > Baseball-Reference.com > Blog >

SITE NEWS: We are moving all of our site and company news into a single blog for Sports-Reference.com. We'll tag all B-R content, so you can quickly and easily find the content you want.

Also, our existing B-R blog rss feed will be redirected to the new site's feed.

Baseball-Reference.com » Sports Reference

For more from Andy and the gang, check out their new site High Heat Stats.

How Do I … With PI?

Posted by Raphy on June 19, 2010

There seems to be a recent  increase in the number of how to questions regarding PI usage. Since there are constantly new users, I thought that it might be good to have a single place for people to posts questions and answers regarding PI searches. This way people can read up on old questions and the answers to new questions won't  risk being lost in the comments of another post.

I can't stick this to the top of any page or even tag it, but a search for "PI help"  should help find this thread. If comments on the thread ever closes, please send me an email and I'll reopen it. You can find my contact information (along with all the other bloggers) on the right bar of this page.

Anyway, here is the thread. Ask away.

This entry was posted on Saturday, June 19th, 2010 at 10:47 pm and is filed under Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

32 Responses to “How Do I … With PI?”

  1. I noticed that in general you can do pitching queries or hitting queries. What about fielding queries? Watching the Pirates error fest against the White Sox on Wednesday, I was wondering when the last time the Sox were involved in a game where four errors were committed in an inning. How would you go about doing that?

  2. There's probably an easy way to do this, but how do you search career stats like "Most games played without appearing in a World Series"? Or can't you do that? (Specifically, I am wondering who has played the most MLB games without ever being named to an All-Star team - or, alternatively, without ever having played in one.)

  3. How do I figure out who has the best slugging percentage on Tuesday night games during a meteor shower?

  4. @1 Fielding and Inning queries are not yet available. (Although , Fielding queries have been promised, hopefully this summer. http://www.baseball-reference.com/blog/archives/5756 )

    If you want to do a little research, you can use the ROE option in the team batting game finder as a starting point. I know its not perfect, but it may help.

  5. rootbeersoup Says:

    Say I wanted to see which team has had the best production from 2nd basemen over the past 10 years... How would I be able to find that? Like I would want only 30 lines (one for each team) and I would basically want all 2B from each team lumped into one line. Example: The giants line would take Jeff Kent's stats as a Giant, Ray Durham's stats as a Giant, and anyone else who played 2B during that time, combined into one line and etc etc for each team.

  6. @2 There is no easy way to do that with PI. However, the WS question can be found here.
    http://www.baseball-reference.com/leaders/leaders_most_gamesnows.shtml

    As for the all-star appearances. I don't think there is an easy way to do this. However, if you are spreadsheet savvy, you can use the batting game finder to create a table with every player to play in the all-star game and compare that with a table (created with the season finder) of the leaders in games played.

    Interesting idea for a post...

  7. Chipmaker Says:

    How to find pitchers who were in both games a doubleheader? "Days Rest" cannot be set to -1 (a suggestion I have made before).

  8. Detroit Michael Says:

    Can one search for an accomplishment within the first x plate appearances or first x at bats in one's MLB career? For example, who had the most homers in the first 1,000 plate appearances of one's career?

  9. @7 You can trick the PI to find this. Set Days Rest < 0 * IP (or something like that).

    I'll try to get to the other questions tomorrow.
    Good night, all.

  10. there was one i was trying to find: a game in which a player hits for the cycle, and those hits being his team's only hits in that game. maybe that can't be done with PI.

  11. Is there a way to total someone's numbers while eliminating one season (or say a bad start for a SP) from the log?

  12. I'm trying to find out Wilson Valdez's GIDP percentage this year since he's grounded into a downright silly amount so far.
    I know in splits, I can see how many PA he's had with runners on 1st, 1st and 2nd, etc but that doesn't tell me the outs, so I'd need to be able eliminate the 2 outs situations.

    Any way to find this out?

  13. @5 I'm still working on it. I thought I had it, but sadly I didn't.
    @8 PI is limited to find most hits in first x games not AB. (If you need elaboration, please let me know).
    @10 I don't think that can easily be done with PI.
    @12 I think what you looking for is on the splits page. There is a split runner on 1st lt2 outs.

    Split G GS PA AB R H 2B 3B HR RBI SB CS BB SO BA OBP SLG OPS TB GDP HBP SH SF IBB ROE BAbip tOPS+ sOPS+
    on 1st, lt 2 out 27 35 33 8 0 0 0 1 2 0 0 3 .242 .242 .242 .485 8 11 0 2 0 0 0 .267 61 28
    Provided by Baseball-Reference.com: View Original Table
    Generated 6/20/2010.

    If not you could use the PI event finder. (If you want me to elaborate, please let me know.)

    Jennifer, I'll answer your question later.

  14. @11. Not automatically. However you can decide which season you want removed and have the site add it up. Basically you need to take the player's page url and add # followed by the seasons you want included separated by a comma followed by the word sum. You would then hit enter and refresh the page.
    Matt Cains career stats without the 2006 season would look like this:
    http://www.baseball-reference.com/players/c/cainma01.shtml#2005,2007,2008,2009,2010,sum

    The same thing can be done with the gamelogs using career games instead of seasons. However, it does not work with both a range and a list (1-6,8) or more than one range (1-6,8-25). As a result you would have to type in every game of the season. This can be a bit tedious, which is where PI comes into play.

    Suppose we wanted to find Matt Cain's stats for 2009 with his wort game removed. We can figure out that his worst game score was 16 and use the Cain Pitching Game finder to search for all games by Cain in 2009 with a gamescore of at least 17. If you select Find players with most matching games in a season, the PI will add all those games together and give the totals for the most basic stats from those games.

  15. Chipmaker Says:

    @9 -- not so. There is a <= option but not a pure < option. Using the <= captures all the zero days reset appearances, of which there are many more, thus defeating the goal.

  16. Chipmaker Says:

    Just ignore that last one. Was reading pre-coffee.

  17. @2

    Specifically, I am wondering who has played the most MLB games without ever being named to an All-Star team - or, alternatively, without ever having played in one.)

    I think it's Tony Phillips: 2,161 games, 0-time All-Star

  18. How do you search for Grand Slams with the play index?

  19. @18
    Use the Batting or Pitching Event Finder.
    Search for all teams / homeruns
    Filter the search for bases 123.
    Repeat for each year.

  20. Priceless. Thank you

  21. @10, the record for most hits by a player who got all his team's hits is 4. Three players have done that, and none of them cycled. Kid Elberfeld, 1 Aug 1903, 4 singles; Billy Williams, 5 Sept 1969, 2 doubles and two homers (which, of course, is better than hitting for the cycle); Miguel Tejada, 23 Apr 2006, 3 singles and a home run. This came from the Sporting News Record Book, not the PI.

  22. How can I search for stats in the season finders based on a players 1st year with a team (as opposed to first year overall)

  23. There should be a way to separate extra inning stats from regulation game stats.

  24. How would I find out how many teams have lost 50 (or more) of their first 69 games ..... which Baltimore has just done....

  25. @22 I don't think that you can.
    @23 While its probably not as extensive as you'd like you can separate extra inning stats on the splits page (listed under by inning) Like most splits, these are not yet searchable. However you can isolate extra inning events with the event finder.

  26. @24 You can use the streaks finder ( http://www.baseball-reference.com/games/streaks.shtml ) found under Game results search tools.

    Set: Games in Streak to 69.
    Year - All Years
    Team - All Teams
    Order by losses
    and select from beginning of the season only.

  27. Thanks Raphy.

  28. The Pirates have had just 1 starter win a game in almost a month...
    How can I find a record for most consecutive games in which a team's starting pitcher did not win a game (not just an individual pitcher, but the team as a whole)

  29. Dave -As far as I know this can not be done. Although, I have never wanted to do this specific search, I have long wanted to do many similar searches.
    As for you question, you may want to look at teams in this list:
    http://bbref.com/pi/shareit/5r3c4

  30. Then I guess there's no easy way to find seasons in which a team's relievers had more wins than the starters

  31. I don't for sure. The one thing that I know of is that you can do that easily on a year-by year basis. If you look at the league wide starting pitcher page the information is available.
    http://www.baseball-reference.com/leagues/MLB/2010-starter-pitching.shtml

    Tm R/G G GS Wgs Lgs ND Wchp Ltuf Wtm Ltm tmW-L% Wlst Lsv CG SHO QS QS% GmScA Best Wrst BQR BQS sDR lDR RS/GS RS/IP IP/GS Pit/GS <80 80-99 100-119 ≥120 Max
    ARI 5.81 73 73 20 28 25 7 8 28 45 .384 7 5 1 0 35 48% 49 84 -5 84 37 0 25 4.8 4.9 6.2 102 5 21 43 4 126
    ATL 4.00 73 73 26 24 23 5 7 42 31 .575 6 11 2 0 40 55% 51 81 -2 72 24 2 29 5.0 4.3 5.9 93 11 33 28 1 121
    BAL 5.36 72 72 13 39 20 4 14 20 52 .278 8 8 1 0 32 44% 45 78 14 130 50 1 29 3.4 3.1 5.8 98 9 24 38 1 120
    BOS 4.68 74 74 35 18 21 7 4 44 30 .595 8 8 2 1 40 54% 51 84 -1 109 33 1 37 5.6 5.6 6.2 104 3 15 52 4 124
    CHC 4.46 72 72 23 29 20 5 14 32 40 .444 8 6 1 0 45 63% 53 84 9 89 25 1 37 4.2 4.1 6.1 98 8 25 32 7 129
    CHW 4.48 71 71 29 26 16 5 8 37 34 .521 3 5 2 1 40 56% 51 86 11 90 28 0 38 4.4 4.5 6.2 100 5 24 42 0 119
    CIN 4.55 73 73 26 19 28 5 3 40 33 .548 7 17 3 2 38 52% 50 93 9 102 45 0 35 4.9 4.6 6.2 102 1 24 45 3 121
    CLE 5.17 71 71 21 31 19 3 8 26 45 .366 7 8 6 1 34 48% 47 87 14 116 29 0 41 4.2 4.1 6.0 99 5 25 41 0 117
    COL 4.01 72 72 30 20 22 3 1 38 34 .528 3 10 4 2 38 53% 52 88 9 104 28 1 46 4.7 4.8 6.0 97 5 37 26 4 128
    DET 4.49 71 71 23 26 22 7 7 39 32 .549 2 13 2 1 32 45% 48 88 4 120 42 2 39 4.6 4.4 5.8 97 7 31 30 3 125
    FLA 4.46 72 72 30 24 18 4 8 35 37 .486 8 9 3 0 42 58% 52 88 19 95 31 1 32 4.9 5.0 6.0 96 8 33 30 1 121
    HOU 5.04 73 73 17 40 16 3 16 28 45 .384 6 8 1 0 40 55% 49 82 5 86 33 0 39 3.5 3.5 6.0 100 7 22 40 4 124
    KCR 5.00 73 73 20 29 24 5 7 30 43 .411 9 9 4 0 35 48% 47 77 -1 131 45 0 35 4.5 4.4 5.8 97 8 30 33 2 128
    LAA 4.87 75 75 33 29 13 5 4 41 34 .547 5 2 7 2 41 55% 50 84 2 87 40 1 30 4.8 5.1 6.1 104 3 16 55 1 120
    LAD 4.58 72 72 25 26 21 8 10 39 33 .542 5 10 0 0 36 50% 51 84 17 121 60 5 32 4.7 4.6 5.7 96 10 29 32 1 120
    MIL 5.26 72 72 21 26 25 7 7 32 40 .444 6 7 2 2 31 43% 48 89 9 87 29 4 32 4.9 4.7 5.6 100 5 26 36 5 130
    MIN 4.04 72 72 33 26 13 4 5 40 32 .556 4 5 3 0 40 56% 50 84 10 86 22 0 46 4.7 5.0 6.2 94 11 36 24 1 123
    NYM 3.92 72 72 28 17 27 3 2 41 31 .569 6 8 1 1 39 54% 51 91 4 94 32 2 36 4.7 4.4 5.8 97 8 23 40 1 123
    NYY 4.07 72 72 38 19 15 5 4 45 27 .625 7 4 2 0 41 57% 54 80 12 70 22 1 37 5.7 5.4 6.3 99 8 23 41 0 117
    OAK 4.28 74 74 23 27 24 4 10 34 40 .459 1 9 2 1 41 55% 51 93 4 102 30 1 24 4.0 3.6 5.8 93 10 44 20 0 117
    PHI 4.24 70 70 30 24 16 8 9 38 32 .543 4 8 7 4 37 53% 52 98 -1 66 18 0 40 4.8 5.1 6.4 100 6 21 40 3 132
    PIT 5.61 72 72 12 39 21 3 5 25 47 .347 7 8 0 0 28 39% 42 72 11 94 33 2 34 3.3 3.6 5.3 89 19 37 16 0 115
    SDP 3.32 72 72 29 23 20 7 5 42 30 .583 7 6 1 1 38 53% 54 91 15 61 11 2 36 4.1 4.5 5.9 96 4 40 28 0 117
    SEA 4.25 72 72 21 25 26 2 6 30 42 .417 6 7 6 1 44 61% 54 82 9 77 31 0 32 3.5 3.7 6.4 98 6 26 39 1 128
    SFG 3.58 71 71 29 23 19 2 7 39 32 .549 4 10 4 2 45 63% 56 94 12 111 28 0 43 4.3 3.8 6.3 102 5 23 38 5 123
    STL 3.60 72 72 31 20 21 3 9 40 32 .556 3 12 3 1 48 67% 55 90 12 77 19 0 29 4.4 4.1 6.2 97 11 26 35 0 118
    TBR 3.86 72 72 34 24 14 7 10 43 29 .597 2 9 3 2 46 64% 53 88 3 95 23 1 40 5.2 5.1 6.3 100 4 23 44 1 121
    TEX 4.31 72 72 26 18 28 7 4 44 28 .611 5 13 4 0 35 49% 51 90 18 95 28 1 35 5.3 5.7 5.8 102 5 15 48 4 127
    TOR 4.33 73 73 28 22 23 3 4 39 34 .534 6 6 2 1 42 58% 53 88 5 94 36 0 32 4.8 4.9 6.1 97 5 28 40 0 116
    WSN 4.59 73 73 19 24 30 6 7 33 40 .452 8 9 1 1 34 47% 47 80 11 114 44 1 32 4.2 4.6 5.6 91 13 42 17 1 123
    LgAvg 4.48 72 72 26 26 21 5 7 36 36 .500 6 8 3 1 39 53% 51 98 -5 95 32 1 35 4.5 4.5 6.0 98 7 27 36 2 4
    4.48 2168 2168 773 765 630 147 213 1084 1084 .500 168 250 80 27 1157 53% 51 98 -5 2859 956 30 1052 4.5 4.5 6.0 98 215 822 1073 58 132
    Tm R/G G GS Wgs Lgs ND Wchp Ltuf Wtm Ltm tmW-L% Wlst Lsv CG SHO QS QS% GmScA Best Wrst BQR BQS sDR lDR RS/GS RS/IP IP/GS Pit/GS <80 80-99 100-119 ≥120 Max
    Provided by Baseball-Reference.com: View Original Table
    Generated 6/25/2010.

    Wgs is wins by starters and in the case of team totals Wtm will be total team wins.

  32. In case anybody come back to this...
    The Pirates seem to be on their way to losing tonight. They have just 1 run against the Cubs on the road. If they do not score another run tonight, their run total in the most recent 4 games at the Cubs (starting tonight and going backwards) will be 1-2-3-4

    How great would it be to devise a way to search for streaks like that? Most consecutive games (in any manner) to score in progressive run amounts forward or backward.
    First game, 0 runs. Next game, 1 run. Next game, 2 runs. Next game, 3 runs...