Ramón Wilhelm
Ramón Wilhelm

Reputation: 997

ImportError: cannot import name 'PCA' from 'matplotlib.mlab'

According to this task:

Principal Component Analysis (PCA) in Python

I included this line

import from matplotlib.mlab import PCA

but I get the error message:

cannot import name 'PCA' from 'matplotlib.mlab'

I'm using Python3.7 and I have no idea how I can use the PCA function from matlab. Is the new version of matplotlib depricated or is PCA included to another library?

Upvotes: 2

Views: 2031

Answers (1)

pachinchin
pachinchin

Reputation: 61

I really don't know if it is too late to reply now. But I will just place it here anyways.

import numpy as np
from sklearn.decomposition import PCA

Upvotes: 6

Related Questions