pydata/pandas — pull request #2752 by jreback (2013-01-25 13:55:02+00:00)
Title: BUG: various bug fixes for DataFrame/Series construction

0 and 1 len ndarrays not inferring dtype correctly
datetimes that are single objects not inferring dtype
mixed datetimes and objects (GH #2751), casting datetimes to object
```
In [7]: pd.DataFrame({'A' : 1, 'B' : 'foo', 'C' : 'bar',
'D' : pd.Timestamp("20010101"),
'E' : datetime.datetime(2001,1,2,0,0) }, index=np.arange(5)).get_dtype_counts()
Out[7]:
datetime64[ns] 2
int64 1
object 2

In [11]: pd.DataFrame({'a': 1., 'b': 2, 'c': 'foo',
'float64' : np.array([1.]*10,dtype='float64'),
'int64' : np.array([1]*10,dtype='int64')}, index=np.arange(10)).get_dtype_counts()
Out[11]:
float64 2
int64 2
object 1

In [15]: pd.DataFrame({'a': 1., 'b': 2, 'c': 'foo',
'float64' : np.array([1.]*10,dtype='float64'),
'int64' : np.array([1]*10,dtype='int64')}, index=np.arange(10)).get_dtype_counts()
Out[15]:
float64 2
int64 2
object 1

In [16]: pd.DataFrame({'a':[1,2,4,7], 'b':[1.2, 2.3, 5.1, 6.3],
'c':list('abcd'),
'd':[datetime.datetime(2000,1,1) for i in range(4)] }).get_dtype_counts()
Out[16]:
datetime64[ns] 1
float64 1
int64 1
object 1
```