Skip to content

Commit 83208a6

Browse files
authored
Merge pull request #25 from kthyng/fix_get_axis_coord
guess_regex was not used correctly
2 parents faba0a3 + d80e157 commit 83208a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cf_pandas/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def _get_axis_coord(obj: Union[DataFrame, Series], key: str) -> list:
354354
# also use the guess_regex approach by default, but only if no results so far
355355
# this takes the logic from cf-xarray guess_coord_axis
356356
if len(results) == 0:
357-
if obj[col].ndim == 1 and _is_datetime_like(obj[col]):
357+
if key in ("T", "time") and _is_datetime_like(obj[col]):
358358
results.update((col,))
359359
continue # prevent second detection
360360

0 commit comments

Comments
 (0)