From bf5ea1b41bfeff8e6bbadd62682640ef7ba7bd67 Mon Sep 17 00:00:00 2001
From: Philipp Rudiger
Date: Sun, 18 Feb 2018 23:45:05 +0000
Subject: [PATCH] Fixed range handling of OSU dtypes
---
holoviews/core/data/interface.py | 4 +++-
holoviews/core/data/pandas.py | 10 ----------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/holoviews/core/data/interface.py b/holoviews/core/data/interface.py
index 9adc3a5f4e..625c1105fb 100644
--- a/holoviews/core/data/interface.py
+++ b/holoviews/core/data/interface.py
@@ -281,14 +281,16 @@ def indexed(cls, dataset, selection):
@classmethod
def range(cls, dataset, dimension):
column = dataset.dimension_values(dimension)
+ print(column)
if column.dtype.kind == 'M':
return column.min(), column.max()
elif len(column) == 0:
return np.NaN, np.NaN
else:
try:
+ assert column.dtype.kind not in 'SUO'
return (np.nanmin(column), np.nanmax(column))
- except TypeError:
+ except (AssertionError, TypeError):
column = [v for v in util.python2sort(column) if v is not None]
if not len(column):
return np.NaN, np.NaN
diff --git a/holoviews/core/data/pandas.py b/holoviews/core/data/pandas.py
index 1b5e7ea385..65f60bf86c 100644
--- a/holoviews/core/data/pandas.py
+++ b/holoviews/core/data/pandas.py
@@ -294,16 +294,6 @@ def dframe(cls, columns, dimensions):
return columns.data.copy()
- @classmethod
- def array(cls, dataset, dimensions):
- if not dimensions:
- dimensions = dataset.dimensions(label='name')
- else:
- dimensions = [dataset.get_dimensions(d).name for d in dimensions]
- inds = [dataset.data.columns.index(dim.name) for dim in dimensions]
- return dataset.data.values[:, inds]
-
-
@classmethod
def iloc(cls, dataset, index):
rows, cols = index