Skip to content

Commit 5c109f6

Browse files
committed
Fix DataFrame.info() range summary for DatetimeIndex
**Fix `DataFrame.info()` range summary for DatetimeIndex** This PR aims to provide better description of [DatetimeIndex](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.html) within [DataFrame.info](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.info.html) in relation to the display of the range of unsorted indexes, by replacing the original first to last element values with "min date" to "max date" values.
1 parent a890239 commit 5c109f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/indexes/datetimelike.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def _summary(self, name=None):
485485
"""
486486
formatter = self._formatter_func
487487
if len(self) > 0:
488-
index_summary = f", {formatter(self[0])} to {formatter(self[-1])}"
488+
index_summary = f", {formatter(self.min())} to {formatter(self.max())}"
489489
else:
490490
index_summary = ""
491491

0 commit comments

Comments
 (0)