-
Notifications
You must be signed in to change notification settings - Fork 0
/
3dspi.py
46 lines (26 loc) · 896 Bytes
/
3dspi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
"""
Created on Tue May 22 15:07:32 2018
@author: anind
"""
import numpy as np
def spi3d(np.array) -> np.array:
newarr = arr
for x in range(len(newarr)):
for y in range(len(newarr[x])):
cell = newarr[x][y]
modc = np.array([])
for z in range(len(cell)):
if cell[z] >= 0:
modc = np.append(modc,cell[z])
# modc = use_spi(modc)
modc = modc * 2
m = 0
n = 0
while m < len(cell) and n < len(modc):
if cell[m] >= 0:
cell[m] = modc[n]
n += 1
m += 1
newarr [x][y] = cell
return newarr