Pittsburgh is America’s 10th best baseball city, according to a study released Wednesday by personal finance website WalletHub.

The website studied 363 cities that contained at least one pro or college baseball team — including minor league affiliates — and analyzed 31 factors that included on-field performance, ticket prices and stadium access. New York, home to the Yankees and Mets, ranked first. The Yankees earned a wild-card berth this season in large part because of the contributions of young stars Aaron Judge and Gary Sanchez before losing to the Houston Astros in a seven-game American League Championship Series.

Los Angeles ranked third. The Dodgers are facing the Astros in the World Series and have Clayton Kershaw, one of the best players in the sport, on their roster, but due to a stalemate between Charter Communications and DirecTV, many fans in the market cannot see the SportsNet LA broadcasts.

The Pirates finished worse than .500 for a second consecutive year, at 75-87, after making the playoffs from 2013-15.

Advertise with us

St. Louis, home to he Pirates’ division rival Cardinals, ranked second. The Cardinals are perennial competitors but finished 83-79 this year. San Francisco ranked fourth; like the Cardinals, Giants fans, who saw three World Series championships in a six-year span beginning in 2010, are loyal and vigorous, and despite the team losing 98 games this year, the ballpark is one of the best in baseball.

Division rivals Cincinnati and Chicago finished ahead of the Pirates. Chicago has the Cubs, coming off their first World Series in 108 years last season, and the White Sox, who are rebuilding. Kansas City and Detroit finished behind the Pirates in 11th and 12th.

PNC Park finished as the fifth most accessible stadium. Cincinnati’s Great American Ball Park was first, St. Louis’ Busch Stadium second.

WalletHub ranked cities with a major league team on a 70-point weighted scale that factored in number of teams, their performance, championships, division titles, Hall of Fame “head coaches” [they’re known as managers in baseball and only one, Minnesota Twins manager Paul Molitor, is in the Hall of Fame], ticket price, coaching staff turnover, stadium capacity and attendance.

Bill Brink: bbrink@post-gazette.com.