crypten_vfl_demo
crypten_vfl_demo copied to clipboard
数据预处理中遇到的问题
您好,在进行数据预处理这一步时,报错: ValueError: Number of passed names did not match number of header fields in the file 网上查询后的解决方案是: 使用names参数时,类似重命名。切记,要与原数据全部匹配:即不能多也不能少,多或者少都会抛出ValueError错误,所以,只需要补全所有的列标题名即可
但是在查看csv文件后,发现列数与names参数个数完全一致,请问您有这个问题吗?
我的确没遇到这个问题。 你可以把具体的报错贴出来?看一下是哪个文件的问题
感谢您的回复!报错如下
data_process.py:74: ParserWarning: Falling back to the 'python' engine because the 'c' engine does not support regex separators (separators > 1 char and different from '\s+' are interpreted as regex); you can avoid this warning by specifying engine='python'. df = pd.read_csv(filename, header=0, names=names, sep=r",\s+")
------以上是warning 不影响------
Traceback (most recent call last):
File "data_process.py", line 133, in
我尝试换了电脑 也尝试重新安装了pandas库 都没能成功
是不是adult.text.csv开头多了一行|1x3 Cross validator
?
你可以看一下,也许是这个问题
我一开始也是这个问题,用excel打开csv文件都会这样,重新下载文件之后用记事本打开编辑就没报错了,不知道什么原因