from numpy import loadtxt
from urllib.request import urlopen
url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data'
datos_np = urlopen(url)
dataset = loadtxt(datos_np, delimiter=",")
print(dataset.shape)
ValueError Traceback (most recent call last) in () 4 url = 'http://archive.ics.uci.edu/ml/machine-learning-databases/abalone/abalone.data' 5 datos_np = urlopen(url) ----> 6 dataset = loadtxt(datos_np, delimiter=",") 7 print(dataset.shape) 8
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin, encoding) 1099 # converting the data 1100 X = None -> 1101 for x in read_data(_loadtxt_chunksize): 1102 if X is None: 1103 X = np.array(x, dtype)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\npyio.py in read_data(chunk_size) 1026 1027 # Convert each value according to its column and store -> 1028 items = [conv(val) for (conv, val) in zip(converters, vals)] 1029 1030 # Then pack it according to the dtype's nesting
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\npyio.py in (.0) 1026 1027 # Convert each value according to its column and store -> 1028 items = [conv(val) for (conv, val) in zip(converters, vals)] 1029 1030 # Then pack it according to the dtype's nesting
~\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\lib\npyio.py in floatconv(x) 744 if '0x' in x: 745 return float.fromhex(x) --> 746 return float(x) 747 748 typ = dtype.type
ValueError: could not convert string to float: 'M'