Skip to content

Commit 5d01add

Browse files
authored
TST: DataFrame initialization with an empty DataFrame with dtype (pandas-dev#42890)
1 parent c2aaf8e commit 5d01add

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/frame/test_constructors.py

+6
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,12 @@ def test_constructor_DataFrame(self, float_frame):
12041204
df_casted = DataFrame(float_frame, dtype=np.int64)
12051205
assert df_casted.values.dtype == np.int64
12061206

1207+
def test_constructor_empty_dataframe(self):
1208+
# GH 20624
1209+
actual = DataFrame(DataFrame(), dtype="object")
1210+
expected = DataFrame([], dtype="object")
1211+
tm.assert_frame_equal(actual, expected)
1212+
12071213
def test_constructor_more(self, float_frame):
12081214
# used to be in test_matrix.py
12091215
arr = np.random.randn(10)

0 commit comments

Comments
 (0)