File size: 428 Bytes
29a525e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import numpy as np
import os

def create_dir(path):
    if not os.path.exists(path):
        try:
            os.makedirs(path)
        except OSError as e:
            print('Could not create directory:' + path)

def list_to_array(m):
  M = m[0]
  for i in range(1,len(m)):
    M = np.concatenate((M,m[i]), axis = 0)

  return M

def pickle(array, path, filename):
  create_dir(path)
  np.save(path+filename, array)
  return 0