In [1]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
first just checking that the flattening and reshaping works as expected
In [13]:
test = np.random.randn(11,11,4,100)
test.shape
Out[13]:
In [14]:
test_flat = test.flatten()
test_flat.shape
Out[14]:
In [17]:
np.savetxt('test.txt', test_flat)
test_back = np.loadtxt('test.txt').reshape((11,11,4,100))
test_back.shape
Out[17]:
In [18]:
np.mean(test - test_back)
Out[18]:
looks good.