Skip to content

Commit 3029d86

Browse files
author
Sumanau Sareen
committed
1. Add documentation under right subsection. 2. Use proper test utils for test func.
1 parent 47fb344 commit 3029d86

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pandas/tests/indexing/test_indexing.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,11 @@ def test_index_type_coercion(self):
718718
assert s2.index.is_object()
719719

720720
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
721+
index=pd.Index([], name='idx')
722+
df = pd.DataFrame(columns=['A'], index=index)
723+
df2 = df.copy()
724+
df['A'] = []
725+
tm.assert_index_equal(df.index, df2.index)
724726

725727

726728
class TestMisc(Base):

0 commit comments

Comments
 (0)