I currently have a .npy file and I would like to store the data it contains in a variable in order to convert it to a dataframe.
I tried using the following:
data_array=np.load('Jason1Data_Full_East_West.npy')
df = pd.DataFrame(data_array)
However my dataframe came out as a single column. How do I save the data in a format where the columns are clearly separated with now square brackets around the rows?
Even your question is not clear. You can try the following:
path = .../Jason1Data_Full_East_West.npy
data = np.load(path)
And then you need to convert it to dataframe as the following:
pd.DataFrame({'Data':data.tolist()})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.