Skip to content

Commit e773acd

Browse files
author
Sumanau Sareen
committed
1. Add documentation under right subsection. 2. Use proper test utils for test func.
1 parent 3f0eb24 commit e773acd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

doc/source/whatsnew/v0.25.0.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ Other API Changes
252252
- The ``arg`` argument in :meth:`pandas.core.groupby.DataFrameGroupBy.agg` has been renamed to ``func`` (:issue:`26089`)
253253
- The ``arg`` argument in :meth:`pandas.core.window._Window.aggregate` has been renamed to ``func`` (:issue:`26372`)
254254
- Most Pandas classes had a ``__bytes__`` method, which was used for getting a python2-style bytestring representation of the object. This method has been removed as a part of dropping Python2 (:issue:`26447`)
255-
- Bug in :func:`_ensure_valid_index` empty list like object should have an empty Index (:issue:`17101`)
256255

257256
.. _whatsnew_0250.deprecations:
258257

@@ -382,6 +381,8 @@ Indexing
382381
- Bug in which :meth:`DataFrame.to_csv` caused a segfault for a reindexed data frame, when the indices were single-level :class:`MultiIndex` (:issue:`26303`).
383382
- Fixed bug where assigning a :class:`arrays.PandasArray` to a :class:`pandas.core.frame.DataFrame` would raise error (:issue:`26390`)
384383
- Allow keyword arguments for callable local reference used in the :method:`DataFrame.query` string (:issue:`26426`)
384+
- Bug when adding a new column to a length-zero ``DataFrame`` converting the index to a ``RangeIndex`` (:issue:`17101`).
385+
385386

386387

387388
Missing

pandas/tests/indexing/test_indexing.py

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

630630
def test_empty_index_for_empty_dataframe(self):
631-
empty_df = pd.DataFrame(columns=['A'])
632-
df_with_empty_value = pd.DataFrame(columns=['A'], data=[])
633-
assert df_with_empty_value.index.dtype == empty_df.index.dtype
631+
index=pd.Index([], name='idx')
632+
df = pd.DataFrame(columns=['A'], index=index)
633+
df2 = df.copy()
634+
df['A'] = []
635+
tm.assert_index_equal(df.index, df2.index)
634636

635637

636638
class TestMisc(Base):

0 commit comments

Comments
 (0)