text: # execfile("read.py")
  
  
  import numpy as np	
  import pandas as pd
  
  def get_data(limit=None):
      print("Reading data...")
      df = pd.read_csv('train.csv')
      data = df.as_matrix()
      np.random.shuffle(data)
      X = data[:, 1:] / 255.0 # data is from 0..255
      Y = data[:, 0]
      if limit is not None:
          X, Y = X[:limit], Y[:limit]
      return X, Y
  
  
  def get_xor():
      X = np.zeros((200, 2))
      X[:50] = np.random.random((50, 2)) / 2 + 0.5 # (0.5-1, 0.5-1)
      X[50:100] = np.random.random((50, 2)) / 2 # (0-0.5, 0-0.5)
      X[100:150] = np.random.random((50, 2)) / 2 + np.array([[0, 0.5]]) # (0-0.5, 0.5-1)
      X[150:] = np.random.random((50, 2)) / 2 + np.array([[0.5, 0]]) # (0.5-1, 0-0.5)
      Y = np.array([0]*100 + [1]*100)
      return X, Y
  