Skip to content
Snippets Groups Projects
Commit ecc3efad authored by tomrink's avatar tomrink
Browse files

snapshot...

parent 8b5f563a
No related branches found
No related tags found
No related merge requests found
...@@ -1244,6 +1244,21 @@ def split_data(num_obs, perc=0.2, skip=1, shuffle=True): ...@@ -1244,6 +1244,21 @@ def split_data(num_obs, perc=0.2, skip=1, shuffle=True):
return train_idxs[::skip], test_idxs[::skip] return train_idxs[::skip], test_idxs[::skip]
def normalize(data, param, mean_std_dict):
if mean_std_dict.get(param) is None:
return data
mean, std = mean_std_dict.get(param)
data -= mean
data /= std
not_valid = np.invert(np.isnan(data))
data[not_valid] = 0
return data
def test(filename, skip=1): def test(filename, skip=1):
h5f = h5py.File(filename, 'r') h5f = h5py.File(filename, 'r')
time = h5f['time'] time = h5f['time']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment