0
After saving array in txt I want to be able to work with each of the values doing all the mathematical manipulations, but the way q I am saving I am not getting. Someone can help me.
import numpy as np
xold = np.random.rand()
N = 3000
x0 = np.empty((N))
for k in range(N):
x_new = 4*xold*(1 - xold)
xold = x_new
x0[k] = x_new
comp = len(x0)
aux = x0 + 0.25*np.std(x0)*np.random.rand(1,comp)
x2 = aux[0]
x3 = x2[1000:]
#X = x3[:-1]
A = x3[:-1].transpose()
D = x3[1:]
#-------- SALVAR EM TXT ---------------|
np.savetxt('A.txt', A, newline='\n')
with open('A.txt','r') as arq:
aux = arq.read()
X = np.array([aux])
print(X[0])
print(type(X[0]))
print(X.shape)
That’s what I wanted to do. Thanks
– Ronaldo Souza