How can I get the polyphase components of a signal
No, that's not right: 

Your polyphase components need to be ... well, phases of your signal, and hence, only take every $N$th component. What you do is something different.

To say "these are polyphase components of $h$", you need to define how many components you'll have. You're mixing different $N$s in your code, but overall, your code is just confused – it never selects the $N$th input samples. 

Hence, you'd need something like 

\begin{align}
p^4_0[n] &amp;= h[4n]\\
p^4_1[n] &amp;= h[4n+1]\\
p^4_2[n] &amp;= h[4n+2]\\
p^4_3[n] &amp;= h[4n+3]
\end{align}

for a $N=4$-phase polyphase decomposition of $h$ (of a specific type; "type" specifies in which order you take the $+0$,$+1$, $+2…$ components and declare them as $p_0$, $p_1$ and so on).

Feels like you need a better text book to start with! In English, the classic would be fred harris' Multirate Signal Processing for Communication Systems. It does an introduction that I'd explain differently these days, but I've worked with such systems a bit, and my initial understanding was guided by that book, so I consider it relatively good.