I wrote a function to calculate the number of unique values of each column in the data frame.
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’)
Don’t know how to solve it? What’s the problem with my writing?
unqiue。。。Spelling is wrong? Unique