python进阶

  • 时间
import time
from datetime import datetime as dt
data['timestamp'] = data['OCC_TIM'].apply(lambda x:time.mktime(time.strptime(x,'%Y-%m-%d %H:%M:%S')))
data['OCC_TIM'] = data['timestamp'].apply(lambda x:time.strftime('%Y/%m/%d %H:%M:%S',time.localtime(x)))
 
  • 取小数位
round(x,2)
  •  dataframe转list
list=np.array(df).tolist()
list=df.values.tolist()
 

 

 

posted @ 2020-08-11 17:03  hqium  阅读(107)  评论(0编辑  收藏  举报