Skip to content

Instantly share code, notes, and snippets.

@rain1024
Created August 18, 2014 04:12
Show Gist options
  • Save rain1024/38d012fb982597b51659 to your computer and use it in GitHub Desktop.
Save rain1024/38d012fb982597b51659 to your computer and use it in GitHub Desktop.
Sklearn
import numpy as np
f = open("filename.txt")
# skip the header
f.readline()
data = np.loadtxt(f)
# select columns 1 through end
X = data[:, 1:]
# select column 0, the stock price
y = data[:, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment