pca icon indicating copy to clipboard operation
pca copied to clipboard

Error when creating biplot because of numpy data type mismatch

Open fahminlb33 opened this issue 1 year ago • 0 comments

When I run the biplot function it raises an error when creating the label.

  • Environment: Python 3.10.12 pandas==2.0.3
  • Error message: ufunc 'add' did not contain a loop with signature matching types.

This happens in this line of code:

https://github.com/erdogant/pca/blob/bc14fb7954272e02600dd370f3df5130219bc552/pca/pca.py#L1512C9-L1512C76

To resolve this issue, I slightly changed the string format to this:

label = f"{getfeat} ({topfeat['loading'].iloc[i]:.3g})"

I can create a PR for this fix.

fahminlb33 avatar Jul 17 '24 10:07 fahminlb33