- Timestamp:
- May 28, 2016, 5:05:09 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r780 r784 1127 1127 return string 1128 1128 1129 def index_vec(vec,val): 1130 """ Function to provide the coordinates of a given value inside a vector 1131 index_vec(vec,val) 1132 vec= vector with values 1133 val= value to search 1134 >>> index_vec(np.arange(27),22) 1135 22 1136 """ 1137 1138 fname = 'index_vec' 1139 1140 vecv = np.array(vec) 1141 1142 for i in range(vecv.shape[0]): 1143 if vecv[i] == val: 1144 valpos = i 1145 break 1146 1147 return valpos 1148 1129 1149 def index_mat(mat,val): 1130 1150 """ Function to provide the coordinates of a given value inside a matrix
Note: See TracChangeset
for help on using the changeset viewer.