We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 47fb344 commit 3029d86Copy full SHA for 3029d86
pandas/tests/indexing/test_indexing.py
@@ -718,9 +718,11 @@ def test_index_type_coercion(self):
718
assert s2.index.is_object()
719
720
def test_empty_index_for_empty_dataframe(self):
721
- empty_df = pd.DataFrame(columns=['A'])
722
- df_with_empty_value = pd.DataFrame(columns=['A'], data=[])
723
- assert df_with_empty_value.index.dtype == empty_df.index.dtype
+ index=pd.Index([], name='idx')
+ df = pd.DataFrame(columns=['A'], index=index)
+ df2 = df.copy()
724
+ df['A'] = []
725
+ tm.assert_index_equal(df.index, df2.index)
726
727
728
class TestMisc(Base):
0 commit comments