ResidentMario / missingno

Missing data visualization module for Python.
MIT License
3.97k stars 518 forks source link

ValueError: The number of FixedLocator locations does not match the number of ticklabels #135

Closed ywsyws closed 3 years ago

ywsyws commented 3 years ago

when I plot msno.bar(df_raw.sample(10)), it gives me a valuerror: "ValueError: The number of FixedLocator locations (0), usually from a call to set_ticks, does not match the number of ticklabels (186)"

how can i fix this? fix the fixedLocator location? but how?

ResidentMario commented 3 years ago

This sounds like it could be a legitimate bug. To help with debugging, can you share what version of Python and pandas you are using, as well as the dataset you are using?

ywsyws commented 3 years ago

Python: 3.6.9 Pandas: 1.1.5 dataset: https://static.openfoodfacts.org/data/en.openfoodfacts.org.products.csv

For the moment, i get around by doing try: msno.bar(df_raw.sample(1000)) except ValueError: pass

kbfreder commented 3 years ago

I also observed this error message. Python: 3.8.10 Pandas: 1.2.4 I cannot share my dataset; it is proprietary.

I was able to work around it by only plotting a subset of the columns at one time, e.g.:

cols = df.columns
msno.bar(df[cols[:20]])
msno.bar(df[cols[20:]])
ResidentMario commented 3 years ago

I will try to take a look next weekend.

ResidentMario commented 3 years ago

I can't reproduce this error because the source CSV file seems to be malformed:

food = pd.read_csv("/Users/alekseybilogur/Downloads/en.openfoodfacts.org.products.csv")
ParserError: Error tokenizing data. C error: Expected 37 fields in line 5, saw 52
channingmonk commented 3 years ago

I can't reproduce this error because the source CSV file seems to be malformed:

food = pd.read_csv("/Users/alekseybilogur/Downloads/en.openfoodfacts.org.products.csv")
ParserError: Error tokenizing data. C error: Expected 37 fields in line 5, saw 52

It is because the dataset is too big. it needs to be handled by dask.