在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Python/ pandas 求每列的唯一值個數

pandas 求每列的唯一值個數

為計算數據框每一列的唯一值的個數我寫了一個函數:

def unqiue_element(x):
    a=len(np.unqiue(x))
    return a
print "the number of unique items in each column",train.apply(unqiue_element)

出現(xiàn)錯誤
AttributeError: ("'module' object has no attribute 'unqiue'", u'occurred at index PatientId')
不知道怎么解決?我的寫法有什么問題?

回答
編輯回答
夢一場

unqiue。。。拼寫有誤?unique

2017年5月17日 12:50