python 判断是否为空NaN

import math
math.isnan(val)

  或

import pandas as pd
pd.isnull(val)

 math常用于数字,传字符串会报错,pd较为通用  


Python获取当前时间及格式化

# 导入time模块
import time

# 打印时间戳
print(time.time())

# 格式化时间戳为本地的时间
print(time.localtime(time.time()))

# 优化格式化化版本
print(time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time())))

  

 

相关文章:

  • 2021-12-02
  • 2021-10-01
  • 2021-07-04
  • 2022-12-23
  • 2021-09-01
  • 2021-07-17
猜你喜欢
  • 2021-05-21
  • 2021-07-09
  • 2021-12-17
  • 2021-05-28
  • 2021-10-26
  • 2021-12-29
  • 2021-11-27
相关资源
相似解决方案