title: TypeError("Data type not understood") when trying to create a matrix
body: <p>I am trying to differentiate a set of equations using sympy and I have to create a 2x2 matrix with the derivatives I calculate. This is my code:</p>
  
  <pre><code>#import numpy as np
  from numpy import *
  from scipy import *
  from sympy import *
  
  x1 = 3; x2 = 0; x3 = 0; x4 = 3
  y1 = 3; y2 = 3; y3 = 0; y4 = 0
  
  s = Symbol('s')
  t = Symbol('t')
  
  N1 = (s+1)*(t+1)/4
  N2 = (1-s)*(t+1)/4
  N3 = (1-s)*(1-t)/4
  N4 = (s+1)*(1-t)/4
  
  x = (x1*N1)+(x2*N2)+(x3*N3)+(x4*N4)
  y = (y1*N1)+(y2*N2)+(y3*N3)+(y4*N4)
  
  dxs = diff(x, s)
  dxt = diff(x, t)
  dys = diff(y, s)
  dyt = diff(y, t)
  
  #print type(dxs).__name__
  
  print dxs, dxt, dys, dyt
  
  J = Matrix([dxs, dys], [dxt, dyt])
  #J = np.matrix((dxs, dys), (dxt, dyt))
  print J
  </code></pre>
  
  <p>However, I get a "data type not found" error. So, I tried using the type() function to print the data type of the derivatives I end up with. I got two different types. The type() returns 'Rational' when the final derivative is just numbers. It returns 'Add' when the final derivative has the variables 's' or 't' in it (This can be done by giving non zero values for x2, x3, y3 and y4). If anyone can help me with creating this matrix, I will be so thankful. I also tried using </p>
  
  <pre><code>J = Matrix[[dxs, dys], [dxt, dyt]]
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>J = Matrix((dxs, dys), (dxt, dyt))
  </code></pre>
  
  <p>and now I get 'type' object has no attribute <code>'__getitem__'</code> error. I am very new to python and I have tried all I could to find a solution to this online but I failed. Thank you for your help.</p>