[Python] 计算dataframe某一文本维度的平均长度
print np.mean(df.title.apply(lambda x: len(x))) # 24.072694718 print df.title.apply(lambda x: len(x) < 30).value_counts() """ True 4069 False 1516 """
print np.mean(df.title.apply(lambda x: len(x))) # 24.072694718 print df.title.apply(lambda x: len(x) < 30).value_counts() """ True 4069 False 1516 """