Pandas-profiling: Wrong number of items passed

Created on 2 Oct 2019  路  6Comments  路  Source: pandas-profiling/pandas-profiling

Hi,

Not sure if this is a bug, though my dataset seems to be working well with other packages. I keep getting the error message: 'Wrong number of items passed 103, placement implies 102', or some variant of that.

On occasion, the error changes to 'tuple index out of range'

I'm dealing with proprietary data and can't seem to reproduce this error with smaller sample datasets; my data is basically about 90,000 rows and 100 columns of binary (0 or 1) info. Any advice?

Thanks!

bug 馃悰 no-issue-activity

Most helpful comment

Hi,

I experience exactly the same issue. However, my dataset is much smaller:
100 rows and 58 columns (of which 54 columns contain binary data). This results in the following value error:
'Wrong number of items passed 57, placement implies 55'

When I run the pandas-profiling without the columns containing binary data it performs without any errors.

update: when replacing 0 and 1 with "no" and "yes" the report is processed succesfully.

All 6 comments

Hi,

I experience exactly the same issue. However, my dataset is much smaller:
100 rows and 58 columns (of which 54 columns contain binary data). This results in the following value error:
'Wrong number of items passed 57, placement implies 55'

When I run the pandas-profiling without the columns containing binary data it performs without any errors.

update: when replacing 0 and 1 with "no" and "yes" the report is processed succesfully.

Stale issue

Hi,

same issue for me. I have a dataset of 22222 observations and 124 variables, many of them are dummies. I use pandas 0.25.3, python 3.8 and pandas_profiling 0.25.

I noticed that the problem occurs, if my bool variables are stored as integers. If I convert them to bool or string, it solves the issue.

is there a better solution for this? or is it a bug with boolean features for now? facing the exact same issues

I have a weird solution for you. In fact, this error is floating. So you can brute force it by calling it again and again until it won't succeed.
for i in range(100):
try:
pr = ProfileReport(your_data_set)
print('Finally worked')
break
except:
continue

This worked for me.

Stale issue

Was this page helpful?
0 / 5 - 0 ratings