import csv import numpy as np # 打开 CSV 文件并读取数据 with open('data.csv', 'r') as csvfile: csvreader = csv.reader(csvfile) data = [row for row in csvreader] # 将数据转换为 NumPy 数组 data_array = np.array(data, dtype=np.float32) #存储 np.save('data_array.npy', data_array) #加载并存储在该变量中 loaded_data_array = np.load('data_array.npy')