Skip to content
Snippets Groups Projects
Commit 0ea9f1f3 authored by Bas Nijholt's avatar Bas Nijholt Committed by Joseph Weston
Browse files

use isinstance

parent 4c8a1321
No related branches found
No related tags found
1 merge request!101Resolve "Learner1D fails when function returns a list instead of a numpy.array"
......@@ -220,7 +220,7 @@ class Learner1D(BaseLearner):
real = y is not None
if real:
# either it is a float/int, if not, try casting to a np.array
if type(y) not in [float, int]:
if not isinstance(y, (float, int)):
y = np.asarray(y, dtype='float64')
# Add point to the real data dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment