I have a `numpy` array of shape `(N,)` which contains N packed rgb values using the following formulation-

```
rgb = (r<<16) + (g<<8) + b

```

I am trying to unpack this array and then create a `numpy` array of shape `(N,3)` by using unpacked values. See below the code snippet-

```
import numpy as np
def unpack_rgb(rgb):
    b =  rgb & 255
    g = (rgb >> 8) & 255
    r =   (rgb >> 16) & 255
    return r, g, b

N = 10
c = (np.ones((N, 3)) * 255).astype(np.uint8)
for i in range(N):
    c[i, 0], c[i, 1], c[i, 2] = unpack_rgb(colors[i])

```

As shown above, `unpack_rgb` is used inside a `for` loop to assign color values to numpy array `c`. **I am looking for the pythonic way to unpack and create a new numpy array.**

The variable `colors` can be obtained by the following code-

```
from random import randint
def pack_rgb(r, g, b):
    rgb = (r<<16) + (g<<8) + b
    return rgb

colors = np.array([pack_rgb(randint(0, 255), randint(0, 255), randint(0, 255)) for _ in range(N)])

```