Skip to content

Commit f0c36d3

Browse files
committed
Updated MSTUMP tutorial with subspace
1 parent 319849d commit f0c36d3

5 files changed

Lines changed: 89 additions & 29 deletions

File tree

docs/Tutorial_Multidimensional_Motif_Discovery.ipynb

Lines changed: 83 additions & 26 deletions
Large diffs are not rendered by default.

docs/Zenodo.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@
283283
"mdtype = mdata.dtype\n",
284284
"\n",
285285
"df = pd.DataFrame(mdata, dtype=mdtype, columns=['T3', 'T2', 'T1'])\n",
286+
"df = df[['T1', 'T2', 'T3']]\n",
286287
"df.to_csv(\"toy.csv\", index=False)"
287288
]
288289
}

stumpy/core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def transpose_dataframe(df): # pragma: no cover
185185
Returns
186186
-------
187187
output : df
188-
If a is a Pandas `DataFrame` then return `a.T`. Otherwise, return `a`
188+
If `df` is a Pandas `DataFrame` then return `df.T`. Otherwise, return `df`
189189
"""
190190
if type(df).__name__ == "DataFrame":
191191
return df.T
@@ -1235,6 +1235,7 @@ def preprocess(T, m):
12351235
Rolling standard deviation
12361236
"""
12371237
T = T.copy()
1238+
T = transpose_dataframe(T)
12381239
T = np.asarray(T)
12391240
check_dtype(T)
12401241

@@ -1273,6 +1274,7 @@ def preprocess_non_normalized(T, m):
12731274
`np.nan`/`np.inf` value (False)
12741275
"""
12751276
T = T.copy()
1277+
T = transpose_dataframe(T)
12761278
T = np.asarray(T)
12771279
check_dtype(T)
12781280

stumpy/mstump.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def mstump(T, m, include=None, discords=False):
693693
694694
See mSTAMP Algorithm
695695
"""
696-
T_A = core.transpose_dataframe(T)
696+
T_A = T
697697
T_B = T_A
698698

699699
T_A, M_T, Σ_T = core.preprocess(T_A, m)

stumpy/mstumped.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def mstumped(dask_client, T, m, include=None, discords=False):
7070
7171
See mSTAMP Algorithm
7272
"""
73-
T_A = core.transpose_dataframe(T)
73+
T_A = T
7474
T_B = T_A
7575

7676
T_A, M_T, Σ_T = core.preprocess(T_A, m)

0 commit comments

Comments
 (0)