summaryrefslogtreecommitdiff
path: root/src/python/gudhi/representations/vector_methods.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/gudhi/representations/vector_methods.py')
-rw-r--r--src/python/gudhi/representations/vector_methods.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/python/gudhi/representations/vector_methods.py b/src/python/gudhi/representations/vector_methods.py
index 5133a64c..82f071d7 100644
--- a/src/python/gudhi/representations/vector_methods.py
+++ b/src/python/gudhi/representations/vector_methods.py
@@ -417,6 +417,9 @@ class BettiCurve2(BaseEstimator, TransformerMixin):
"""
if self.predefined_grid is None:
+ if not X:
+ X = [np.zeros((0, 2))]
+
N = len(X)
events = np.concatenate([pd.flatten(order="F") for pd in X], axis=0)
@@ -469,6 +472,9 @@ class BettiCurve2(BaseEstimator, TransformerMixin):
if not self.is_fitted():
raise NotFittedError("Not fitted.")
+ if not X:
+ X = [np.zeros((0, 2))]
+
N = len(X)
events = np.concatenate([pd.flatten(order="F") for pd in X], axis=0)