|
@@ -6,23 +6,25 @@ import scipy.io
|
|
|
|
|
|
def generate_data():
|
|
|
|
|
|
- st = []
|
|
|
- times = []
|
|
|
+ times_int = []
|
|
|
+ times_float = []
|
|
|
|
|
|
np.random.seed(1138)
|
|
|
for i in range(3):
|
|
|
- times.append([np.random.randint(0, 100) for x in range(1, 21)])
|
|
|
- st.append(SpikeTrain(times[i], units='ms', t_start=0*pq.ms, t_stop=1000*pq.ms))
|
|
|
+ times_int.append(np.random.randint(0, 100, 20).tolist())
|
|
|
+ times_float.append([round(np.random.uniform(0, 100), 3) for x in range(20)])
|
|
|
|
|
|
- print(times)
|
|
|
- #print(st)
|
|
|
- times_np = np.array(times)
|
|
|
- #print(type(times_np))
|
|
|
+ for elem in times_int:
|
|
|
+ elem = elem.sort()
|
|
|
+ for elem in times_float:
|
|
|
+ elem = elem.sort()
|
|
|
|
|
|
- return times_np
|
|
|
+ print(times_int)
|
|
|
+ print(times_float)
|
|
|
+ return times_int, times_float
|
|
|
|
|
|
-times = generate_data()
|
|
|
+times_int, times_float = generate_data()
|
|
|
|
|
|
data_folder = '../data/'
|
|
|
-np.save(data_folder + 'times.npy', times) #delete file before saving
|
|
|
-scipy.io.savemat(data_folder + 'times.mat', {"times": times})
|
|
|
+np.save(data_folder + 'times.npy', times_int, times_float) #delete file before saving
|
|
|
+scipy.io.savemat(data_folder + 'times.mat', {"times_int": times_int, "times_float": times_float})
|