519087基金后端收费代码
萌萌^ω^
2024-05-10 11:20:19
最佳回答
void read_csv(string& csvpath,vector& trainpath,vector& label,char separator = ';'){ string line,path,classlabel; ifstream file(csvpath.c_str(),ifstream::in); while (getline(file,line)) { stringstream lines(line); getline(lines,path,separator); getline(lines,classlabel); if (!path.empty()&&!classlabel.empty()) { trainpath.push_back(path); label.push_back(atoi(classlabel.c_str())); } } 20210311