python读取文本数据到矩阵_Python读取数据文件转存成矩阵形式

2017-06-16     浏览次数:

def load_data():
    train = numpy.loadtxt(open("D:\\dev_src\\python\\weibo_keywords\\extra_dict\\word_feature_train.csv", "rb"), delimiter=",", skiprows=0)
    test = numpy.loadtxt(open("D:\\dev_src\\python\\weibo_keywords\\extra_dict\\word_feature_test.csv", "rb"), delimiter=",", skiprows=0)

    train_x = train[:,0:2]
    train_y = train[:,2]
*转载请注明出处,更多资料尽在 吾爱编程
返回吾爱编程首页