1

Test code:

s = pd.Series(pd.array([pd.Interval(0,1.2), pd.Interval(5,123)]))
s.dtype
s.dtype.kind is None

>>> interval[float64]
>>> True

Is it some bug or made intentionally? If latter - for what reason?

Xronx
  • 1,160
  • 7
  • 23
  • But there are others 'pandas-only' specific dtypes - period, category as example. But for them `.dtype.kind` returns `O` - object. – Xronx May 30 '19 at 20:18
  • 1
    It should be noted that period and category _are_ currently implemented via the extension array interface (same with interval and datetimetz). It's the custom dtype object that determines `kind`, and the custom dtypes themselves have been around since before the extension array interface. – root May 31 '19 at 20:25

1 Answers1

1

The reason this is appearing as None is simply because the implementation of IntervalDtype explicitly sets kind = None. This should probably be updated to 'O', though some care is needed here as it will result in unintended side effects, e.g. this would cause is_string_dtype to return True (see here).

root
  • 32,715
  • 6
  • 74
  • 87
  • 1
    I think it also should be mention [why](https://stackoverflow.com/a/56401142/10711194) `is_string_dtype` checking would become problem. – Xronx May 31 '19 at 20:39