Skip to content

Commit 9a39fba

Browse files
committed
CLN: de-duplicate
1 parent e63efa0 commit 9a39fba

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pandas/plotting/_matplotlib/timeseries.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from typing import (
77
TYPE_CHECKING,
88
Any,
9-
cast,
109
)
1110
import warnings
1211

@@ -271,13 +270,7 @@ def maybe_convert_index(ax: Axes, data: NDFrameT) -> NDFrameT:
271270
# tsplot converts automatically, but don't want to convert index
272271
# over and over for DataFrames
273272
if isinstance(data.index, (ABCDatetimeIndex, ABCPeriodIndex)):
274-
freq: str | BaseOffset | None = data.index.freq
275-
276-
if freq is None:
277-
# We only get here for DatetimeIndex
278-
data.index = cast("DatetimeIndex", data.index)
279-
freq = data.index.inferred_freq
280-
freq = to_offset(freq)
273+
freq = _get_index_freq(data.index)
281274

282275
if freq is None:
283276
freq = _get_ax_freq(ax)

0 commit comments

Comments
 (0)