-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heatmap ValueError:could not convert string to float: '--' #170
Comments
Hello, I've the same issue... Please tell me that you find a solution ? I find nothing on google it's insane |
In the original missingno.py i deleted the insade loop (line 350 and i just replace by for text in ax0.texts: and the result is in the picture result.png : It's seem that there's a problem in this library ! (i use the missingno 0.4.2 i can't use the latest version cause it's a pc for my job. |
Okay, so the simplest way I found around this was to modify the file in my local environment to just check for the string '--' in that bit of the code. For the contributers to the package, all I did was replace the for loop at line 397 of missingno.py with:
I don't feel I know enough about what's going on in the package to create a pull request for this change, but I don't see where the problem would arise TBH. |
I changed my mind and made a pull request. |
Im trying missingno.heatmap on the NYPD Motor Vehicle Collisions Dataset.
import pandas
import missingno
df = pandas.read_csv('Motor_Vehicle_Collisions_-_Crashes_20240322.csv')
missingno.heatmap(df)
Then this error occured
`ValueError Traceback (most recent call last)
Cell In[3], line 1
----> 1 missingno.heatmap(df)
File c:\Users\Admin\anaconda3\envs\jup2\lib\site-packages\missingno\missingno.py:398, in heatmap(df, filter, n, p, sort, figsize, fontsize, labels, label_rotation, cmap, vmin, vmax, cbar, ax)
395 ax0.patch.set_visible(False)
397 for text in ax0.texts:
--> 398 t = float(text.get_text())
399 if 0.95 <= t < 1:
400 text.set_text('<1')
ValueError: could not convert string to float: '--'`
The text was updated successfully, but these errors were encountered: