In [5]:
from numpy import loadtxt, where
from pylab import scatter, show, legend, xlabel, ylabel

data = loadtxt('input/data1.txt')
print(data)

X = data[:,0:2]
y = data[:, 2]

pos = where(y == 1) 
neg = where(y == 0)
scatter(X[pos, 0], x[pos, 1], marker='0', c='b')
scatter(X[neg, 0], X[neg, 1], marker='x', c='r')
xlabel('Feature1/Exam 1 score')
ylabel('Feature2/Exam 2 score')
legend(['Fail', 'Pass'])
show()


---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-31cafd6b067e> in <module>()
      2 from pylab import scatter, show, legend, xlabel, ylabel
      3 
----> 4 data = loadtxt('input/data1.txt')
      5 print(data)
      6 

C:\Programs\Anaconda3\lib\site-packages\numpy\lib\npyio.py in loadtxt(fname, dtype, comments, delimiter, converters, skiprows, usecols, unpack, ndmin)
    928 
    929             # Convert each value according to its column and store
--> 930             items = [conv(val) for (conv, val) in zip(converters, vals)]
    931             # Then pack it according to the dtype's nesting
    932             items = pack_items(items, packing)

C:\Programs\Anaconda3\lib\site-packages\numpy\lib\npyio.py in <listcomp>(.0)
    928 
    929             # Convert each value according to its column and store
--> 930             items = [conv(val) for (conv, val) in zip(converters, vals)]
    931             # Then pack it according to the dtype's nesting
    932             items = pack_items(items, packing)

C:\Programs\Anaconda3\lib\site-packages\numpy\lib\npyio.py in floatconv(x)
    657         if b'0x' in x:
    658             return float.fromhex(asstr(x))
--> 659         return float(x)
    660 
    661     typ = dtype.type

ValueError: could not convert string to float: b'34.62365962451697,78.0246928153624,0'

In [ ]: