It's been a busy week for Canadian Pacific, the second largest Canadian railroad company, which has its U.S. headquarters in Minneapolis.

First the company said it was pulling out of a project to build rail in Wyoming and Montana coal country. It put up a "for sale" sign on 660 miles of track mostly in South Dakota, and said it will close or downgrade rail yards across its network.

Then, on Tuesday, the company announced it will lay off 4,500 workers, about 23 percent of its workforce, by 2016. Some 1,700 positions will be eliminated by the end of the year.

Investors have applauded the layoffs. Stock in the company rose 4 percent to $97.50 per share, an all-time high.

"We have only just started this journey to being a more competitive railway," said Hunter Harrison, Canadian Pacific's chief executive, who has called the company, which he took over this year, "top-heavy."

With regard to Minnesota, MPR reported, "It's unclear how many jobs will be lost in the state. But if the workforce reduction were spread evenly across the company, that would mean the loss of about 400 jobs in Minnesota."

The impact on Minnesota may not be that straightforward.

Canadian Pacific appears to be shifting traffic to the Twin Cities as its oil business in North Dakota grows. Remember, the reason CP gave up on building rail into the coal-rich Powder River Basin was that coal rail traffic has fallen 10 percent in 2012. Meanwhile, oil from the Bakken region of North Dakota is driving petroleum rail traffic, which is up 44 percent.

Harrison has told investors the company's rail yard in St. Paul will become a central hub for the company as it closes or downgrades similar rail yards in Montreal, Toronto, Winnipeg, Calgary and Chicago.