Feb-21-2021, 05:51 AM
(This post was last modified: Feb-21-2021, 06:05 AM by GerardMoussendo.)
(Feb-20-2021, 03:44 PM)eddywinch82 Wrote: Hi GerardMoussendo,
Could you post the Full Code ?
It would help me, with coming up with a solution for you.
Regards
Eddie Winch
Here is my entire code:
import numpy as np import pylab import matplotlib.pyplot as plt import pandas as pd data = np.memmap("F:\data.pcm", dtype='h', mode='r') print("VALUES:", data) pylab.plot(data) pylab.show() np.save("data_signal.npy", data) l = np.load("data_signal.npy") # print(l) s = np.arange(len(l)).reshape(-1,5) print(s) pylab.plot(s) pylab.show()Now, it seems like
Quote:s = np.arange(len(l)).reshape(-1,5)can work right? But how can I save the
s
reshaped data? I am having difficulty saving it in .npy
After reshaped, I have this result below:
Quote:[[ 0 1 2 3 4]
[ 5 6 7 8 9]
[ 10 11 12 13 14]
...
[1583985 1583986 1583987 1583988 1583989]
[1583990 1583991 1583992 1583993 1583994]
[1583995 1583996 1583997 1583998 1583999]]