internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: pandas-dev/pandas

Issue:
Better error message in pandas.core.index
If sortlevel is called with an out-of-range level, the error message is a bit confusing, particularly if the level is equal to the maximum number of levels.

```
# Example from "Python for Data Analysys", page 148
import pandas as pd
import numpy as np
frame = pd.DataFrame(np.arange(12).reshape((4,3)), 
    index=[list('aabb'), [1, 2, 1, 2]], 
    columns=[['Ohio','Ohio','Colorado'],['Green','Red','Green']])
frame.sortlevel(2)

.
.
.

/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-     
packages/pandas/core/index.pyc in _get_level_number(self, level)
   1363             elif level >= self.nlevels:
   1364                 raise ValueError('Index has only %d levels, not %d'
-> 1365                                  % (self.nlevels, level))
   1366         return level
   1367 

ValueError: Index has only 2 levels, not 2
```



Discussion:

Resolving patch:
diff --git a/pandas/core/index.py b/pandas/core/index.py
--- a/pandas/core/index.py
+++ b/pandas/core/index.py
@@ -1364,9 +1364,10 @@ def _get_level_number(self, level):
                 raise Exception('Level %s not found' % str(level))
             elif level < 0:
                 level += self.nlevels
+            # Note: levels are zero-based
             elif level >= self.nlevels:
                 raise ValueError('Index has only %d levels, not %d'
-                                 % (self.nlevels, level))
+                                 % (self.nlevels, level + 1))
         return level
 
     _tuples = None


Test patch:
Repository: pandas-dev/pandas

Issue:
DataFrame.drop loses index name
http://stackoverflow.com/questions/15102158/pandas-why-does-dataframe-droplabels-return-a-dataframe-with-removed-label-na



Discussion:

Resolving patch:
diff --git a/pandas/core/generic.py b/pandas/core/generic.py
--- a/pandas/core/generic.py
+++ b/pandas/core/generic.py
@@ -340,7 +340,7 @@ def drop(self, labels, axis=0, level=None):
         dropped : type of caller
         """
         axis_name = self._get_axis_name(axis)
-        axis = self._get_axis(axis)
+        axis, axis_ = self._get_axis(axis), axis
 
         if axis.is_unique:
             if level is not None:
@@ -349,8 +349,13 @@ def drop(self, labels, axis=0, level=None):
                 new_axis = axis.drop(labels, level=level)
             else:
                 new_axis = axis.drop(labels)
+            dropped = self.reindex(**{axis_name: new_axis})
+            try:
+                dropped.axes[axis_].names = axis.names
+            except AttributeError:
+                pass
+            return dropped
 
-            return self.reindex(**{axis_name: new_axis})
         else:
             if level is not None:
                 if not isinstance(axis, MultiIndex):


Test patch:
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -5103,6 +5103,16 @@ def test_corrwith_series(self):
 
         assert_series_equal(result, expected)
 
+    def test_drop_names(self):
+        df = DataFrame([[1, 2, 3],[3, 4, 5],[5, 6, 7]], index=['a', 'b', 'c'], columns=['d', 'e', 'f'])
+        df.index.name, df.columns.name = 'first', 'second'
+        df_dropped_b = df.drop('b')
+        df_dropped_e = df.drop('e', axis=1)
+        self.assert_(df_dropped_b.index.name == 'first')
+        self.assert_(df_dropped_e.index.name == 'first')
+        self.assert_(df_dropped_b.columns.name == 'second')
+        self.assert_(df_dropped_e.columns.name == 'second')
+
     def test_dropEmptyRows(self):
         N = len(self.frame.index)
         mat = randn(N)
diff --git a/pandas/util/testing.py b/pandas/util/testing.py
--- a/pandas/util/testing.py
+++ b/pandas/util/testing.py
@@ -178,7 +178,8 @@ def assert_frame_equal(left, right, check_dtype=True,
                        check_index_type=False,
                        check_column_type=False,
                        check_frame_type=False,
-                       check_less_precise=False):
+                       check_less_precise=False,
+                       check_names=False):
     if check_frame_type:
         assert(type(left) == type(right))
     assert(isinstance(left, DataFrame))
@@ -204,6 +205,9 @@ def assert_frame_equal(left, right, check_dtype=True,
         assert(type(left.columns) == type(right.columns))
         assert(left.columns.dtype == right.columns.dtype)
         assert(left.columns.inferred_type == right.columns.inferred_type)
+    if check_names:
+        assert(left.index.names == right.index.names)
+        assert(left.columns.names == right.columns.names)
 
 
 def assert_panel_equal(left, right,
Repository: pandas-dev/pandas

Issue:
segmentation fault on groupby
```
import numpy as np
import pandas as pd
series = pd.Series([np.nan, np.nan, 1, 1, 2, 2, 3, 3, 4, 4])
bins = pd.cut(series.dropna(), 4)
# this works
series.dropna().groupby(bins).mean()
# but this results in: 
# [1]    42448 segmentation fault  python
series.groupby(bins).mean()
```

So, I can see why trying to group a series with bins based on a different (trimmed) series can't really work and don't consider that to be a bug, but it might be nice if `pandas` threw a proper error message instead of segfaulting.



Discussion:
Thou shalt not segfaulteth.

I'm not sure what I like more, the same-day pull request or the way you were able to summarize the issue in ten words while I was grasping to find the right way to explain things. Anyway, \o/


Resolving patch:
diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py
--- a/pandas/core/groupby.py
+++ b/pandas/core/groupby.py
@@ -1310,6 +1310,11 @@ def _get_grouper(obj, key=None, axis=0, level=None, sort=True):
             exclusions.append(gpr)
             name = gpr
             gpr = obj[gpr]
+
+        if (isinstance(gpr,Categorical) and len(gpr) != len(obj)):
+            errmsg = "Categorical grouper must have len(grouper) == len(data)"
+            raise AssertionError(errmsg)
+
         ping = Grouping(group_axis, gpr, name=name, level=level, sort=sort)
         groupings.append(ping)
 


Test patch:
diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py
--- a/pandas/tests/test_groupby.py
+++ b/pandas/tests/test_groupby.py
@@ -2237,6 +2237,15 @@ def test_groupby_first_datetime64(self):
         got_dt = result.dtype
         self.assert_(issubclass(got_dt.type, np.datetime64))
 
+    def test_groupby_categorical_unequal_len(self):
+        import pandas as pd
+        #GH3011
+        series = Series([np.nan, np.nan, 1, 1, 2, 2, 3, 3, 4, 4])
+        bins =  pd.cut(series.dropna(), 4)
+
+        # len(bins) != len(series) here
+        self.assertRaises(AssertionError,lambda : series.groupby(bins).mean())
+
 def assert_fp_equal(a, b):
     assert((np.abs(a - b) < 1e-12).all())
Repository: pandas-dev/pandas

Issue:
Issues updating the DateFrame from another DataFrame
http://stackoverflow.com/questions/15349795/pandas-dataframe-combine-first-and-update-methods-have-strange-behavior/15353297#15353297



Discussion:

Resolving patch:
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -3843,8 +3843,13 @@ def update(self, other, join='left', overwrite=True, filter_func=None,
 
                 if overwrite:
                     mask = isnull(that)
+
+                    # don't overwrite columns unecessarily
+                    if mask.all():
+                        continue
                 else:
                     mask = notnull(this)
+
             self[col] = np.where(mask, this, that)
 
     #----------------------------------------------------------------------


Test patch:
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -7265,6 +7265,19 @@ def test_update(self):
                               [1.5, nan, 7.]])
         assert_frame_equal(df, expected)
 
+    def test_update_dtypes(self):
+
+        # gh 3016
+        df = DataFrame([[1.,2.,False, True],[4.,5.,True,False]],
+                       columns=['A','B','bool1','bool2'])
+
+        other = DataFrame([[45,45]],index=[0],columns=['A','B'])
+        df.update(other)
+
+        expected = DataFrame([[45.,45.,False, True],[4.,5.,True,False]],
+                             columns=['A','B','bool1','bool2'])
+        assert_frame_equal(df, expected)
+
     def test_update_nooverwrite(self):
         df = DataFrame([[1.5, nan, 3.],
                         [1.5, nan, 3.],
Repository: pandas-dev/pandas

Issue:
string contains method doesn't respect na argument
It seems that the argument `na` doesn't remove the NaN with `str.contains` (see [previous issue](https://github.com/pydata/pandas/issues/1689)).

Using similar to example in [test added for na functionality](https://github.com/pydata/pandas/commit/7a1ea0a3d189b1be7cdd23a7b98f79effd381430):

```
In [1]: values = Series(['om', NA, 'foo_nom', 'nom', 'bar_foo', NA, 'foo'])

In [2]: values.str.contains('foo', na=False)
Out[2]: 
0    False
1      NaN
2     True
3    False
4     True
5      NaN
6     True

In [3]: values.str.startswith('foo', na=False)
Out[3]: 
0    False
1    False
2     True
3    False
4    False
5    False
6     True

```

_From [Stackoverflow question](http://stackoverflow.com/questions/14731714/value-error-when-slicing-in-pandas/14731958)._



Discussion:

Resolving patch:
diff --git a/pandas/core/strings.py b/pandas/core/strings.py
--- a/pandas/core/strings.py
+++ b/pandas/core/strings.py
@@ -154,7 +154,7 @@ def str_contains(arr, pat, case=True, flags=0, na=np.nan):
         If True, case sensitive
     flags : int, default 0 (no flags)
         re module flags, e.g. re.IGNORECASE
-    na : bool, default NaN
+    na : default NaN, fill value for missing values.
 
     Returns
     -------
@@ -688,7 +688,7 @@ def join(self, sep):
     @copy(str_contains)
     def contains(self, pat, case=True, flags=0, na=np.nan):
         result = str_contains(self.series, pat, case=case, flags=flags,
-                              na=np.nan)
+                              na=na)
         return self._wrap_result(result)
 
     @copy(str_replace)


Test patch:
diff --git a/pandas/tests/test_strings.py b/pandas/tests/test_strings.py
--- a/pandas/tests/test_strings.py
+++ b/pandas/tests/test_strings.py
@@ -128,6 +128,11 @@ def test_contains(self):
         self.assert_(result.dtype == np.bool_)
         tm.assert_almost_equal(result, expected)
 
+        # na
+        values = Series(['om', 'foo',np.nan])
+        res = values.str.contains('foo', na="foo")
+        self.assertEqual (res.ix[2], "foo"        )
+
     def test_startswith(self):
         values = Series(['om', NA, 'foo_nom', 'nom', 'bar_foo', NA, 'foo'])
Repository: pandas-dev/pandas

Issue:
MultiIndex xs failure on axis=1
``` python
In [40]: columns = pd.MultiIndex.from_tuples([('a', 'foo'), ('a', 'bar'), ('b', 'hello'), ('b', 'world')], names=['lvl0', 'lvl1'])

In [41]: df = pd.DataFrame(np.random.randn(4, 4), columns=columns)

In [42]: df
Out[42]:
lvl0         a                   b
lvl1       foo       bar     hello     world
0     2.560515  1.579242  0.727753  2.207781
1    -0.599632  0.254395  0.784745  0.340575
2     1.262004  0.409085 -0.229616  1.096679
3     1.637929 -0.694670 -0.356355  0.410580

In [43]: df.xs('a', level='lvl0', axis=1)
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)

<...>

<...>/lib/python2.7/site-packages/pandas-0.11.0.dev_14a04dd-py2.7-linux-x86_64.egg/pandas/core/internals.pyc in set_axis(self, axis, value)
    831         if len(value) != len(cur_axis):
    832             raise Exception('Length mismatch (%d vs %d)'
--> 833                             % (len(value), len(cur_axis)))
    834         self.axes[axis] = value
    835

Exception: Length mismatch (2 vs 4)

In [44]: df.xs('a', axis=1)
Out[44]:
lvl1       foo       bar
0     2.560515  1.579242
1    -0.599632  0.254395
2     1.262004  0.409085
3     1.637929 -0.694670

In [45]: pd.__version__
Out[45]: '0.11.0.dev-14a04dd'
```

```
[1227][i] uname -a
Linux xl-mec-03 2.6.18-308.11.1.el5 #1 SMP Fri Jun 15 15:41:53 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
```



Discussion:

Resolving patch:
diff --git a/pandas/core/frame.py b/pandas/core/frame.py
--- a/pandas/core/frame.py
+++ b/pandas/core/frame.py
@@ -2211,7 +2211,11 @@ def xs(self, key, axis=0, level=None, copy=True):
                 if labels.levels[lev_num].inferred_type == 'integer':
                     indexer = self.index[loc]
 
-            result = self.ix[indexer]
+            # select on the correct axis
+            if axis == 1:
+                result = self.ix[:, indexer]
+            else:
+                result = self.ix[indexer]
             setattr(result, result._get_axis_name(axis), new_ax)
             return result
 


Test patch:
diff --git a/pandas/tests/test_indexing.py b/pandas/tests/test_indexing.py
--- a/pandas/tests/test_indexing.py
+++ b/pandas/tests/test_indexing.py
@@ -714,6 +714,16 @@ def test_ix_general(self):
         df.sortlevel(inplace=True)
         df.ix[(4.0,2012)]
 
+    def test_xs_multiindex(self):
+
+        # GH2903
+        columns = MultiIndex.from_tuples([('a', 'foo'), ('a', 'bar'), ('b', 'hello'), ('b', 'world')], names=['lvl0', 'lvl1'])
+        df = DataFrame(np.random.randn(4, 4), columns=columns)
+        df.sortlevel(axis=1,inplace=True)
+        result = df.xs('a', level='lvl0', axis=1)
+        expected = df.iloc[:,0:2].loc[:,'a']
+        assert_frame_equal(result,expected)
+
 if __name__ == '__main__':
     import nose
     nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
Repository: pandas-dev/pandas

Issue:
BUG? Reshaping a Series
It looks to me like a bug in pandas.Series.

```
a = pd.Series([1,2,3,4])
b = a.reshape(2,2)
b
```

b has type Series but can not be displayed, the last statement gives exception, very lengthy, the last line is "TypeError: %d format: a number is required, not numpy.ndarray". b.shape returns (2,2), which contradicts its type Series. I am guessing perhaps pandas.Series does not implement reshape function and I am calling the version from np.array. I am at pandas 0.9.1. Some discussion on stackoverflow is here http://stackoverflow.com/questions/14390224/reshape-of-pandas-series

If it does not make sense to reshape a Series, should it throw an exception?



Discussion:

Resolving patch:
diff --git a/pandas/core/series.py b/pandas/core/series.py
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -923,6 +923,9 @@ def reshape(self, newshape, order='C'):
         """
         See numpy.ndarray.reshape
         """
+        if order not in ['C','F']:
+            raise TypeError("must specify a tuple / singular length to reshape")
+
         if isinstance(newshape, tuple) and len(newshape) > 1:
             return self.values.reshape(newshape, order=order)
         else:


Test patch:
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -932,6 +932,10 @@ def test_reshape_non_2d(self):
         x = Series(np.random.random(201), name='x')
         self.assertRaises(TypeError, x.reshape, (len(x),))
 
+        # GH 2719
+        a = Series([1,2,3,4])
+        self.assertRaises(TypeError,a.reshape, 2, 2)
+
     def test_reshape_2d_return_array(self):
         x = Series(np.random.random(201), name='x')
         result = x.reshape((-1, 1))
Repository: pandas-dev/pandas

Issue:
DatetimeIndex.resolution throws NameError
Attempting to retrieve the resolution attribute throws this exception:

``` python
34    @classmethod
35    def get_str(cls, reso):
36        return {RESO_US : 'microsecond',
37                    RESO_SEC : 'second',
38                    RESO_MIN: 'minute',
NameError: global name 'RESO_US' is not defined
```



Discussion:

Resolving patch:
diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py
--- a/pandas/tseries/frequencies.py
+++ b/pandas/tseries/frequencies.py
@@ -34,11 +34,11 @@ class Resolution(object):
 
     @classmethod
     def get_str(cls, reso):
-        return {RESO_US: 'microsecond',
-                RESO_SEC: 'second',
-                RESO_MIN: 'minute',
-                RESO_HR: 'hour',
-                RESO_DAY: 'day'}.get(reso, 'day')
+        return {cls.RESO_US: 'microsecond',
+                cls.RESO_SEC: 'second',
+                cls.RESO_MIN: 'minute',
+                cls.RESO_HR: 'hour',
+                cls.RESO_DAY: 'day'}.get(reso, 'day')
 
 
 def get_reso_string(reso):


Test patch:
Repository: pandas-dev/pandas

Issue:
0.11.0.dev-4b22372.win-amd64-py2.7: nosetests error
## ERROR: test_operators_timedelta64 (pandas.tests.test_series.TestSeries)

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pandas\tests\test_series.py", line 1752, i
n test_operators_timedelta64
    result = resultb + df['A']
  File "C:\Python27\lib\site-packages\pandas\core\series.py", line 144, in wrapp
er
    lvalues = lvalues.values
AttributeError: 'numpy.ndarray' object has no attribute 'values'

---

Ran 3113 tests in 241.670s

FAILED (SKIP=94, errors=1)



Discussion:
I've run the full test suite several times today with no errros. can you 
try it on the latest git master and tell us if there's still a problem?
I don't think any of the devs are on windows, we might be missing a problem.

I just ran on windows x64/python 2.7.3, with latest master, test_series/frame passes

maybe try a later binary (think they are generated 5pm?)

I usually grab binaries on http://pandas.pydata.org/pandas-build/dev/, and the latest is dated March 14. That's the one I used. If you guys say that the latest code works fine, I'll just wait for the new binary.

yep...i think the box those are built on is in the process of moving.....check back periodically...

hmm, i don't know what's up but i just got this exact error too (ubuntu, 32-bit...fresh installing on different machine than my normal one from master)...have not investigated yet

@bluefir looks like the binaries are updated....can you give a test?

@jreback replying here instead

yep, same exact error as above, on two different machines

`pip freeze` output:

```
Cython==0.18
Pygments==1.6
SQLAlchemy==0.8.0
argparse==1.2.1
ipython==0.13.1
logilab-astng==0.24.2
logilab-common==0.59.0
matplotlib==1.2.0
nose==1.2.1
numexpr==2.0.1
numpy==1.7.0
openpyxl==1.6.1
pandas==0.10.1
pylint==0.27.0
python-dateutil==1.5
pytz==2013b
pyzmq==13.0.0
scipy==0.11.0
six==1.3.0
statsmodels==0.4.3
vbench==0.1
wsgiref==0.1.2
xlrd==0.9.0
xlwt==0.7.4
yolk==0.4.3
```

some of that might be relevant

@bluefir can you conform that you are on numpy 1.7.0?

@y-p can you make that new build (for slow tests, which uses 2.7, also use numpy 1.7?),
I believe we test 1.6.2 on the main 2.7 one


Resolving patch:
diff --git a/pandas/core/series.py b/pandas/core/series.py
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -104,6 +104,11 @@ def convert_to_array(values):
                         pass
                     else:
                         values = com._possibly_cast_to_timedelta(values)
+                elif inferred_type in set(['integer']):
+                    if values.dtype == 'timedelta64[ns]':
+                        pass
+                    elif values.dtype.kind == 'm':
+                        values = values.astype('timedelta64[ns]')
                 else:
                     values = pa.array(values)
                 return values


Test patch:
Repository: pandas-dev/pandas

Issue:
assigning list to series with boolean indexing
Whenever a boolean array is used to assign some list or array to another series, it returns "ValueError: Length of replacements must equal series length". This was working fine in pandas 10.0, but broke with 10.1

``` python
import pandas as pd
import numpy as np
x = pd.Series(np.arange(10))
sel = x < 5
len(x[sel])
x[sel] = range(5) # doesn't work anymore
x[0:5] = range(5) # works
```



Discussion:

Resolving patch:
diff --git a/pandas/core/series.py b/pandas/core/series.py
--- a/pandas/core/series.py
+++ b/pandas/core/series.py
@@ -736,12 +736,24 @@ def where(self, cond, other=nan, inplace=False):
             other = other.reindex(ser.index)
         elif isinstance(other, (tuple,list)):
             other = np.array(other)
+
         if len(other) != len(ser):
+            icond = ~cond
 
             # GH 2745
             # treat like a scalar
             if len(other) == 1:
                 other = np.array(other[0]*len(ser))
+
+            # GH 3235 
+            # match True cond to other
+            elif len(icond[icond]) == len(other):
+                dtype, fill_value = _maybe_promote(other.dtype)
+                new_other = np.empty(len(cond),dtype=dtype)
+                new_other.fill(fill_value)
+                new_other[icond] = other
+                other = new_other
+
             else:
                 raise ValueError('Length of replacements must equal series length')
 


Test patch:
diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -1092,7 +1092,6 @@ def test_where(self):
 
         self.assertRaises(ValueError, s.where, 1)
         self.assertRaises(ValueError, s.where, cond[:3].values, -s)
-        self.assertRaises(ValueError, s.where, cond, s[:3].values)
 
         # GH 2745
         s = Series([1,2])
@@ -1109,6 +1108,23 @@ def test_where(self):
         self.assertRaises(ValueError, s.__setitem__, tuple([[[True, False]]]), [0,2,3])
         self.assertRaises(ValueError, s.__setitem__, tuple([[[True, False]]]), [])
 
+        # GH3235
+        s = Series(np.arange(10))
+        mask = s < 5
+        s[mask] = range(5)
+        expected = Series(np.arange(10),dtype='float64')
+        assert_series_equal(s,expected)
+
+        s = Series(np.arange(10))
+        mask = s > 5
+        s[mask] = [0]*4
+        expected = Series([0,1,2,3,4,5] + [0]*4,dtype='float64')
+        assert_series_equal(s,expected)
+
+        s = Series(np.arange(10))
+        mask = s > 5
+        self.assertRaises(ValueError, s.__setitem__, mask, ([0]*5,))
+
     def test_where_inplace(self):
         s = Series(np.random.randn(5))
         cond = s > 0
Repository: pandas-dev/pandas

Issue:
Dataframe ctor dies when passed a list containing empty dataframe
``` python
pd.DataFrame([DataFrame([])])

/home/user1/src/pandas/pandas/core/frame.pyc in __getattr__(self, name)
   1965             return self[name]
   1966         raise AttributeError("'%s' object has no attribute '%s'" %
-> 1967                              (type(self).__name__, name))
   1968 
   1969     def __setattr__(self, name, value):

AttributeError: 'DataFrame' object has no attribute 'dtype'
```



Discussion:

Resolving patch:
diff --git a/pandas/core/common.py b/pandas/core/common.py
--- a/pandas/core/common.py
+++ b/pandas/core/common.py
@@ -1028,7 +1028,7 @@ def _possibly_convert_platform(values):
 
     if isinstance(values, (list,tuple)):
         values = lib.list_to_object_array(values)
-    if values.dtype == np.object_:
+    if getattr(values,'dtype',None) == np.object_:
         values = lib.maybe_convert_objects(values)
 
     return values


Test patch:
diff --git a/pandas/tests/test_frame.py b/pandas/tests/test_frame.py
--- a/pandas/tests/test_frame.py
+++ b/pandas/tests/test_frame.py
@@ -2040,6 +2040,15 @@ def test_constructor_dtype_list_data(self):
         self.assert_(df.ix[1, 0] is None)
         self.assert_(df.ix[0, 1] == '2')
 
+    def test_constructor_list_frames(self):
+
+        # GH 3243
+        result = DataFrame([DataFrame([])])
+        self.assert_(result.shape == (1,0))
+
+        result = DataFrame([DataFrame(dict(A = range(5)))])
+        self.assert_(type(result.iloc[0,0]) == DataFrame)
+
     def test_constructor_mixed_dtypes(self):
 
         def _make_mixed_dtypes_df(typ, ad = None):