Fix get_number_of_types failing with pandas dtypes
@@ -147,6 +147,7 @@ def get_dtype(X):
def get_number_of_types(dataframe):
dtypes = getattr(dataframe, "dtypes", None)
- if dtypes is None or isinstance(dtypes, np.dtype):
- return 1
+ try:
return len(set(dtypes))
+ except TypeError:
+ return 1
