ResidentMario/missingno

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

ywsyws opened this issue · 6 comments

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?

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?

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

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:]])

I will try to take a look next weekend.

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

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.