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

The csv file opens and I can use it as a numpy array when I specify delimiter to be ,

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

But if delimiter is ; it does not open

This error comes:

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',dtype = None,delimiter = ';')
Sreekant Shenoy
  • 1,420
  • 14
  • 23
  • Maybe the semicolon is just the wrong delimiter for the file? The error is actually only a warning about unspecified encoding. – Michael Butscher Apr 21 '21 at 04:00
  • Try adding a `encoding=None` parameter to your `genfromtxt` call. But regardless, the choice of delimiter has to match the file. We can't help without seeing a sample. – hpaulj Apr 21 '21 at 04:08

0 Answers0