Reducing Dimensionality with sklearn

We may want to reduce the dimensions we have in our data. A first step would be to remove unwanted data ourselves, but if we think we have trimmed everything we can, we can reduce our data further with
Principal Component Analysis.

from sklearn.decomposition import PCA

pca = PCA(n_wanted_dimension)  # Choose how many dimensions we want to keep
pca.fit(data)
reduced = pca.transform(data)

# Accessing Properties:
pca.components_  # Prints the eigenvectors for our principal components

NOTE: it is perfectly valid to reduce dimensionality only for the purpose of viewing the data, and still work on your original or scaled data.