Keras can take data directly from a numpy array in addition to preexisting datasets.
Load data from a CSV file
How to do it...
Let's take an existing .csv file from the internet and use it to create a Keras dataset:
dataset = numpy.loadtxt("https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.data.csv", delimiter=",")
# split into input (X) and output (Y) variables
X = dataset[:,0:8]
Y = dataset[:,8]
Note that the dataset can be directly loaded from the URL with the .csv file.
The output of the preceding code is listed in the following snippet:
[ 6. 148. 72. 35. 0. 33.6 0.627 50. ]
1.0