Skip to content

Commit

Permalink
Merge pull request #25 from kthyng/fix_get_axis_coord
Browse files Browse the repository at this point in the history
guess_regex was not used correctly
  • Loading branch information
kthyng authored Mar 21, 2023
2 parents faba0a3 + d80e157 commit 83208a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cf_pandas/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def _get_axis_coord(obj: Union[DataFrame, Series], key: str) -> list:
# also use the guess_regex approach by default, but only if no results so far
# this takes the logic from cf-xarray guess_coord_axis
if len(results) == 0:
if obj[col].ndim == 1 and _is_datetime_like(obj[col]):
if key in ("T", "time") and _is_datetime_like(obj[col]):
results.update((col,))
continue # prevent second detection

Expand Down

0 comments on commit 83208a6

Please sign in to comment.