CA fit - TypeError: No loop matching the specified signature and casting was found for ufunc true_divide
See original GitHub issueI get a TypeError using CA or MCA from the examples posted in the repository
pd.set_option('display.float_format', lambda x: '{:.6f}'.format(x))
X = pd.DataFrame(
data=[
[326, 38, 241, 110, 3],
[688, 116, 584, 188, 4],
[343, 84, 909, 412, 26],
[98, 48, 403, 681, 85]
],
columns=pd.Series(['Fair', 'Red', 'Medium', 'Dark', 'Black']),
index=pd.Series(['Blue', 'Light', 'Medium', 'Dark'])
)
ca = prince.CA( n_components=2, n_iter=3, copy=True, check_input=True, engine='auto', random_state=42)
X.columns.rename('Hair color', inplace=True)
X.index.rename('Eye color', inplace=True)
ca = ca.fit(X)
TypeError Traceback (most recent call last)
<ipython-input-25-6248e8f8c83f> in <module>
3 X.index.rename('Eye color', inplace=True)
4 X
----> 5 ca = ca.fit(X)
~\anaconda3\lib\site-packages\prince\ca.py in fit(self, X, y)
43
44 # Compute the correspondence matrix which contains the relative frequencies
---> 45 X /= np.sum(X)
46
47 # Compute row and column masses
TypeError: No loop matching the specified signature and casting was found for ufunc true_divide
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
No loop matching the specified signature and casting ... - GitHub
Getting TypeError: No loop matching the specified signature and casting was found for ufunc true_divide despite using np.true_divide #17221.
Read more >Getting No loop matching the specified signature and casting ...
I'm a beginner to python and machine learning . I get below error when i try to fit data into ...
Read more >TypeError on the first example in Lesson 1: No loop matching ...
TypeError : No loop matching the specified signature and casting was found for ufunc add. It comes from the learn.fit(0.01, 2) but the...
Read more >No loop matching the specified signature and casting was found
Hi! I'm following along a course ("Learning Python for Data analysis and visualization") on Udemy. While there are quite a few errors in...
Read more >typeerror: ufunc 'true_divide' not supported for the input types ...
If dtype of a and b are both integers, then the error you get is: No loop matching the specified signature and casting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This should be fixed with version 0.7.1.
Awesome, and thank you!