为计算数据框每一列的唯一值的个数我写了一个函数:
def unqiue_element(x):
a=len(np.unqiue(x))
return a
print "the number of unique items in each column",train.apply(unqiue_element)
出现错误
AttributeError: ("'module' object has no attribute 'unqiue'", u'occurred at index PatientId')
不知道怎么解决?我的写法有什么问题?
unqiue。。。拼写有误?unique