Skip to content

Commit

Permalink
Small fix for pandas unique utility
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 13, 2018
1 parent 383690d commit 3c89e27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion holoviews/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,10 @@ def unique_array(arr):
if not len(arr):
return arr
elif pd:
return pd.unique(arr)
unique = pd.unique(arr)
if isinstance(arr, np.ndarray) and unique.dtype != arr.dtype:
return unique.astype(arr.dtype)
return unique
else:
arr = np.asarray(arr)
_, uniq_inds = np.unique(arr, return_index=True)
Expand Down

0 comments on commit 3c89e27

Please sign in to comment.