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()