Sometimes when using sklearn.metrics.classification_report we get below error
TypeError: object of type 'int' has no len()
Sometime depending on the datatype we get error like below too
TypeError: object of type 'numpy.int64' has no len()
Sample code when we might get this error
t=pd.Series([1,2,3,4])
p=np.asarray([1,2,3,4])
target_names=[1,2,3,4]
print(classification_report(t, p, target_names=target_names))