File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -551,19 +551,7 @@ def is_regular(ts, raise_exception=False):
551551
552552 # If index is string-like, try datetime first, then numeric.
553553 if pd .api .types .is_string_dtype (idx .dtype ):
554- dt_idx = pd .to_datetime (idx , errors = "coerce" )
555- if not dt_idx .isna ().any ():
556- idx = pd .DatetimeIndex (dt_idx )
557- else :
558- num = pd .to_numeric (idx , errors = "coerce" )
559- if np .isnan (num ).any ():
560- msg = (
561- "Index is a string that can't convert to datetime or numeric - can't assess regularity."
562- )
563- if raise_exception :
564- raise ValueError (msg )
565- return False
566- idx = pd .Index (num )
554+ raise ValueError ("String indices are not supported for regularity checks." )
567555
568556 # Handle numeric indices (int, float)
569557 if isinstance (idx , (pd .Index , pd .RangeIndex )) and pd .api .types .is_numeric_dtype (idx .dtype ):
You can’t perform that action at this time.
0 commit comments