to_dict(orent='records') converted to strange dict
Dear gurus,
I am trying to convert a DataFrame to dict and then to json. However, json.dumps or simplejson.dumps kept reporting error "TypeError: _ is not JSON serializable". I created a small code to reproduce the problem. Just copy and paste to run those codes:

df1=pd.DataFrame([{'t1':1,'t2':0}])
dict1=df1.to_dict(orient='records')
simplejson.dumps(dict1)
dict2=[{'t1':1,'t2':0}]
simplejson.dumps(dict2)

My execution resulted in : 

> > > df1=pd.DataFrame([{'t1':1,'t2':0}])
> > > df1
> > > Out[17]: 
> > >    t1  t2
> > > 0   1   0
> > > dict1=df1.to_dict(orient='records')
> > > dict1
> > > Out[19]: [{'t1': 1, 't2': 0}]
> > > simplejson.dumps(dict1)

Traceback (most recent call last):
  File "C:\Anaconda27\lib\site-packages\IPython\core\interactiveshell.py", line 3035, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-20-f990fefe9c5f>", line 1, in <module>
    simplejson.dumps(dict1)
  File "C:\Anaconda27\lib\site-packages\simplejson__init__.py", line 354, in dumps
    return _default_encoder.encode(obj)
  File "C:\Anaconda27\lib\site-packages\simplejson\encoder.py", line 262, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Anaconda27\lib\site-packages\simplejson\encoder.py", line 340, in iterencode
    return _iterencode(o, 0)
  File "C:\Anaconda27\lib\site-packages\simplejson\encoder.py", line 239, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: 0 is not JSON serializable

> > > dict2=[{'t1':1,'t2':0}]
> > > simplejson.dumps(dict2)
> > > Out[22]: '[{"t2": 0, "t1": 1}]'

I can not figure out why dict1 can not be converted to json, but dict2 can be.

can anyone help?
