I have a 2D array of integer value:

```
[[26, 9, 24, 13],
 [16, 14, 39, 29]]

```

I need to select the number >= 14, ends in 9 or 4, and not 39. It returns 1 if the criteria meets, otherwise return 0, i.e.

```
[[0, 0, 1,0],
 [0,0,0,1]]

```

updated: code suggested by Tomothy32

```
result = result = [[int(x >= 14 and x % 10 in (4, 9) and x != 19) for x in sl] for sl in X]

```

another nested loop approach

```
def test(X):
    out = [[0]*len(X[0]) for _ in range(len(X))]
    for i in range(len(X)):
        for j in range(len(X[i])):
            check = X[i][j]
            if check>=14 and check%5==4 and check!=39:
                out[i][j] = 2
    return out

```