Skip to content

Heatmap ValueError:could not convert string to float: '--'Β #170

@dvc-808

Description

@dvc-808

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: '--'`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions