CSV 未使用分隔符打开;但使用分隔符打开,使用 genfromtxt

问题描述

data = genfromtxt('C:\\Users\\DELL\\Desktop\\ML\\melb_data.csv',dtype = None,delimiter = ',')

csv 文件打开,当我将分隔符指定为 时,我可以将其用作 numpy 数组,

data2 = genfromtxt('C:\\Users\\DELL\\Desktop\\ML\\melb_data.csv',delimiter = ';')

但是如果分隔符是 ;打不开

这个错误来了:

ipython-input-97-952ac6f6baeb>:1: VisibleDeprecationWarning: Reading unicode strings without specifying the encoding argument is deprecated. Set the encoding,use None for the system default.
  data2 = genfromtxt('C:\\Users\\DELL\\Desktop\\ML\\melb_data.csv',delimiter = ';')

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)