Skip to content

Commit f6efb8d

Browse files
author
Sumanau Sareen
committed
1. Fix bug where list like object not returning empty Index.
2. Edit v0.25.0.rst to update changelog.
1 parent b563d45 commit f6efb8d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/whatsnew/v0.25.0.rst

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ 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`)
255256

256257
.. _whatsnew_0250.deprecations:
257258

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3392,7 +3392,7 @@ def _ensure_valid_index(self, value):
33923392
passed value.
33933393
"""
33943394
# GH5632, make sure that we are a Series convertible
3395-
if not len(self.index) and is_list_like(value):
3395+
if not len(self.index) and len(value) and is_list_like(value):
33963396
try:
33973397
value = Series(value)
33983398
except (ValueError, NotImplementedError, TypeError):

0 commit comments

Comments
 (0)