Skip to content

Instantly share code, notes, and snippets.

@gabriellm1
Last active November 23, 2020 20:16
Show Gist options
  • Save gabriellm1/ba4d05c357084d3f74c0b713870f4fed to your computer and use it in GitHub Desktop.
Save gabriellm1/ba4d05c357084d3f74c0b713870f4fed to your computer and use it in GitHub Desktop.
from sklearn.decomposition import PCA
pca = PCA(n_components = 2)
df_principal = pca.fit_transform(df_prepared)
df_principal = pd.DataFrame(df_principal)
df_principal.columns = ['P1', 'P2']
df_principal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment