What I understood of this error is that it means that there is a column that is of type long(). But this column contains a value named '5B' which isn't a long type.
This is the line where the error occurs:
df_Company = df1.groupby(by=['manufacturer','quality_issue'], as_index=False) ['quality_issue2'].count()
I have checked all the column types of the dataframe df1. But there are no columns with the type long. 5B is a name of a manufacturer so I assume that the column manufacturer has suddenly became of type long during this sentence.
checked what types the dataframe df1 has.
print (df1.dtypes)
manufacturer object
yearweek int64
quality_issue object
quality_issue2 object
I 'think' I have to do something with df_Company.astype(long)
but it seems I can't make it work. Does anyone has an idea how to fix this?
Note: the strange thing is that on my other computer where I have Python 3.5.1 the same code works just fine. but when I run the code on my current computer where I have Python 2.7.9 I get this long error.