随笔分类 - python
摘要:原来的res的列顺序如下,现在我想让uid在第一列 python代码: df_id = res.uidres = res.drop('uid',axis=1)res.insert(0,'uid',df_id) #如果想让uid插入到哪一列就修改0为相应的值就好了 改变后的列如下:
阅读全文
摘要:用pandas读入文件,时间格式是CST 想转为标准的年月日格式 代码: def cst_to_str(cstTime): tempTime = time.strptime(cstTime,'%a %b %d %H:%M:%S CST %Y') resTime = time.strftime('%Y
阅读全文

浙公网安备 33010602011771号