I have a dataset which has a DateTime index and I'm using PCA from sklearn to reduce the number of dimensions.
The following question bugs me - will PCA keep the order of the points in my series so that I can reuse the index from the original dataframe?
df = pd.DataFrame(...)
df2 = pca.fit_transform(df)
df2.index = df.index
Moreover, is there a better (safer) approach than doing this?
pca.fit_transform(df).reindex(index=df.index)
? – Clotheshorse