Skip to content

Instantly share code, notes, and snippets.

@mosluce
Created February 13, 2018 02:02
Show Gist options
  • Save mosluce/9ab9d19911b7c56de853a385c3f8083b to your computer and use it in GitHub Desktop.
Save mosluce/9ab9d19911b7c56de853a385c3f8083b to your computer and use it in GitHub Desktop.
from keras.models import Sequential
from keras.layers import Dense
import numpy
numpy.random.seed(7)
dataset = numpy.loadtxt("pima-indians-diabetes.csv", delimiter=",")
# 因為不太懂這樣的用法,所以用下面的程式來實驗...
X = dataset[:,0:8]
Y = dataset[:,8]
d = [[1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 5, 6, 7, 8, 9]]
# 下面這行出錯
d1 = d[:,0:3]
# 這行也是
d2 = d[:,3]
print(d1)
print(d2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment