乐趣区

关于数据挖掘:字典的键值转换直接给df对象的列赋值列表

word2tf = {'秦朝':15,'鸡腿':200,'大西瓜':500}
tf2word = {v:k for k,v in word2tf.items()}
tf2word 

ceshi = pd.DataFrame({'ceshi':[np.array([123]),np.array([456]),np.array([789])]})
ceshi['ceshi'] = [(i+1) for i in ceshi['ceshi']]
[(i+1) for i in ceshi['ceshi']]
ceshi['ceshi'] = [1,2,3]
print(ceshi) 

退出移动版