import numpy as np
path_train = r"D:\Program Files\MATLAB\orca-master\exampledata\1-holdout\toy\matlab\train_toy.0"
path_test = r"D:\Program Files\MATLAB\orca-master\exampledata\1-holdout\toy\matlab\test_toy.0"
trainData = np.loadtxt(path_train)
testData = np.loadtxt(path_test)
X_train = trainData[:,:-1]
y_train = trainData[:,-1]
X_test = testData[:,:-1]
y_test = testData[:,-1]
print(X_train.shape)
print(y_train.shape)
print(X_test.shape)
print(y_test.shape)
Python:使用numpy.loadtxt()函数读取无格式数据
最新推荐文章于 2024-05-21 19:41:37 发布