We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23e055b commit 3a3a172Copy full SHA for 3a3a172
deepsensor/data/utils.py
@@ -102,8 +102,11 @@ def compute_pandas_data_resolution(
102
closest_distances = []
103
df = df.reset_index().set_index("time")
104
for time in dates:
105
- df_t = df.loc[time]
+ df_t = df.loc[[time]]
106
X = df_t[["x1", "x2"]].values # (N, 2) array of coordinates
107
+ if X.shape[0] < 2:
108
+ # Skip this time if there are fewer than 2 stationS
109
+ continue
110
X_unique = np.unique(X, axis=0) # (N_unique, 2) array of unique coordinates
111
112
pairwise_distances = scipy.spatial.distance.cdist(X_unique, X_unique)
0 commit comments