Nov-04-2018, 10:03 PM
Hi All,
I've just joined this forum, also new to Python, with background in other languages.
I've been trying a small piece of code below using jupyter ipython in notebooks.azure.com, the error is coming from the last call for np.reshape function which I'd used it previously with no problems, so your comment/tips would be much appreciated, many thanks:
I've just joined this forum, also new to Python, with background in other languages.
I've been trying a small piece of code below using jupyter ipython in notebooks.azure.com, the error is coming from the last call for np.reshape function which I'd used it previously with no problems, so your comment/tips would be much appreciated, many thanks:
import numpy as np import pandas as pd file = open("/home/nbuser/F-F_Research_Data_Factors_StrippedandCleaned.txt","r") data = file.readlines() f=[] index=[] for i in range(1,np.size(data)): t= data[i].split() index.append(int(t[0])) for j in range(1,5): k=float(t[j]) f.append(k/100) n=len(f) f1=np.reshape(f,[n/4,4]) f1and get the below:
Error:Attribute Error: 'list' object has no attribute 'reshape'