Skip to content

Commit 2f28820

Browse files
authored
Update SSA.py
fix rec_ts
1 parent fb0244c commit 2f28820

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/py_ssa_lib/SSA.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,10 @@ def reconstruct_ts(self, idx_chosen_components, return_as_df=False):
341341

342342
ts_rec = self.X_to_TS(chosen_components)
343343
if return_as_df==True:
344-
return pd.DataFrame(columns=self.df.columns, data=np.column_stack([self.df.iloc[self.ts,:self.idx_start_ts].values,ts_rec.T ]))
344+
ts_rec = pd.DataFrame( data=np.hstack([self.df.iloc[self.ts,:self.idx_start_ts].values ,ts_rec.flatten() ])).T
345+
ts_rec.columns = self.df.columns
346+
return ts_rec
347+
#pd.DataFrame(columns=self.df.columns, data=np.column_stack([self.df.iloc[self.ts,:self.idx_start_ts].values,ts_rec.T ]))
345348
return ts_rec.T
346349

347350

0 commit comments

Comments
 (0)