Q: What is the ruling of shaving only a part of the head?
A: Shaving the nape without reason is disliked.
A justifiable reason would be for the purposes of hijamah (blood-letting) or due to skin irritation or a sore.
Shaving a part of the head while leaving a part unshaved is also disliked and is known as qaz'a/قزع.
This includes shaving the top and leaving the sides (a Christian practice known as tonsure), shaving the sides and leaving the top (like a mohawk), and shaving either the front and leaving the back or vice versa.
You should either shave it entirely or leave it.
It is important to note that shaving is the complete removal of hair with a razor and is not the same as trimming the hair short.
Allah knows best.
Source: Sharh al-Muntaha & Kashshaf al-Qina'