summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-07-13 15:26:15 +0800
committerAaron LI <aaronly.me@outlook.com>2016-07-13 15:26:15 +0800
commitf0e233031e51a69bd3c23c616ff861d2b2931bd1 (patch)
tree8f97440ec659777a8c3e2f5716e6721be55912ba
parent9260cbdb7fadb1abab95f064a8e1d1323ebbd477 (diff)
downloadcexcess-f0e233031e51a69bd3c23c616ff861d2b2931bd1.tar.bz2
spline.py: improve the np.array usage a bit
-rw-r--r--spline.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/spline.py b/spline.py
index 3470a1a..20ec1cf 100644
--- a/spline.py
+++ b/spline.py
@@ -2,7 +2,11 @@
#
# Aaron LI
# Created: 2016-07-10
-# Updated: 2016-07-10
+# Updated: 2016-07-13
+#
+# Change logs:
+# 2016-07-13:
+# * Improve the `np.array` usage a bit
#
"""
@@ -83,9 +87,7 @@ class SmoothSpline(Spline):
weights=weights, method="REML")
def eval(self, x):
- x = np.array(x)
- if x.shape == ():
- x = x.reshape((1,))
+ x = np.array(x, ndmin=1)
if "X" in self.log10:
x_new = ro.ListVector({"x": ro.FloatVector(np.log10(x))})
else: