-
Notifications
You must be signed in to change notification settings - Fork 0
/
e2.py
31 lines (25 loc) · 787 Bytes
/
e2.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 7 12:56:21 2018
@author: nathansheng
Description:
"""
import numpy as np
import matplotlib.pyplot as plt
#Theme: e2
#Author: Nan Sheng
def e2(N):
length=np.size(N,0)
P=N[:,:4].astype(int)
M=np.zeros((7,7,7,7))
for i in np.arange(length):
M[P[i,0]-1,P[i,1]-1,P[i,2]-1,P[i,3]-1]=N[i,4]
M[P[i,1]-1,P[i,0]-1,P[i,2]-1,P[i,3]-1]=N[i,4]
M[P[i,0]-1,P[i,1]-1,P[i,3]-1,P[i,2]-1]=N[i,4]
M[P[i,1]-1,P[i,0]-1,P[i,3]-1,P[i,2]-1]=N[i,4]
M[P[i,2]-1,P[i,3]-1,P[i,0]-1,P[i,1]-1]=N[i,4]
M[P[i,3]-1,P[i,2]-1,P[i,0]-1,P[i,1]-1]=N[i,4]
M[P[i,2]-1,P[i,3]-1,P[i,1]-1,P[i,0]-1]=N[i,4]
M[P[i,3]-1,P[i,2]-1,P[i,1]-1,P[i,0]-1]=N[i,4]
return M