For what it's worth, I did a quick photo of my C-64 and VIC-20 keyboards, so it's very easy to see the physical grouping of the various graphics/symbols.
Commodore C-64 Keyboard:
Commodore VIC-20 Keyboard:
The "PETSCII" encoding is based on keyboard positions of the original PET chicklet keyboard (*1):
(Taken from Wikipedia)
The keyboard is made similar to basic typewriter keyboards, but ordered in a square fashion, including a top row of symbols but not numbers and a separate numeric keyboard. By every key holding only a single ASCII equivalent ...
I think the codes were laid out so that when laid out sensibly on the PET keyboard, the shifted and unshifted forms of each key would have a consistent relationship. When the VIC-20 reduced the number of keys but added the Commodore key, this made it necessary to rearrange the placement of graphics on the keys; since Commodore kept the same arrangement of ...