3

When I use

dataset = np.genfromtxt(open('data/train.csv','r'), delimiter=',', dtype='f8,str')[1:]

I obtain this error

TypeError: must be str or None, not bytes

Could you help me to find the solution?

Kara
  • 6,115
  • 16
  • 50
  • 57
Nacho
  • 35
  • 5

1 Answers1

1

Do not use open within np.genfromtxt:

dataset = np.genfromtxt('data/train.csv', delimiter=',', dtype='f8,str')[1:]
Neill Herbst
  • 2,072
  • 1
  • 13
  • 23