They are both fantastic cameras, So, as McMommy says, try handling them in a shop. You might want to check the price of their respective lenses that you plan on buying which could help you avoid an expensive mistake.
One interesting differentiating point is that the Pentax has "in-house" image stabilization which means you can use old legacy/manual lenses (maybe with an adapter) and still get image stabilization which is pretty awesome if you like messing around those or have a bunch of Takumar or Leica lenses lying around collecting dust.